Skip to main content

Model Context Protocol tool calling support for LangChain

Project description

langchain-mcp

PyPI - Version

Model Context Protocol tool calling support in LangChain.

Create a langchain_mcp.MCPToolkit with an mcp.ClientSession, then await toolkit.initialize() and toolkit.get_tools() to get the list of langchain_core.tools.BaseTools.

Example:

https://github.com/rectalogic/langchain-mcp/blob/8fa8445a24755bf91789f52718c32361ed916f46/tests/demo.py#L34-L43

Demo

You can run the demo against Groq llama-3.1-8b-instant:

$ export GROQ_API_KEY=xxx
$ uv run tests/demo.py "Read and summarize the file ./LICENSE"
Secure MCP Filesystem Server running on stdio
Allowed directories: [ '/users/aw/projects/rectalogic/langchain-mcp' ]
The file ./LICENSE is a MIT License agreement. It states that the software is provided "as is" without warranty and that the authors and copyright holders are not liable for any claims, damages, or other liability arising from the software or its use.

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

langchain_mcp-0.2.1.tar.gz (61.1 kB view details)

Uploaded Source

Built Distribution

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

langchain_mcp-0.2.1-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file langchain_mcp-0.2.1.tar.gz.

File metadata

  • Download URL: langchain_mcp-0.2.1.tar.gz
  • Upload date:
  • Size: 61.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for langchain_mcp-0.2.1.tar.gz
Algorithm Hash digest
SHA256 cb5bf34e609746cf40544b2e509ec927acbdcd4fc1031a1689f4ada52459e113
MD5 dff81a9fbb42fd663fe68c753989ed7b
BLAKE2b-256 bc63dc1b4a702de92e298b6b9cebc338c6ac375a0770d67f71613b2fef866198

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_mcp-0.2.1.tar.gz:

Publisher: publish.yml on rectalogic/langchain-mcp

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

File details

Details for the file langchain_mcp-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: langchain_mcp-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for langchain_mcp-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d7ddc9b4281cc3eadcc0fcf2151d196ad19038585f9850883ad497254d02ef5b
MD5 ce44c75f2a39550de3a298a2063f6a36
BLAKE2b-256 567e6d3d54602b7b798af8e704a6cf22ca123fbdc12562d24c30f173fd03ec54

See more details on using hashes here.

Provenance

The following attestation bundles were made for langchain_mcp-0.2.1-py3-none-any.whl:

Publisher: publish.yml on rectalogic/langchain-mcp

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