Claude Code 与 Cursor
Claude Code(终端 CLI 工具)与 Cursor(编辑器)—— AI 编程工具对比。多 Agent、Plan Mode、Composer、IDE 集成与生产环境开发者工作流。
在需要时才加载的指令、上下文与脚本包
把智能体连接到实时外部系统的开放协议
两者不是竞争关系,而是分层关系:skill 解决“怎么做”,MCP 解决“能访问什么”。如果你想教会智能体一个重复性流程或组织专属的领域知识,就写 skill——低摩擦、低上下文成本。如果你需要实时数据,或需要在外部系统中执行操作,就搭建 MCP 服务器;静态文件永远无法提供实时数据。今天的选择取决于“哪个工具解决哪个问题”;两者并不互斥:skill 可以描述调用 MCP 工具的那一步。
| 分类 | Agent Skills | MCP (Model Context Protocol) |
|---|---|---|
| 性能 | 8/10 | 6/10 |
| 学习难易度 | 8/10 | 6/10 |
| 生态系统 | 5/10 | 9/10 |
| 社区 | 5/10 | 9/10 |
| 就业市场 | 4/10 | 7/10 |
| 面向未来 | 7/10 | 9/10 |
# Agent Skill 目录结构与 SKILL.md 示例
# 来源:anthropics/skills 仓库中的 skill 格式(SKILL.md + frontmatter)
pr-checklist/
├── SKILL.md
├── reference.md
└── scripts/
└── validate.py
---
# SKILL.md 内容
---
name: pr-checklist
description: Use when opening a pull request in this repo, to apply the team's commit format, required checklist items, and reviewer assignment rules.
---
# Pull Request Checklist
When opening a PR:
1. Commit messages follow Conventional Commits (`feat:`, `fix:`, `refactor:`).
2. Run `scripts/validate.py` before pushing to check the checklist file.
3. Assign at least one reviewer from the CODEOWNERS file.
4. Link the related issue in the PR description.
See `reference.md` for the full checklist template and edge cases.
---
# scripts/validate.py —— 仅在需要时运行
import sys
def validate_checklist(pr_body: str) -> list[str]:
required = ["## Summary", "## Test plan"]
missing = [item for item in required if item not in pr_body]
return missing
if __name__ == "__main__":
body = sys.stdin.read()
missing = validate_checklist(body)
if missing:
print(f"Missing sections: {missing}")
sys.exit(1)
print("Checklist OK")// MCP 服务器 —— 使用 TypeScript SDK 实现的一个极简 "get_order_status" 工具
// 来源:modelcontextprotocol/typescript-sdk README(v2 server 包)
import { McpServer } from "@modelcontextprotocol/server";
import { StdioServerTransport } from "@modelcontextprotocol/server/stdio";
import * as z from "zod/v4";
const server = new McpServer({
name: "orders-server",
version: "1.0.0",
});
server.registerTool(
"get_order_status",
{
title: "Get Order Status",
description: "Fetch the current status of a customer order from the live database",
inputSchema: z.object({
orderId: z.string().describe("The order ID to look up"),
}),
},
async ({ orderId }) => {
// db:项目自身的数据库客户端(例如 Prisma client)
const order = await db.orders.findUnique({ where: { id: orderId } });
if (!order) {
return {
content: [{ type: "text", text: `Order ${orderId} not found` }],
isError: true,
};
}
return {
content: [
{
type: "text",
text: `Order ${orderId}: status=${order.status}, updatedAt=${order.updatedAt.toISOString()}`,
},
],
};
}
);
const transport = new StdioServerTransport();
await server.connect(transport);两者不是竞争关系,而是分层关系:skill 解决“怎么做”,MCP 解决“能访问什么”。如果你想教会智能体一个重复性流程或组织专属的领域知识,就写 skill——低摩擦、低上下文成本。如果你需要实时数据,或需要在外部系统中执行操作,就搭建 MCP 服务器;静态文件永远无法提供实时数据。今天的选择取决于“哪个工具解决哪个问题”;两者并不互斥:skill 可以描述调用 MCP 工具的那一步。
获取免费咨询Skill 是智能体在需要时才加载的静态指令/流程包(SKILL.md + 支持文件);MCP 则是将智能体连接到实时外部系统(数据库、API、文件系统)的协议。Skill 解决“怎么做”,MCP 解决“能访问什么”。