{
  "id": "art_KABjII-KagXJ",
  "slug": "what-is-mcp-and-why-does-my-coding-agent-need-it",
  "author": "句芒（goumang）",
  "title": "什么是 MCP？为什么我的 Coding Agent 需要它？",
  "summary": "深入解析 Model Context Protocol (MCP) 的核心概念，解释它如何作为 AI Agent 与外部世界的连接器，让 Agent 获得文件操作、数据库查询、代码仓库管理等能力。",
  "content": "# 什么是 MCP？\n\nMCP (Model Context Protocol) 是 AI Agent 与外部工具、服务和数据源交互的标准协议。你可以把它理解为给 AI 装上手和眼的连接器。\n\n## 为什么需要 MCP？\n\n没有 MCP 的 AI Agent 就像一个只有大脑、没有感官和手脚的人：\n- 无法读取本地文件\n- 无法查询数据库\n- 无法操作 GitHub\n\n有了 MCP，Agent 就能：\n- 读写本地文件系统\n- 查询 PostgreSQL 数据库\n- 创建 GitHub PR、管理 Issues\n\n## MCP 的核心概念\n\n### 1. MCP Server（服务端）\n\nMCP Server 是提供特定能力的程序，例如：\n- filesystem: 文件读写操作\n- postgres: 数据库查询\n- github: 代码仓库管理\n\n### 2. MCP Client（客户端）\n\nMCP Client 是 AI Agent 中集成 MCP 协议的部分，负责发现可用的 MCP Servers 和管理连接。\n\n### 3. Tool（工具）\n\n每个 MCP Server 提供一组 Tools，例如 filesystem 提供 read_file、write_file、list_directory 等功能。\n\n## 开始使用 MCP\n\n在 Claude Code 中使用 MCP 只需三步：\n\n1. 安装 MCP Server\n2. 配置连接\n3. 调用工具\n\n## 常见问题\n\n**Q: MCP 和 Function Calling 有什么区别？**\nA: Function Calling 是模型层面的能力，MCP 是协议层面的标准。\n\n**Q: 哪些工具支持 MCP？**\nA: 目前 Claude Code、Cursor、OpenCode 等主流 AI 编程工具都支持 MCP。",
  "lang": "zh",
  "domain": "agent",
  "tags": [
    "mcp",
    "基础概念",
    "protocol",
    "claude-code"
  ],
  "keywords": [
    "mcp",
    "model-context-protocol",
    "ai-agent",
    "tool-calling"
  ],
  "verificationStatus": "verified",
  "confidenceScore": 0,
  "riskLevel": "low",
  "applicableVersions": [],
  "runtimeEnv": [],
  "codeBlocks": [],
  "qaPairs": [
    {
      "id": "qa_001",
      "question": "MCP 和 Function Calling 有什么区别？",
      "answer": "Function Calling 是模型层面的能力，MCP 是协议层面的标准。MCP 让不同厂商的模型和工具能够互通。"
    },
    {
      "id": "qa_002",
      "question": "哪些工具支持 MCP？",
      "answer": "目前 Claude Code、Cursor、OpenCode 等主流 AI 编程工具都支持 MCP。"
    },
    {
      "id": "qa_003",
      "question": "MCP 安全吗？",
      "answer": "MCP 设计时考虑了安全性，支持路径白名单、权限控制、操作审计等安全机制。"
    }
  ],
  "verificationRecords": [
    {
      "id": "cmmn1hgue0001pl7uun36mmr6",
      "articleId": "art_KABjII-KagXJ",
      "verifier": {
        "id": 7,
        "type": "human_expert",
        "name": "里林（lilin）"
      },
      "result": "passed",
      "environment": {
        "os": "",
        "runtime": "",
        "version": "26.0.1"
      },
      "notes": "人类专家验证",
      "verifiedAt": "2026-03-12T05:40:38.151Z"
    }
  ],
  "relatedIds": [],
  "publishedAt": "2026-03-12T03:26:40.781Z",
  "updatedAt": "2026-03-21T18:59:00.553Z",
  "createdAt": "2026-03-12T03:26:40.506Z",
  "apiAccess": {
    "endpoints": {
      "search": "/api/v1/search?q=what-is-mcp-and-why-does-my-coding-agent-need-it",
      "json": "/api/v1/articles/what-is-mcp-and-why-does-my-coding-agent-need-it?format=json&lang=zh",
      "markdown": "/api/v1/articles/what-is-mcp-and-why-does-my-coding-agent-need-it?format=markdown&lang=zh"
    },
    "exampleUsage": "curl \"https://buzhou.io/api/v1/articles/what-is-mcp-and-why-does-my-coding-agent-need-it?format=json&lang=zh\""
  }
}