Skip to main content

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.

Metadata

Release files for langchain-mcp 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-mcp 0.2.1
File Size Uploaded
langchain_mcp-0.2.1.tar.gz 61.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-mcp 0.2.1
File Interpreter ABI Platform
langchain_mcp-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 65.2 kB

Release files / langchain_mcp-0.2.1.tar.gz

Download URL langchain_mcp-0.2.1.tar.gz
Size 61.1 kB
Tags Source
SHA-256 checksum
How to use checksums
cb5bf34e609746cf40544b2e509ec927acbdcd4fc1031a1689f4ada52459e113
BLAKE2b-256 checksum
How to use checksums
bc63dc1b4a702de92e298b6b9cebc338c6ac375a0770d67f71613b2fef866198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 1, 2025.

Transparency log

Release files / langchain_mcp-0.2.1-py3-none-any.whl

Download URL langchain_mcp-0.2.1-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d7ddc9b4281cc3eadcc0fcf2151d196ad19038585f9850883ad497254d02ef5b
BLAKE2b-256 checksum
How to use checksums
567e6d3d54602b7b798af8e704a6cf22ca123fbdc12562d24c30f173fd03ec54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 1, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page