跳到正文
Skillpedia
连接器(MCP)8.2k · #12535

mcp-builder

它能做什么

这项技能在你的 AI 构建连接时提供指导,让 AI 助手通过 Model Context Protocol 使用外部工具和数据。适合自己开发 MCP 服务器或客户端的开发者。

适用场景

  • ✓当你想构建一个 MCP 服务器,让 AI 访问公司的工具或数据的时候。
  • ✓当你需要检查 MCP 客户端和服务器能否正确协同工作的时候。
  • ✓当你要把旧的 MCP 实现升级到当前规范的时候。

技能链接

https://github.com/vudovn/ag-kit/blob/main/.agents/skills/mcp-builder/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/vudovn/ag-kit/blob/main/.agents/skills/mcp-builder/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我构建一个 MCP 服务器,让我的 AI 能读取内部数据库中的记录。”

每周 5 个新技能,1 分钟读完。

工作原理

技能讲解协议规则,例如双方如何商定版本和可选功能。AI 在编写代码时遵循这些规则。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

MCP Builder

Build interoperable MCP implementations against the stable 2026-07-28 specification. Treat extensions as negotiated, opt-in capabilities rather than core protocol guarantees.


1. Stable baseline and compatibility

  • The authoritative stable baseline is MCP 2026-07-28.
  • Core requests are stateless and self-contained. Do not infer protocol version, client capabilities, identity, conversation, or task state from a transport connection or process lifetime.
  • Put cross-request state behind explicit identifiers supplied on every relevant request.
  • Negotiate the protocol version and capabilities; do not assume that a client or server implements every optional feature.
  • Preserve compatibility with earlier peers where the specification requires it, including accepting legacy resource-not-found error code -32002 while emitting -32602 for invalid parameters in the current protocol.

Core versus extensions

Layer Status Engineering rule
Base protocol, versioning, message patterns Stable core Required for every implementation
Resources, prompts, tools, elicitation Optional core features Advertise and check capabilities before use
Tasks, Skills over MCP, MCP Apps Extensions Opt-in; require explicit support from both peers
Draft or vendor extensions Experimental/vendor-specific Isolate behind adapters and feature flags

Never label an extension as stable merely because one SDK or host supports it. Check the extension's own official status and version.


2. Architecture

MCP uses JSON-RPC 2.0 between hosts, clients, and servers.

host application
  └─ MCP client / runtime adapter
       ├─ stdio transport
       └─ Streamable HTTP transport
            └─ MCP server
                 ├─ resources
                 ├─ prompts
                 └─ tools

Stateless request model

Every request must carry the protocol metadata required by the negotiated version. For 2026-07-28 this includes per-request protocol version and client capability metadata under reserved _meta keys.

Servers must implement server/discover for protocol-version and capability discovery. Clients may call it before normal requests or use it as a backward-compatibility probe for stdio peers.

Do not:

  • use a stdio process as a conversation or session boundary;
  • depend on request ordering to establish capabilities or identity;
  • keep hidden mutable state without an explicit handle;
  • use self-reported client/server information for authorization decisions.

Do:

  • make task, thread, workspace, or subscription handles explicit;
  • validate every request independently;
  • tolerate interleaved requests from unrelated tasks;
  • document lifecycle, expiry, and cleanup for durable handles.

3. Transports and authentication

Transport Typical use Security baseline
stdio Local process integration Read credentials from the environment; constrain process and filesystem access
Streamable HTTP Remote or shared service Use the MCP HTTP authorization framework, validate origins where applicable, and enforce network boundaries

WebSocket is not a standard MCP transport unless defined by a separately negotiated extension or vendor adapter.

Transport concerns must not leak into protocol semantics. Reconnection or process replacement must not destroy logical state that is represented by an explicit durable handle.


4. Schema design and validation

MCP defaults to JSON Schema 2020-12 when $schema is absent. Implementations must support that dialect and should document any additional dialects.

Tool input schemas

  • Use an object root for tool arguments.
  • Give every property a clear, action-oriented description.
  • Declare required fields explicitly.
  • Prefer narrow enums, bounds, formats, and additionalProperties: false where forward compatibility does not require open objects.
  • Validate both the schema and each invocation payload.

Tool output schemas

Use structured content and outputSchema when consumers need typed, predictable results. Keep human-readable text concise and ensure structured output remains the source of truth for automation.

$ref and validator safety

  • Never dereference network $ref values automatically.
  • If remote dereferencing is explicitly enabled, use a host allowlist; reject loopback, link-local, and private addresses; apply timeouts and response
常见问题

它针对哪个协议版本?

它针对稳定的 2026-07-28 MCP 规范,并说明与旧版对端的兼容性。

必须使用扩展吗?

不必须。扩展是可选的,使用前须由双方同意。

它涵盖安全吗?

涵盖。技能包含 MCP 实现的安全指南。

详情

作者的原始描述

MCP (Model Context Protocol) server and client engineering. Protocol design, schemas, transports, extensions, security, and migration.

repo: vudovn/ag-kit

热度

GitHub 星标
8.2k
排名
#12535
许可证
MIT
更新时间
2026/10/18

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能