mcp-python-sdk

MCP Python SDK:Anthropic 主导的 Model Context Protocol 参考实现。2 server 层 + 3 transport + 3 原语 + 4 协议版本 + 50 条约束。 MCP Python SDK: reference Python implementation of the Model Context Protocol (Anthropic-led). Two server surfaces (low-level Server / high-level MCPServer, formerly FastMCP), three transports (stdio / SSE / streamable-http), and three primitives (Tools / Resources / Prompts).

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "mcp-python-sdk" with this command: npx skills add tangweigang-jpg/mcp-python-sdk

这个 skill 适合什么用户?能做哪些任务?

概览

MCP Python SDK 是 Model Context Protocol 的参考实现(github.com/modelcontextprotocol/python-sdk)—— Anthropic 主导的开放标准,让 AI host(Claude / Cursor 等)通过 JSON-RPC 2.0 跟工具服务端对话。

两个 server 接口:低层 Server(构造器注入 handler)和高层 MCPServer(装饰器 API,原名 FastMCP)。三个传输共享结构化 (read_stream, write_stream) AnyIO 契约:stdio(行分隔 JSON)、传...

Doramagic 晶体页: https://doramagic.ai/zh/crystal/mcp-python-sdk

知识规模

  • 50 条约束 (1 fatal + 49 non-fatal)
  • 上游源码: modelcontextprotocol/python-sdk @ commit 3d7b311d
  • 蓝图 ID: finance-bp-140

用法

Host AI(Claude Code / Cursor / OpenClaw)读 references/seed.yaml,按其中的:

  • intent_router 匹配用户意图
  • architecture 理解项目架构
  • constraints 应用 anti-pattern 约束
  • business_decisions 参考核心设计决策

FAQ 摘要

这个 skill 适合什么用户?能做哪些任务?

适合需要给 Claude / Cursor 等 AI host 提供工具服务的工程师:发布公司内部 API 给 AI 调用、暴露文件 / 数据库为 Resources、提供 prompt 模板等。本 skill 覆盖 stdio(本地)/ SSE(旧)/ streamable-http(推荐)三种 server 形态。访问 doramagic.ai/r/mcp-python-sdk 查看完整说明。

需要准备什么环境?依赖什么?

Python 3.10+,AnyIO(asyncio 或 trio 后端),Pydantic v2(type schema 生成),Starlette(HTTP/SSE/streamable-http 托管),OpenTelemetry(可选,分布式追踪)。Windows 客户端 stdio 需 pywin32 用于 Job Object 进程树终止;POSIX 用 os.killpg。

会踩哪些坑?这个 skill 怎么防护?

本 skill 内置 50 条约束(1 条 fatal)。典型踩坑:(1) commit 3d7b311 的 README 仍 import 改名前的 FastMCP(26 处 import 行 + 10 处文件路径失效),照抄 quickstart 必失败;


完整文档: 见 references/seed.yaml (v6.1 schema). 浏览页: https://doramagic.ai/zh/crystal/mcp-python-sdk

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

Instructor Structured Output

Instructor:声明 Pydantic BaseModel 即可从 20 个 LLM provider 拿到类型化实例。核心是 monkey-patch(instructor.patch / from_*)拦截 create(),注入 schema-aware kwargs,tenacity 重试 + In...

Registry SourceRecently Updated
530Profile unavailable
Automation

Crewai Multi Agent

CrewAI 多智能体框架:role-goal-backstory 声明智能体,sequential / hierarchical 双流程,ReAct 与 OpenAI native function-calling 双 tool 循环,统一 Memory + 5 个原生 LLM provider + Lit C...

Registry SourceRecently Updated
630Profile unavailable
Automation

Autogen Multi Agent

AutoGen v0.4:asyncio actor-runtime 多智能体框架(autogen-core / autogen-agentchat / autogen-ext 三包)。 AutoGen v0.4: asyncio actor-runtime multi-agent framework (auto...

Registry SourceRecently Updated
580Profile unavailable
Coding

Browser Use Agent

Browser-Use:把 LLM 变成网页操作员的异步 Python 库(Python 3.11+)。Agent 步循环采集 DOM + 截图 → LLM 一次调用产出 thinking / evaluation / next_goal / action[] → 经 CDP 执行。 Browser-Use: a...

Registry SourceRecently Updated
550Profile unavailable