Files
9ff492ac41 feat(space-share): prompt library and sharing prompts/skills/remote MCPs/local plugins to Space (LANG-439) (#3027)
* feat(space-share): share prompts, skills, remote MCPs and local plugins to LangBot Space (LANG-439)

- Prompt library dialog on Pipeline (messaging) and Agent (agent) prompt
  fields: search, preview, replace/append, favorites tied to the bound
  LangBot Account; share the current prompt for review
- Share to Space for Skills (file list + credential scan) and remote MCP
  servers (credentials become ${VAR} placeholders before anything leaves
  Core; stdio stays private)
- Community MCP installs with required inputs are created disabled and the
  detail page lists the placeholders to fill (unfilled_inputs)
- Locally / GitHub-installed plugins share their exact installed .lbpkg via
  the existing space-upload flow
- docs (zh/en/ja) and dev-docs contract note

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(web): use a star for prompt favorites (LANG-439)

The heart is the anonymous extension like; favorites need a LangBot Account.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* fix(i18n): call messaging prompts "Messaging" in English (LANG-439)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): marketplace type tiles matching Space, shadcn prompt list (LANG-439)

- the in-app marketplace shows All / Plugins / MCP / Skills as tiles with a
  description and count, plugin components and Runner usage as ToggleGroup
  chips; the Filters popover is gone (same layout as space.langbot.app)
- prompt library rows use the shadcn Item component

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* style(market): soften extension type tiles; type-tinted selected state

Drop the dark outline/ring on the selected tile. Idle tiles use a muted
fill; the selected tile gets a soft type-tinted fill with an inset ring
and a solid icon badge.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* style(market): use a fixed blue for the selected All tile

The theme primary is near-black in Core, which brought back the dark
selected border on the All tile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): switch market type on press and keep results while loading

Type tiles switch on mouse press (keyboard/touch still use click).
Filter changes keep the current cards dimmed until the new page arrives,
and stale responses are ignored.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): apply library prompts in the WebUI language; one-language share note

- Prompt library applies the version matching the WebUI language (exact
  -> same family -> en_US -> original), with a language switcher.
- Share dialogs say one language is enough; other languages are
  translated automatically after upload.
- extractI18nObject falls back across Chinese scripts and to any
  available language instead of rendering an empty label.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): one-click LangBot Account binding from share and library

- Share dialogs: the 'bind a LangBot Account' state now has a button that
  starts the bind flow and returns to the same page; the creator-profile
  state gets a button too, with clearer copy.
- Prompt library: when no account is bound, the preview shows a
  'bind to favorite' button instead of only a disabled tab tooltip.
- Shared useSpaceBind hook.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(web): friendly empty state for templates; contributors no longer tag

- Empty template list: short, playful 'on their way, be the first to
  share' state (Space /templates, Core prompt library).
- Share dialogs drop the tags field; Space assigns tags during review.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

* feat(space-share): update an existing item; clearer identifier field

- Share dialogs list the bound account's published items of the same type
  (prompts: same kind) and offer 'Update existing': pick an identifier,
  metadata is prefilled, a changelog is asked for and the submission
  becomes the next version. Sharing something with the same identifier
  preselects update mode.
- The identifier field now looks like a normal input with the fixed
  '@creator/' prefix and a format hint.
- GET /api/v1/space-share/items proxies the Space owner item list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: multica-agent <github@multica.ai>
2026-11-14 21:20:18 +08:00
..

---
title: "MCP Server"
description: "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.

<Info title="MCP supports two modes: local (stdio) and remote.">
  Install from [LangBot Space](https://space.langbot.app) for the smoothest setup — listed MCPs are pre-configured and ready to use.

  You can also fetch from [ModelScope](https://modelscope.cn/mcp), [mcp.so](https://mcp.so), or [composio.dev](https://composio.dev/toolkits), then add them manually as shown below.
</Info>

## 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 |

<Note>
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.
</Note>

<Note>
MCP tools require the pipeline to use the **built-in Agent**, with a model that has **tool use enabled** — see [Models](../models/readme). External runners (Dify, n8n, Langflow, Coze, etc.) use their own tool mechanisms.
</Note>

## Installing an MCP Server

### From LangBot Space (Preferred)

[LangBot Space](https://space.langbot.app) 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`:

<img width="1000px" src="/images/zh/deploy/mcp/mcp02.png" alt="MCP management page" />

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`:

<img width="400px" src="/images/zh/deploy/mcp/mcp03.png" alt="create new MCP server" />

After saving, toggle the switch on the card to connect. Click the card to see details:

<img width="400px" src="/images/zh/deploy/mcp/mcp05.png" alt="MCP server detail" />

## Enabling in a Pipeline

Once an MCP server is added, the pipeline 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 pipeline's tool list.

## Advanced: stdio MCP

stdio MCP is hosted by Box Runtime. Before the connection is ready, LangBot:

1. Creates or reuses a shared MCP Box session
2. If a local project path can be inferred from the command, stages the project into the workspace
3. Installs dependencies if the project has `requirements.txt`, `pyproject.toml`, `setup.py`, or `setup.cfg`
4. Connects the MCP process's stdin/stdout through a WebSocket relay

To fine-tune mount, network, or timeout behavior, add a `box` override under the MCP `extra_args`:

```json
{
  "mode": "stdio",
  "extra_args": {
    "command": "python",
    "args": ["server.py"],
    "env": {},
    "box": {
      "host_path": "/path/to/mcp-project",
      "network": "on",
      "host_path_mode": "ro",
      "startup_timeout_sec": 120,
      "image": "python:3.11-slim"
    }
  }
}
```

Common fields:

| Field | Notes |
|-------|-------|
| `host_path` | MCP project directory on the host. Must be within `box.local.allowed_mount_roots` |
| `network` | Whether network is allowed (typically for dependency install) |
| `host_path_mode` | Access mode when staging `host_path`; defaults to `ro`. stdio MCP usually stages into the workspace |
| `startup_timeout_sec` | Box prep + dependency install timeout, default 120s. Connection wait gets about 30s extra |
| `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 |

<Warning>
stdio MCP runs inside Box. Dependency install and process startup are subject to the sandbox profile, network permission, resource limits, and the mount allowlist.
</Warning>

## 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.

## 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; dependency files are correct |
| Local files inaccessible | `host_path` exists; it's inside `allowed_mount_roots` |
| Agent doesn't see MCP tools | Pipeline uses built-in Agent; model has tool use enabled; MCP is bound on the pipeline |