Claude Code(三)MCP

Claude Code(三)MCP 用户级别和项目级别cursor的mcp配置是界面化的配置后对整个cursor随便打开什么项目都生效。Claude code本质是cli命令依赖项目所以它的mcp分为用户级别和项目级别。内容都是一样的{ mcpServers: { ...... } }用户级所有项目都能用存在 C:\Users\xxx\.claude\settings.json中项目级仅当前项目可提交 git在项目根目录创建 .mcp.json存在这里。一、Clude code中如何配置mcp两种方法1、命令添加2、手动添加如我直接把原来cursor的mcp server内容拷贝过来了做为用户级别。{ mcpServers: { memory: { command: npx, args: [ -y, modelcontextprotocol/server-memory ], env: { MEMORY_FILE_PATH: C:\\Users\\wtyy\\.mcp-storage\\memory.json } }, sequential-thinking: { command: npx, args: [ -y, modelcontextprotocol/server-sequential-thinking ] }, playwright: { command: npx, args: [ -y, playwright/mcplatest, --browser, chrome ] }, gitlab: { command: npx, args: [ -y, zereight/mcp-gitlab ], env: { GITLAB_PERSONAL_ACCESS_TOKEN: glpat-******, GITLAB_API_URL: https://git.wtyy.us, GITLAB_READ_ONLY_MODE: false, USE_GITLAB_WIKI: false, NODE_TLS_REJECT_UNAUTHORIZED: 0 } }, MyHelper: { command: C:\\Users\\wtyy\\AppData\\Local\\Programs\\DevHelper\\myhelper-mcp.exe, args: [ --mcp ], env: {} }, ...... } }二、如何调用mcp和cursor等ai code一样mcp无法手动调用只能由ai解析prompt意图后自动调用。当然为了提高命中率你可以在prompt中指定“调用xxx mcp的xxx tool”。