Skip to content
LangChain

cosmos mcp for LangChain

io.github.teampolarity/cosmos-mcp

Personal knowledge graph every MCP client reads from and writes to. Portable across agents.

client:LangChain transport:stdio runtime:npm

Install cosmos mcp in LangChain

pip install langchain-mcp-adapters

from langchain_mcp_adapters.client import MultiServerMCPClient

client = MultiServerMCPClient({
        "cosmos-mcp": {
            "transport": "stdio",
            "command": "npx",
            "args": ["-y", "@polarity-lab/cosmos-mcp"],
        }
})

tools = await client.get_tools()

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

cosmos mcp in other clients