管理 MCP 服务器连接,扩展 Claude 的工具能力——数据库、API、浏览器,无限可能
/mcp 不接受任何参数,直接打开 MCP 服务器管理界面,查看、添加、删除服务器连接
| 特性 | 值 | 说明 |
|---|---|---|
参数 | 无 | 直接运行即可打开 MCP 服务器管理界面 |
协议 | MCP | Model Context Protocol,Claude 的标准扩展协议 |
配置文件 | settings.json | MCP 服务器配置存储在 settings.json 的 mcpServers 字段 |
通过 MCP 服务器让 Claude 连接外部工具和数据源
连接 MCP 数据库服务器,让 Claude 能直接查询数据库、分析表结构、生成报表
通过 MCP 服务器连接第三方服务——GitHub、Slack、Jira 等,让 Claude 直接与它们交互
创建专用 MCP 服务器,提供项目特定的工具——部署脚本、内部 API、自定义验证
观看如何添加 MCP 服务器并使用它提供的工具
MCP 服务器通过 settings.json 中的 mcpServers 字段进行配置
// ~/.claude/settings.json 或 .claude/settings.json { "mcpServers": { "filesystem": { "command": "npx", "args": [ "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir" ] }, "github": { "command": "npx", "args": ["@modelcontextprotocol/server-github"], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxx" } }, "postgres": { "command": "npx", "args": [ "@modelcontextprotocol/server-postgres", "postgresql://user:pass@localhost/db" ] } } }
社区提供了大量现成的 MCP 服务器,开箱即用
| 服务器 | 功能 | 包名 |
|---|---|---|
| Filesystem | 安全的文件系统访问,可限定允许访问的目录 | @modelcontextprotocol/server-filesystem |
| GitHub | 操作 GitHub 仓库、Issue、PR、搜索代码 | @modelcontextprotocol/server-github |
| PostgreSQL | 查询 PostgreSQL 数据库,分析表结构 | @modelcontextprotocol/server-postgres |
| SQLite | 操作 SQLite 数据库文件 | @modelcontextprotocol/server-sqlite |
| Puppeteer | 浏览器自动化,截图、爬取网页内容 | @modelcontextprotocol/server-puppeteer |
| Brave Search | 网络搜索能力 | @modelcontextprotocol/server-brave-search |
@modelcontextprotocol/server-*