managing-mcp-servers
它能做什么
这个技能向 AI 展示如何在 ThinkRail 应用中设置 MCP 服务器。MCP 服务器能把 AI 工具连接到外部服务。适合希望把文档或浏览器等工具连接到自己助手上的人。
适用场景
- ✓当你希望把外部服务(例如文档或浏览器工具)添加到你的助手上时。
- ✓当 MCP 服务器中的某个工具缺失、需要登录或失败时。
- ✓当你希望开启、关闭或移除某个 MCP 服务器时。
技能链接
https://github.com/JetBrains/thinkrail/blob/main/packages/server/skills/managing-mcp-servers/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请把我的助手连接到我们公司的文档服务器,并告诉我它是否需要我登录。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会编辑该服务器的配置文件,引导你前往 ThinkRail 设置页面完成批准和登录,并且绝不会把密钥写入文件。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Managing MCP servers in ThinkRail
ThinkRail uses pi's built-in MCP support but has no pi executable. Never run pi mcp add,
pi mcp login or other pi commands; edit the configuration files and point the user at
Settings › MCP servers for everything that needs them.
Where servers are configured
- User level — pi's agent directory, usually
~/.pi/agent/mcp.json: available in every project. - This repository —
.pi/mcp.jsonin the worktree, tracked in git. A server defined here does not run until the user approves it in Settings, and any later change to its entry needs approval again. It only loads when the user trusts the project.
Both files use pi's format:
{
"mcpServers": {
"docs": { "url": "https://example.com/mcp" },
"browser": { "command": "npx", "args": ["-y", "@playwright/mcp@0.0.83"] }
}
}
- Pin package versions in
args; never@latest. - Never write a secret into either file. Reference it as
${ENV_VAR}(from the host's environment) or!command(the command's output, for example!gh auth token), or let the user sign in. exposure:deferred(the default here — load the server's tools withtool_searchfirst),direct(a few always-useful tools), orhidden.codemodeis treated asdeferred.- Prefer the user-level file for personal servers; only put a server in
.pi/mcp.jsonwhen the user wants it shared with the repository.
GitHub
GitHub is a recipe, not a preset: its hosted server, authenticated with the user's GitHub CLI sign-in. Add it to the user-level file (Settings › MCP servers offers the same entry under Paste JSON):
{
"mcpServers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/readonly",
"headers": { "Authorization": "!t=$(gh auth token) && echo \"Bearer $t\"" }
}
}
}
/readonlyis GitHub's documented read-only mode (same as anX-MCP-Readonly: trueheader). Usehttps://api.githubcopilot.com/mcp/only when the user asks for tools that change data.- The header command runs each time a chat connects. While
ghis logged out it fails instead of sending an empty token; the user runsgh auth loginin a terminal. - Unverified: whether GitHub accepts the GitHub CLI token's scopes for every toolset. If the server
rejects it, ask the user for a token in an environment variable:
"Authorization": "Bearer ${GITHUB_TOKEN}".
After editing
The host reloads idle chats on its own and a busy chat picks the change up when it is idle. Tell the user when a step is theirs: approving a repository server, or Sign in for a server that uses OAuth (both in Settings › MCP servers). Do not ask them to restart ThinkRail.
Using MCP tools
- Tools are named
mcp__<server>__<tool>. For adeferredserver, calltool_searchto load them. - Subagents cannot call MCP tools: call them yourself and put what the subagent needs in its task.
- ThinkRail asks the user before a call that may change data. A denied or cancelled call is final for that call; do not retry it without asking the user first.
常见问题
我的 MCP 服务器设置保存在哪里?
可以保存在适用于所有项目的用户级文件中,也可以保存在你在设置中批准的项目文件中。
我的密码会保存在文件里吗?
不会。密钥从环境变量或登录步骤中读取,绝不会写入文件。
服务器运行前需要我批准吗?
项目文件中的服务器需要批准。在你于设置中批准之前,服务器不会运行,之后的每次修改都需要重新批准。
详情
作者的原始描述
Use when the user asks to add, change, remove, enable or disable an MCP server, or when an MCP tool is missing, needs sign-in, fails, or was blocked. ThinkRail runs pi in-process, so there is no `pi` command to call.
repo: JetBrains/thinkrail
热度
- GitHub 星标
- 7.1k
- 排名
- #13497
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
asking-user-questions
7.1k教你的智能体分轮次向你提出清晰的问题,并给出合适的回答选项,直到悬而未决的问题都得到确定。
brainstorming
7.1k帮你的智能体在构建之前,和你一起讨论功能、行为变更或缺陷修复,并记录商定的设计。
choosing-a-workflow
7.1k帮你的智能体为新项目、拉取请求或任何产品功能的变更,选择合适的 ThinkRail 工作流。
importing-a-codebase
7.1k教你的智能体阅读现有代码库,并起草第一套项目规格,只在代码不清楚的地方询问你。