LangChain

Agent framework for Python and JavaScript. An adapter package turns MCP servers into framework tools.

Agent framework verified 2026-07-15

How to add a server to LangChain

  1. Install the MCP adapter package for your language
  2. Construct a client with the server command or endpoint
  3. Load the tools and pass them to your agent

Where the configuration lives

Configured in the interface, not in a file.

Local server configuration

client = MultiServerMCPClient({
    "{{name}}": {
        "command": "{{command}}",
        "args": {{args}},
        "transport": "stdio",
    }
})

Hosted server configuration

client = MultiServerMCPClient({
    "{{name}}": {
        "url": "{{url}}",
        "transport": "streamable_http",
    }
})

Placeholders such as {{name}}, {{command}}, {{args}} and {{url}} are filled from each server's package or endpoint data.

Protocol support

Support is uneven across clients. A server that only exposes prompts is of no use in a client that does not implement them.

Transports
TransportSupported
stdioYes
Streamable HTTPYes
SSEYes
Features
FeatureSupported
ToolsYes
ResourcesYes
PromptsYes
SamplingNo
RootsNo
ElicitationNo
OAuthYes

Official LangChain MCP documentation

Frequently asked questions

How do I add an MCP server to LangChain?
1. Install the MCP adapter package for your language 2. Construct a client with the server command or endpoint 3. Load the tools and pass them to your agent
Where is the LangChain MCP configuration stored?
There is no file to edit. Servers are added through the interface, and any API key is stored in the platform's own credential store.
Can LangChain run a local MCP server?
Yes. It can start a local process and talk to it over stdio, so packaged servers work without any hosting.
Which parts of the protocol does LangChain not support?
It does not implement sampling or elicitation. A server whose value is mostly in those features will feel incomplete here.
Does LangChain need restarting after adding a server?
No, it picks up the change without a restart.
When was this setup information last checked?
These details were verified on 2026-07-15. Clients change their configuration format from time to time, so check the official documentation if something does not work.

Other clients

Claude Desktop Claude Code Cursor Visual Studio Code Cline Windsurf