npx skills add https://github.com/vudovn/antigravity-kit --skill mcp-builder构建 MCP 服务器的原则。
模型上下文协议 - 用于连接 AI 系统与外部工具和数据源的标准。
| 概念 | 用途 |
|---|---|
| 工具 | AI 可以调用的函数 |
| 资源 | AI 可以读取的数据 |
| 提示 | 预定义的提示模板 |
my-mcp-server/
├── src/
│ └── index.ts # 主入口
├── package.json
└── tsconfig.json
| 类型 | 用途 |
|---|---|
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
| Stdio |
| 本地,基于 CLI |
| SSE | 基于 Web,流式传输 |
| WebSocket | 实时,双向 |
| 原则 | 描述 |
|---|---|
| 名称清晰 | 面向操作(get_weather, create_user) |
| 目的单一 | 做好一件事 |
| 输入验证 | 包含类型和描述的架构 |
| 结构化输出 | 可预测的响应格式 |
| 字段 | 是否必需? |
|---|---|
| 类型 | 是 - 对象 |
| 属性 | 定义每个参数 |
| 必需项 | 列出必填参数 |
| 描述 | 人类可读 |
| 类型 | 用途 |
|---|---|
| 静态 | 固定数据(配置、文档) |
| 动态 | 按请求生成 |
| 模板 | 带参数的 URI |
| 模式 | 示例 |
|---|---|
| 固定 | docs://readme |
| 参数化 | users://{userId} |
| 集合 | files://project/* |
| 情况 | 响应 |
|---|---|
| 参数无效 | 验证错误信息 |
| 未找到 | 清晰的“未找到”信息 |
| 服务器错误 | 通用错误,记录详细信息 |
| 类型 | 编码 |
|---|---|
| 文本 | 纯文本 |
| 图像 | Base64 + MIME 类型 |
| 文件 | Base64 + MIME 类型 |
| 字段 | 用途 |
|---|---|
| 命令 | 要运行的可执行文件 |
| 参数 | 命令参数 |
| 环境变量 | 环境变量 |
| 类型 | 重点 |
|---|---|
| 单元测试 | 工具逻辑 |
| 集成测试 | 完整服务器 |
| 契约测试 | 架构验证 |
请记住: MCP 工具应该简单、专注且文档齐全。AI 依赖描述来正确使用它们。
每周安装量
93
代码仓库
GitHub 星标数
6.7K
首次出现
2026年1月21日
安全审计
安装于
gemini-cli81
codex78
opencode75
cursor71
github-copilot69
antigravity65
Principles for building MCP servers.
Model Context Protocol - standard for connecting AI systems with external tools and data sources.
| Concept | Purpose |
|---|---|
| Tools | Functions AI can call |
| Resources | Data AI can read |
| Prompts | Pre-defined prompt templates |
my-mcp-server/
├── src/
│ └── index.ts # Main entry
├── package.json
└── tsconfig.json
| Type | Use |
|---|---|
| Stdio | Local, CLI-based |
| SSE | Web-based, streaming |
| WebSocket | Real-time, bidirectional |
| Principle | Description |
|---|---|
| Clear name | Action-oriented (get_weather, create_user) |
| Single purpose | One thing well |
| Validated input | Schema with types and descriptions |
| Structured output | Predictable response format |
| Field | Required? |
|---|---|
| Type | Yes - object |
| Properties | Define each param |
| Required | List mandatory params |
| Description | Human-readable |
| Type | Use |
|---|---|
| Static | Fixed data (config, docs) |
| Dynamic | Generated on request |
| Template | URI with parameters |
| Pattern | Example |
|---|---|
| Fixed | docs://readme |
| Parameterized | users://{userId} |
| Collection | files://project/* |
| Situation | Response |
|---|---|
| Invalid params | Validation error message |
| Not found | Clear "not found" |
| Server error | Generic error, log details |
| Type | Encoding |
|---|---|
| Text | Plain text |
| Images | Base64 + MIME type |
| Files | Base64 + MIME type |
| Field | Purpose |
|---|---|
| command | Executable to run |
| args | Command arguments |
| env | Environment variables |
| Type | Focus |
|---|---|
| Unit | Tool logic |
| Integration | Full server |
| Contract | Schema validation |
Remember: MCP tools should be simple, focused, and well-documented. The AI relies on descriptions to use them correctly.
Weekly Installs
93
Repository
GitHub Stars
6.7K
First Seen
Jan 21, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli81
codex78
opencode75
cursor71
github-copilot69
antigravity65
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
157,400 周安装