Add Mcp 标志

Add Mcp

社区
lploc94
add-mcp

Use when connecting an MCP server for Raw, explaining its binding, or diagnosing tools, including dashboard discovery. Select exact original names and verify live calls. Use create-package to share definitions.

概览

发布者lploc94
代码仓库raw-cli
技能名称add-mcp
星标数
107
复刻数
14
附带文件
2
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 2 个附带文件

    模型执行任务时可读取的脚本、模板和参考资料。这些文件为只读文件,绝不会被执行。

  • 开源

    由 lploc94 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Add Mcp AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/lploc94/raw-cli/tree/main/examples/skills/add_mcp
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/lploc94/raw-cli.git /tmp/raw-cli
mkdir -p .claude/skills
cp -r /tmp/raw-cli/examples/skills/add_mcp .claude/skills/add-mcp
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Add Mcp,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Add Mcp。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Add Mcp 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Add an MCP server to Raw

Use when connecting a new MCP capability to a Raw agent or diagnosing that connection. For a how-to, explain connection schema, exact selection and verification. For an actual setup, use the requested server; creating the optional echo fixture below is not a prerequisite or a replacement for that server.

Read references/packages.md for package bindings and references/dashboard.md for browser discovery with read_file.

Establish the connection

Identify the target config/agent, server command or endpoint, authentication requirements and needed tools. Use the server's actual documentation or tools/list to get original tool names. Ask for a missing endpoint/command or required credential source rather than inventing them. For an existing server, inspect its error and definition before replacing it.

Top-level mcp.servers is a connection catalog. An agent activates only exact entries in its ordered tools.use, e.g. mcp/search/web_search. A server definition alone stays inert. Do not select mcp/server/* or substitute Raw's generated model-facing alias for the original tool name.

Connection contract

TransportRequiredOptional
stdiotransport:"stdio", nonempty string commandargs: string array; env: string-to-string map; timeout_ms
remotetransport:"streamable-http", HTTP(S) string urlheaders: string-to-string map; timeout_ms

timeout_ms (integer 1..2147483647, default the agent's request_timeout_ms) bounds connect, tool discovery and each tool call. A call whose server sends progress notifications restarts the timer on each one, so raise it only for tools that work silently for long.

Those are the two configuration transports; unknown fields fail. Stdio starts in the session cwd. Make command/script paths valid for the target machine; a relative script argument is not automatically config-relative. Stdout must carry MCP protocol messages, with logs on stderr. Unselected catalog entries do not start.

env and headers are literal values: Raw does not expand ${VAR}. A stdio server can read inherited environment variables through its own authentication mechanism. For a remote endpoint needing a header, obtain a valid private value using the supported setup; do not teach nonexistent interpolation or OAuth configuration fields.

For a remote server, place this object at mcp.servers.search; replace the placeholder URL/header, then select exact names returned by that server:

json
{ "transport": "streamable-http", "url": "https://example.test/mcp", "headers": { "Authorization": "Bearer REPLACE_IN_PRIVATE_CONFIG" } }

For example, select mcp/search/web_search only if that is a real listed name. The URL itself is not a tool ID. Keep existing agents, servers, defaults and selected tool ordering intact.

Register and verify the requested server

  1. Obtain server-specific command/arguments or URL, check executable/dependency availability, and discover the actual tools. Verify the tool's input schema before choosing test arguments.
  2. Back up the config, add one server definition, and append only requested mcp/<server>/<original-name> IDs to agents.<name>.tools.use. Keep config mode 0600. Follow the canonical/portable path actually in use.
  3. Run raw config list or raw --config PATH config list. This checks structure and selected IDs' syntax; it does not prove handshake, original tool existence or successful execution.
  4. If the installed @tlelabs/raw library is importable, call loadConfig({configPath,requireModel:false}), then createRuntimeTools({runtime,cwd}). tools.mcp.catalog contains discovered tools; tools.mcp.exposed contains selected ones; tools.warnings must be empty. Find the selected server/original name there, dispatch its alias through tools.registry.dispatch(alias,args,{cwd,maxOutputBytes:8192}), inspect the real result, and close tools.mcp in finally. This does not require a model request. Otherwise run a harmless task with the configured agent when model access is available. Report inability to verify rather than equating config parsing with a live pass.
  5. Use a harmless server-specific call. Do not perform writes, purchases or other unrelated side effects just to test the connection. Unselecting the server's tool IDs should leave the definition inert on the next startup.
  6. Add a requested policy under this agent's tools.rules, matching canonical mcp/server/tool, not the alias. Effects are allow/ask/deny, last matching rule wins, unmatched calls run. Only ask permits when on a schema-bound string path and an RE2 regex. Verify policy with harmless arguments; headless ask without approval fails closed. Policy does not sandbox the server.

The registry/schema view is fixed for a running CLI session. Editing config does not add a callable MCP alias to that same session automatically; verify the changed configuration through a fresh runtime or next run.

Optional complete stdio test fixture

Use only when the user wants a reproducible MCP smoke test without installing a real server. Save as an actual absolute echo.mjs path. It exposes echo_text over newline-delimited JSON-RPC:

js
import { createInterface } from "node:readline";
const lines = createInterface({ input: process.stdin });
for await (const line of lines) {
  let request;
  try { request = JSON.parse(line); } catch { continue; }
  if (request.id === undefined) continue;
  let result;
  if (request.method === "initialize") result = { protocolVersion: request.params?.protocolVersion ?? "2025-11-25", capabilities: { tools: {} }, serverInfo: { name: "raw-echo", version: "1.0.0" } };
  else if (request.method === "tools/list") result = { tools: [{ name: "echo_text", description: "Echo text for connection testing", inputSchema: { type: "object", properties: { text: { type: "string" } }, required: ["text"], additionalProperties: false } }] };
  else if (request.method === "tools/call" && request.params?.name === "echo_text") result = { content: [{ type: "text", text: String(request.params.arguments?.text ?? "") }] };
  else if (request.method === "ping") result = {};
  else { process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id: request.id, error: { code: -32601, message: "Method not found" } }) + "\n"); continue; }
  process.stdout.write(JSON.stringify({ jsonrpc: "2.0", id: request.id, result }) + "\n");
}

Complete config for that fixture; replace both the model ID and script path. Its MCP server needs no credentials:

json
{
  "default_agent": "research",
  "models": { "local": { "provider": "ollama", "method": "openai-chat-completions", "model_id": "YOUR_INSTALLED_MODEL", "base_url": "http://127.0.0.1:11434/v1" } },
  "mcp": { "servers": { "echo": { "transport": "stdio", "command": "node", "args": ["/absolute/path/echo.mjs"] } } },
  "agents": { "research": { "model": "local", "tools": { "use": ["builtin/read_file", "mcp/echo/echo_text"] } } }
}

With this fixture, verify a real echo_text call with {"text":"hello"} returns hello. With a different requested server, use its real tool/schema instead.

Diagnose and report

  • Spawn/handshake failure: check command/PATH, cwd, script arguments, stdout protocol and timeout_ms.
  • Unknown tool/server: check server key and actual original names, including paginated tools/list; do not guess from an alias. Raw skips an unavailable selected server or tool with a stderr warning (unknown MCP tool NAME selected from SERVER; skipped) and still starts; a server upgrade can rename or drop tools, so replace stale IDs with current names.
  • Unsupported selected schema: identify the actual schema error; an unselected unsupported tool is inert.
  • Authentication failure: check the server's real credential mechanism and literal headers/environment, not model-provider credentials.
  • Image content failure: native images need a capable model/adapter; text-only agents can use OCR tools returning text.

Raw validates selected schemas/arguments and closes connections. Selected changes may rotate the generated key once; unselected edits stay inert. Valid changes resume on the same ID. Missing historical aliases leave saved ACP views, while unavailable current selections are skipped with a warning. Report checks and prerequisites.

Raw vars do not interpolate MCP env/headers or tool arguments. Use a server's inherited environment/auth mechanism, or a local tool consuming context.vars. Executable var_providers use a separate one-request JSON protocol, not MCP.

附带文件

技能加载后,模型会按需读取这些文件。它们仅作为可读文件提供,绝不会被执行。

常见问题

Add Mcp AI 技能有什么作用?

Use when connecting an MCP server for Raw, explaining its binding, or diagnosing tools, including dashboard discovery. Select exact original names and verify live calls. Use create-package to share definitions.

为什么在 TypingMind 中使用 Add Mcp?

因为您只需安装一次,就能搭配任何模型使用。Add Mcp 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Add Mcp?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/lploc94/raw-cli/tree/main/examples/skills/add_mcp。TypingMind 会读取其中的 SKILL.md,打包相关文件,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Add Mcp?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Add Mcp 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Add Mcp 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Add Mcp AI 技能免费吗?

是的。lploc94 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇