mcp
设置指南
在 2 分钟内让 Clarity MCP 在 Claude Desktop、Cursor 或任何兼容 MCP 的客户端中运行。
前提条件
- 拥有至少一个项目的 Clarity 账号
- 一个兼容 MCP 的 AI 客户端(Claude Desktop、Cursor、Windsurf 等)
下方的设置向导将为您的客户端生成即可粘贴的配置代码片段。只需粘贴您的 API 密钥并复制配置即可。
1Get your API key
Generate an API key in your Clarity settings. You'll paste it into the config below.
Create API key in Settings2Configure your client
Config file location:
macOS
~/Library/Application Support/Claude/claude_desktop_config.jsonWin
%APPDATA%\Claude\claude_desktop_config.jsonjson
{
"mcpServers": {
"clarity": {
"command": "npx",
"args": [
"-y",
"clarity-mcp@latest"
],
"env": {
"CLARITY_API_KEY": "<your-api-key>",
"CLARITY_API_URL": "https://www.claritynotes.xyz"
}
}
}
}- 1Open Claude Desktop → Settings → Developer → Edit Config
- 2Paste the config below into
claude_desktop_config.json - 3Replace
<your-api-key>with the key you copied - 4Save the file and restart Claude Desktop
3Verify the connection
Ask your AI assistant:
“List my Clarity projects”
If configured correctly, it will call the list_projects tool and return your workspace.
故障排除
| 问题 | 解决方案 |
|---|---|
| "CLARITY_API_KEY is required" | 确保 env 块中包含您的密钥 |
| "API 401: Invalid API key" | 在设置 → MCP / API 中重新生成密钥 |
| 工具未显示 | 编辑配置后重启您的 AI 客户端 |
您可以通过让 AI 执行以下命令来测试连接:"列出我的 Clarity 项目。" 如果返回了您的工作区,说明一切正常。
这对您有帮助吗?
