docs(mcp): add MCP support documentation to README and docs (#300)

* docs(mcp): add MCP support documentation

* docs(readme): simplify MCP feature description

* docs(mcp): fix inaccuracies in MCP servers documentation

- Clarify that discovery runs on refresh, OAuth completion, or first
  tool call, not automatically at server creation
- Note that advanced settings (transport, auth, permission, direct
  tools) are configured in the edit dialog after creation
- Correct agent assignment UI description: switch toggle, not checkbox

* docs(mcp): explain proxy vs direct tool configuration

Add a dedicated section covering the three tool states (Off / Proxy /
Direct), what the mcp proxy tool does and why it exists, and when and
why to use direct tools, including the context-token trade-off.
This commit is contained in:
Yiling-J
2026-08-12 14:26:10 +08:00
committed by GitHub
parent 1cd94a77c6
commit 11758c23c0
4 changed files with 118 additions and 0 deletions
+1
View File
@@ -33,6 +33,7 @@ But Shumai goes beyond being a Frame.io alternative. With modern models like GPT
* **Agent as a Team Member**: Mention a context-aware AI agent with `@mentions` directly in asset comments, just like a real teammate.
* **Agent as a One-to-One Assistant**: Chat privately with the agent and ask it to help with tasks.
* **Custom Skills & Tools**: Extend the agent by registering custom scripts, tools, and automation skills.
* **Model Context Protocol (MCP)**: Connect agents to external tools and APIs through remote MCP servers, with OAuth authentication and per-agent MCP access.
* **Isolated Sandbox Execution**: Run agent-submitted scripts safely in a sandboxed environment.
* **AI Metadata Autofill**: Automatically fill in custom metadata for new assets.
* **Semantic Search**: Find assets by visual or conceptual meaning using vector embeddings (Gemini Embedding 2).
+1
View File
@@ -34,6 +34,7 @@ Shumai 是一个开源的 Frame.io 替代方案,专为创意团队打造,让
* **Agent 就像团队成员**:你可以在素材评论区里直接用 `@` 提到 AI Agent,像拉一个真实同事进来一起看稿一样。
* **Agent 也能当你的私聊助手**:你可以单独和它聊天,让它帮你查东西、做任务。
* **自定义技能和工具**:你可以给 Agent 接上自己的脚本、工具和自动化能力。
* **Model Context Protocol (MCP) 支持**:通过远程 MCP 服务端为 Agent 接入外部工具与 API,支持 OAuth 鉴权与按 Agent 独立分配访问权限。
* **沙箱隔离执行**:Agent 生成的脚本会在隔离环境里运行,更安全。
* **AI 自动补全元数据**:新素材上传后,系统可以自动帮你补一些元数据。
* **语义搜索**:支持按画面内容或语义找素材,底层用的是向量 embedding(Gemini Embedding 2)。
+1
View File
@@ -45,6 +45,7 @@
"using-shumai/agents",
"using-shumai/agent-skills",
"using-shumai/agent-tools",
"using-shumai/mcp-servers",
"using-shumai/agent-sandbox"
]
},
+115
View File
@@ -0,0 +1,115 @@
---
title: MCP Servers
description: Connect your agents to external tools and APIs using Model Context Protocol.
---
Model Context Protocol (MCP) is an open standard that enables AI models to safely interface with external tools, microservices, and APIs. In Shumai, you can register remote MCP servers using standard HTTP transports (`Streamable HTTP` or `SSE`) and assign them to your AI agents.
---
## How MCP Works in Shumai
Rather than overloading model context windows with dozens of complex parameter schemas, Shumai connects to MCP servers efficiently:
- **Automatic Discovery & Metadata Caching**: When you add an MCP server, Shumai records it in your team's settings and connects to the endpoint to discover available tools, server-reported usage instructions, and description metadata. Discovery runs when you refresh the server, complete an OAuth flow, or the first time an agent calls one of its tools. These schemas are cached in your database for fast retrieval.
- **Context-Efficient Proxy Tool (`mcp`)**: Assigned MCP servers are multiplexed through a single unified `mcp` proxy tool injected into your Chat Agents. The agent can dynamically inspect server status, search tools, view parameter schemas, and invoke functions as needed without wasting LLM tokens.
- **Direct Tools Option**: For high-frequency actions, you can optionally configure specific tools as **Direct Tools** to expose them directly to the agent as top-level LLM functions alongside the `mcp` proxy.
---
## Adding an MCP Server
To register a new MCP server in Shumai:
1. Navigate to **Team Settings** and click the **MCP** tab.
2. Click **Add MCP Server**.
3. In the dialog box, enter your **Server Endpoint URL** (e.g. `https://mcp.example.com/sse` or `http://localhost:8080/mcp`).
4. Click **Create**.
> **Note:** Only the **Server Endpoint URL** is required. Shumai derives a placeholder server name from the URL immediately; the server's actual name, status, instructions, and tool inventory are discovered the first time the server is connected (via the Refresh button in the edit dialog or the first tool call by an agent).
### Optional Server Configuration
After creating a server (the create dialog only requires a URL), open its edit dialog to configure advanced settings:
- **Transport**: Choose between `Streamable HTTP` (default) or `Server-Sent Events (SSE)`.
- **Auth Strategy**: Select `Auto-detect` (default), `None`, `Bearer Token`, or `OAuth 2.0`.
- **Minimum Permission Role**: Set the minimum team role required to invoke tools on this server (`Reviewer`, `Editor`, or `Owner`).
- **Direct Tools**: Specify a list of tool names that should be exposed directly to agents as native LLM tools.
---
## Understanding Tool Configuration
In the server's edit dialog, the **Tools** section lists every discovered tool with a three-state toggle (plus **All Off** / **All Proxy** / **All Direct** bulk actions):
- **Off**: The tool is excluded and completely invisible to agents — it cannot be listed, searched, or called through the proxy, nor registered as a direct tool. Use this to hide noisy or dangerous tools.
- **Proxy** (default): The tool is available through the single `mcp` proxy tool.
- **Direct**: The tool is exposed to agents as a native top-level function with a `{server}_{tool}` prefixed name.
### The `mcp` Proxy Tool
The `mcp` proxy tool is a single function injected into an agent's context that multiplexes every MCP server assigned to that agent. Instead of loading each tool's full parameter schema up front, the agent interacts with servers on demand:
- `mcp({})` — connection and auth status of all assigned servers
- `mcp({ server: "name" })` — list a server's tools
- `mcp({ search: "query" })` — search for tools across servers (schemas included by default)
- `mcp({ describe: "tool" })` — view one tool's full parameter schema
- `mcp({ instructions: "name" })` — view a server's usage instructions
- `mcp({ server: "name", tool: "tool_name", args: {...} })` — call a tool (pass either the `{server}_{tool}` prefixed name or the original name)
- `mcp({ action: "auth-start", server: "name" })` — start OAuth for a server
Because only one compact tool (plus a short server/tool listing) occupies the context window, the proxy keeps token usage low even when a server exposes dozens of tools. The trade-off is an extra discovery round trip: the agent typically lists or searches tools first, then calls them.
### Direct Tools
Direct tools flip the trade-off in the other direction. A tool configured as **Direct** is registered as a native top-level function (e.g. `tavily_mcp_tavily_search`) that the agent can invoke immediately, exactly like any built-in tool.
Why use direct tools:
- **Faster, more reliable calls** for high-frequency actions: the full parameter schema is always in the context window, so the agent can call the tool in a single step without first discovering it through the proxy.
- **Better tool discovery**: the model sees the tool and its description up front and is more likely to reach for it at the right moment.
The cost: every direct tool permanently consumes context tokens for its schema, so reserve **Direct** for frequently used or critical tools and keep large MCP servers on **Proxy** to avoid unnecessary context overhead. Direct tools are still subject to the same role-based permission checks as proxy calls, and the `mcp` proxy tool remains available for discovery, auth, and status.
---
## Authentication Modes
Shumai supports several authentication strategies for securing access to MCP endpoints:
### 1. No Auth (`none`)
Used for public or local MCP servers that do not require credentials.
### 2. Bearer Token (`bearer`)
Provide a static API token or key. Shumai attaches this token in the `Authorization: Bearer <token>` header for all transport requests.
### 3. OAuth 2.0 (`oauth`)
For MCP endpoints protected by OAuth identity providers:
- **Authorization Code + PKCE**: Click **Connect** on the server card in Team Settings. Shumai opens a secure OAuth popup window directing you to the identity provider. After approving permissions, the browser automatically redirects back to Shumai, completes token exchange, and refreshes server tools.
- **Client Credentials**: Provide a `Client ID` and `Client Secret` for automated server-to-server token acquisition.
---
## Assigning MCP Servers to Agents
By default, newly added MCP servers are **not assigned to any agent**. To give an agent access to an MCP server:
1. Navigate to **Team Settings** > **Agents**.
2. Click on the target agent to open its configuration dialog.
3. Scroll down to the **MCP Servers** section.
4. Toggle the switch next to the MCP server(s) you want to authorize for this agent.
5. Click **Save Changes**.
---
## Role-Based Access Control
Each MCP server has a **Minimum Required Role** setting (`Reviewer`, `Editor`, or `Owner`):
- When an agent attempts to call a tool on an MCP server, Shumai verifies the role of the user interacting with the agent.
- If the user's role does not meet the minimum requirement, tool execution is blocked with a permission error message, preventing unauthorized actions.