Skip to content
LangChain

Mathematical Code Execution for LangChain

ai.saifs/code-execution

Run sandboxed Python for calculations and PDFs; no other languages, installs or network.

client:LangChain transport:streamable-http

Install Mathematical Code Execution in LangChain

pip install langchain-mcp-adapters

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
        "code-execution": {
            "transport": "streamable_http",
            "url": "https://code-execution-mcp.saifs.ai/mcp",
        }
})

tools = await client.get_tools()

get_tools() returns the server's tools as LangChain tools, ready for an agent. LangChain docs

Mathematical Code Execution in other clients