Skip to main content

MCP-compatible LangChain tools for AI agents — calculator, datetime, converter, and more.

Project description

PyMCPX

MCP-compatible LangChain tools for AI agents — calculator, datetime, converter, and more.

Python License: MIT Pypi: Pymcpx


Features

  • 🔌 MCP-compatible — every tool exposes a stable name and JSON schema consumable by any MCP host
  • 🦜 LangChain-native — each tool extends BaseTool with typed args_schema
  • 🧱 Pydantic v2 — validated inputs and outputs
  • 🧪 Simulation engine — run agent workflows offline without any API keys
  • 📦 Service extras — install only what you need: pip install pymcpx[calculator]

Installation

# Core package (no service dependencies)
pip install pymcpx

# Specific service
pip install pymcpx[calculator]
pip install pymcpx[datetime]
pip install pymcpx[converter]

# All services
pip install pymcpx[all]

# Development
pip install pymcpx[dev]

Services

For full details on the tools, schemas, and offline simulation engines of each service, refer to their respective service-level README.md files:

Service Status Install Extra Documentation
Calculator ✅ Ready pymcpx[calculator] README
Converter ✅ Ready pymcpx[converter] README
Datetime ✅ Ready pymcpx[datetime] README
IPstack ✅ Ready pymcpx[ipstack] README
Marketstack ✅ Ready pymcpx[marketstack] README
Weatherstack ✅ Ready pymcpx[weatherstack] README
Numverify ✅ Ready pymcpx[numverify] README
Fixer ✅ Ready pymcpx[fixer] README
Aviationstack ✅ Ready pymcpx[aviationstack] README
Zenserp ✅ Ready pymcpx[zenserp] README
Screenshotlayer ✅ Ready pymcpx[screenshotlayer] README
ExchangeRate.host ✅ Ready pymcpx[exchangeratehost] README

Contributing

Getting Started

git clone https://github.com/your-org/pymcpx.git
cd pymcpx
pip install -e ".[dev]"

Workflow

  1. Create a branch: git checkout -b feat/my-feature
  2. Make changes following the coding conventions
  3. Add / update tests
  4. Run tests: pytest
  5. Submit a Pull Request

Adding a New Service

Create a new directory under pymcpx/services/<name>/ following the layout of pymcpx/services/ipstack/:

  • SimulationEngine/models.py — Pydantic input models
  • SimulationEngine/utils.py — business logic, API clients
  • tools.pyBaseTool subclasses + MCP_TOOLS list
  • SimulationEngine/engine.py — offline simulation engine
  • tests/test_<name>.py — unit tests with respx mocks
  • README.md — service documentation including:
    • Prerequisites (API key setup)
    • Installation command
    • Tools table with names, classes, descriptions, and input keys
    • Usage examples (individual tools, toolkit, MCP integration)

Then add a re-export shim at pymcpx/<name>.py, register the optional dependency in pyproject.toml, and add the service row to the README Services table.

Pull Request Requirements

  • All tests pass
  • No new ruff warnings
  • New services include all required files (see above)

Continuous Integration

CI (.github/workflows/tests.yml) runs automatically on every push and pull request across Python 3.11 and 3.12 with coverage reporting.

Special Thanks

Special thanks to the Public APIs repository, a manually curated list of public APIs from many domains, which serves as a treasure trove of APIs and inspired our external service integrations.

License

MIT © PyMCPX Contributors

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymcpx-0.1.0.tar.gz (93.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymcpx-0.1.0-py3-none-any.whl (111.1 kB view details)

Uploaded Python 3

File details

Details for the file pymcpx-0.1.0.tar.gz.

File metadata

  • Download URL: pymcpx-0.1.0.tar.gz
  • Upload date:
  • Size: 93.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pymcpx-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7df2e016a9ea6a24ae384b71200918fe3af03fe4fcf7e0c71fc588b7cd7394bb
MD5 d8c484d3b1c1b216d04d714eb7780a08
BLAKE2b-256 6a9c1581b867588f1682b3fef0ec5642a2053a39bc354905c18955176c292d20

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymcpx-0.1.0.tar.gz:

Publisher: python-publish.yml on mohitprajapat2001/pymcpx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pymcpx-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pymcpx-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 111.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pymcpx-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9900102baa074c2b52fc4d9d29a5c0bdb374a751de2fa322624e7f04da6c843f
MD5 2c5a784a62d9eecd4722d20caca9fc59
BLAKE2b-256 4f20b07de44f95059dc9cbd959f91a6dda0ef2a4698fd726f1174e524389e1c6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pymcpx-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on mohitprajapat2001/pymcpx

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page