Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions docs/en/customization/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,40 @@ Plugins can also declare MCP servers in their manifest. Servers declared by a pl
stdio entries in a project-level `.kimi-code/mcp.json` execute local commands when a session starts. Only enable these in repositories you trust.
:::

### Example: an authenticated HTTP server

The optional fields above are easier to place against a concrete server. [You.com](https://you.com/docs/build-with-agents/mcp-server?utm_source=moonshotai-kimi-code&utm_medium=oss_integration&utm_campaign=2026-07-oss-integrations&utm_content=docs) serves web search over HTTP and can be connected with or without credentials:

```json
{
"mcpServers": {
"you-free": {
"url": "https://api.you.com/mcp?profile=free"
},
"you": {
"url": "https://api.you.com/mcp",
"bearerTokenEnvVar": "YDC_API_KEY"
}
}
}
```

`you-free` needs no credentials and exposes `you-search` on its own. The authenticated entry reads its token from `$YDC_API_KEY` and additionally exposes `you-contents`, `you-research`, `you-discover`, and `you-balance`. To authorize through the browser instead of a static token, omit `bearerTokenEnvVar` and run `/mcp-config login you`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Remove the unsupported browser-login alternative

For users who follow this alternative without YDC_API_KEY, /mcp-config login you cannot replace the static token: that command performs the MCP OAuth discovery/authorization flow, while this endpoint authenticates with a You.com API key and the commit only verified bearer-token access. The result is a failed login rather than a connected server, so either omit this sentence or point to an OAuth-capable endpoint and verify its authorization flow.

Useful? React with 👍 / 👎.


Use `enabledTools` to narrow a server down to the tools you actually want:

```json
{
"mcpServers": {
"you": {
"url": "https://api.you.com/mcp",
"bearerTokenEnvVar": "YDC_API_KEY",
"enabledTools": ["you-search", "you-contents"]
}
}
}
```

## Tool Naming and Permissions

MCP tools are named in the format `mcp__<server>__<tool>`, for example `mcp__github__create_issue`. Permission rules support `*` and `**` wildcards, for example `mcp__github__*` matches all tools under that server. MCP tool parameters are not included in permission matching.
Expand Down
34 changes: 34 additions & 0 deletions docs/zh/customization/mcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,40 @@ Plugins 也可以在 manifest 中声明 MCP servers。Plugin 声明的 servers
项目级 `.kimi-code/mcp.json` 中的 stdio 条目会在会话启动时执行本地命令,只在你信任的仓库里启用。
:::

### 示例:带鉴权的 HTTP server

结合一个真实的 server 更容易理解上面这些可选字段。[You.com](https://you.com/docs/build-with-agents/mcp-server?utm_source=moonshotai-kimi-code&utm_medium=oss_integration&utm_campaign=2026-07-oss-integrations&utm_content=docs) 通过 HTTP 提供网页搜索,可以在有凭证和无凭证两种方式下连接:

```json
{
"mcpServers": {
"you-free": {
"url": "https://api.you.com/mcp?profile=free"
},
"you": {
"url": "https://api.you.com/mcp",
"bearerTokenEnvVar": "YDC_API_KEY"
}
}
}
```

`you-free` 不需要凭证,只提供 `you-search`。带鉴权的条目从 `$YDC_API_KEY` 读取 token,并额外提供 `you-contents`、`you-research`、`you-discover` 和 `you-balance`。如果想用浏览器授权而不是静态 token,去掉 `bearerTokenEnvVar` 并运行 `/mcp-config login you`。

用 `enabledTools` 可以把 server 收窄到你真正需要的工具:

```json
{
"mcpServers": {
"you": {
"url": "https://api.you.com/mcp",
"bearerTokenEnvVar": "YDC_API_KEY",
"enabledTools": ["you-search", "you-contents"]
}
}
}
```

## 工具命名与权限

MCP 工具按 `mcp__<server>__<tool>` 格式命名,例如 `mcp__github__create_issue`。权限规则中支持 `*` 和 `**` 通配,例如 `mcp__github__*` 命中该 server 下所有工具。MCP 工具参数不参与权限匹配。
Expand Down