MCP Server
Connect MCP (Model Context Protocol) servers to LangBot to extend your AI bot with external tools and data sources.
LangBot can call tools from MCP servers. Once an MCP server is added, the built-in Agent — with tool use enabled on its model — can invoke those tools during a conversation.
MCP supports two modes: local (stdio) and remote.
Install from LangBot Space for the smoothest setup — listed MCPs are pre-configured and ready to use.
You can also fetch from ModelScope, mcp.so, or composio.dev, then add them manually as shown below.
Two Transport Modes
| Mode | When to use | Notes |
|---|---|---|
Remote (mode: "remote") | Remote MCP service — just paste the URL | LangBot connects to the remote URL directly and auto-detects the transport (tries Streamable HTTP first, falls back to SSE) — no need to choose by hand |
Local / stdio (mode: "stdio") | MCP server launched by a local command | Only available when Box Runtime is up |
Earlier versions split the remote mode into separate http (Streamable HTTP) and sse options; these are now unified into a single remote mode, with the transport auto-detected by the backend. Existing http / sse rows in the database are normalized to remote on upgrade, and their connection args (URL, headers, timeout) are preserved unchanged.
MCP tools require the Chat to use the built-in Agent, with a model that has tool use enabled — see Models. External runners (Dify, n8n, Langflow, Coze, etc.) use their own tool mechanisms.
Installing an MCP Server
From LangBot Space (Preferred)
LangBot Space is the official LangBot marketplace, with a curated list of ready-to-use MCP servers. In the WebUI, browse and install them with one click under Plugin Management → MCP Management — URL, command, and mode are filled in by the listing, so nothing has to be configured by hand.
This covers most cases. For services that aren't listed, use the manual flow below.
Adding Manually
Open Plugin Management → MCP Management:
Click Add in the top right, choose Add MCP Server, pick Local (stdio) or Remote mode: for remote just paste the URL, for local fill in the launch command. Click Test to verify connectivity, then Submit:
After saving, toggle the switch on the card to connect. Click the card to see details:
Enabling in a Chat
Once an MCP server is added, the Chat's extension config decides which servers the Agent can see:
- Enable "all MCP servers", or
- Bind only specific MCP servers
Tools from unbound servers won't appear in that Chat's tool list.
Advanced: stdio MCP
stdio MCP is hosted by Box Runtime. Before the connection is ready, LangBot:
- Creates or reuses a shared MCP Box session
- Starts the package-based stdio command (such as
npxoruvx) inside the Box workspace (/workspace) - Connects the MCP process's stdin/stdout through an authenticated WebSocket relay
To fine-tune network, image, resource limits, or timeout behavior, add a box override under the MCP extra_args:
{
"mode": "stdio",
"extra_args": {
"command": "uvx",
"args": ["mcp-server-time"],
"env": {},
"box": {
"network": "on",
"startup_timeout_sec": 120,
"image": "python:3.11-slim"
}
}
}Common fields:
| Field | Notes |
|---|---|
network | Whether network is allowed (typically for package downloads and API access) |
startup_timeout_sec | Box prep + command startup timeout, default 300s |
image | Runtime image when the Docker backend is used |
memory_mb | Per-server memory cap (MB); overrides global box.default_memory_mb for this server |
stdio MCP runs inside Box in network-only mode. Mounting a local host project via box.host_path is no longer supported; servers configured with box.host_path fail explicitly on startup. Use a package-based stdio command (npx / uvx) or a remote HTTP/SSE MCP server instead.
Share to LangBot Space
A remote MCP server can be submitted to the marketplace with Share to Space on its detail page. Only remote servers can be shared for now.
- Connect it successfully first; its tool list is published with it.
- Credentials are never uploaded. Credential-like headers, URL parameters and path segments become
${VAR}placeholders, and the dialog shows exactly what will be published. - When someone installs it from the marketplace, the server stays disabled and its detail page lists the placeholders to fill. Replace them with your own values, save, then enable it.
- Submissions become public after review.
You can attach an icon (PNG, JPEG, WebP or GIF, up to 2 MB), which appears once the submission is approved. After publishing, change it any time under My Submissions in your LangBot Space profile; that takes effect immediately.
Common Issues
| Symptom | What to check |
|---|---|
| MCP connection fails | URL, command, arguments, env vars are correct |
| stdio MCP stuck connecting | Box Runtime status; startup_timeout_sec may be too short |
| Dependency install fails | Sandbox network permission; package name and arguments are correct |
Legacy box.host_path error | Remove box.host_path and switch to npx / uvx or a remote HTTP/SSE MCP server |
| Agent doesn't see MCP tools | Chat uses built-in Agent; model has tool use enabled; MCP is bound on the Chat |
