-
Notifications
You must be signed in to change notification settings - Fork 2
Add Claude Code CLI setup to MCP docs #432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
❌ Deploy Preview for flanksource-docs failed. Why did it fail? →
|
✅ Deploy Preview for canarychecker canceled.
|
|
@copilot fix the build errors |
ffb893e to
29cc673
Compare
WalkthroughUpdated Claude Code MCP setup documentation to use project-level Changes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
29cc673 to
c61622c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
mission-control/docs/guide/mcp/client-setup.mdx (1)
352-387: Remove duplicate Troubleshooting and Next Steps sections.Lines 352-387 are exact duplicates of lines 315-351. This appears to be a copy-paste error and should be removed.
Suggested fix - remove lines 352-387
- [Catalog Tools](./tools/catalog_tools.mdx) - Query and manage configuration items - [Connection Tools](./tools/connection_tools.mdx) - Manage connections and integrations - [Playbook Tools](./tools/playbook_tools.mdx) - Execute and manage playbooks - -## Troubleshooting - -### Common Issues - -1. **Connection Refused** - - Verify the server URL is correct - - Check if you're behind a firewall or proxy - - Ensure the token has proper permissions - -2. **Authentication Failed** - - Verify token is valid and not expired - - Ensure token has `mcp.*` permissions - - Check if Basic prefix is included - -3. **Tools Not Appearing** - - Restart the client application - - Check client logs for errors - - Verify MCP server is properly configured - -### Testing Connection - -You can test your MCP connection using the MCP CLI: - -```bash -npx `@modelcontextprotocol/cli` connect \ - --transport http \ - --url https://mc.<org-id>.workload-prod-eu-02.flanksource.com/mcp \ - --header "Authorization: Basic YOUR_TOKEN_HERE" -``` - -## Next Steps - -Once connected, explore the available tools: -- [Catalog Tools](./tools/catalog_tools.mdx) - Query and manage configuration items -- [Connection Tools](./tools/connection_tools.mdx) - Manage connections and integrations -- [Playbook Tools](./tools/playbook_tools.mdx) - Execute and manage playbooks
🤖 Fix all issues with AI agents
In `@mission-control/docs/guide/mcp/client-setup.mdx`:
- Around line 102-104: Update the Claude Code example's Authorization header to
use Basic auth instead of Bearer: change the "Authorization" header value in the
Claude Code section from "Bearer YOUR_TOKEN_HERE" to "Basic YOUR_TOKEN_HERE" so
it matches the Prerequisites' generated base64 token and the other client
examples; ensure the example uses the same token format described earlier.
📜 Review details
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
mission-control/docs/guide/mcp/client-setup.mdx
🔇 Additional comments (1)
mission-control/docs/guide/mcp/client-setup.mdx (1)
89-110: No issues found. The Claude Code CLI MCP configuration format in lines 89-110 is correct. The"name"field and"type": "http"are both appropriate for Claude Code CLI's configuration format and serve distinct purposes (display name and connection type respectively).
✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.
| "headers": { | ||
| "Authorization": "Bearer YOUR_TOKEN_HERE" | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
# First, let's check if the file exists and read the relevant sections
find . -name "client-setup.mdx" -type fRepository: flanksource/docs
Length of output: 109
🌐 Web query:
Claude Code MCP configuration .mcp.json authorization Bearer Basic auth requirements
💡 Result:
Short answer — .mcp.json supports setting HTTP/SSE auth via headers (you supply an Authorization header). You can use Bearer tokens or Basic auth as normal HTTP headers.
Examples from Anthropic docs:
- .mcp.json headers accept arbitrary headers, e.g. "Authorization": "Bearer ${API_KEY}". Use environment expansion for secrets. [1]
- MCP HTTP/SSE servers are configured with a "type":"sse" or "url" and a "headers" object where you place Authorization. Basic auth would be supplied as "Authorization": "Basic <base64(user:pass)>". [2]
Minimal example (.mcp.json):
{
"mcpServers": {
"api-server": {
"type": "sse",
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer ${API_KEY}"
}
}
}
}
Notes:
- Prefer injecting secrets via environment variables (variable expansion supported). [1]
- If you need interactive OAuth flows, use the /mcp CLI auth helpers described in the docs. [1]
Sources:
[1] Anthropic — Connect Claude Code to tools via MCP (docs).
[2] Anthropic — MCP in the SDK (docs).
🌐 Web query:
Claude Code .mcp.json server configuration authentication header format
💡 Result:
Claude Code accepts authentication headers in .mcp.json either as a headers object (map) or as an array of header strings. Example formats:
-
Object form:
{
"mcpServers": {
"api-server": {
"type": "http",
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer ${API_KEY}"
}
}
}
}
[1] -
Array-of-strings form:
{
"mcpServers": {
"netdata": {
"type": "http",
"url": "http://host:19999/mcp",
"headers": [
"Authorization: Bearer ${NETDATA_API_KEY}"
]
}
}
}
[2]
Note: there is an open issue reporting that Claude Code may ignore headers in some releases (causing OAuth discovery to be attempted instead), so if headers don't take effect check your Claude Code version and related GitHub issue threads. [3]
Sources: [1] Claude Code docs; [2] Netdata/guide showing array format; [3] GitHub issue reporting headers ignored.
🏁 Script executed:
# Read the file to see the actual content and context around lines 102-104
cat -n ./mission-control/docs/guide/mcp/client-setup.mdx | sed -n '90,110p'Repository: flanksource/docs
Length of output: 781
🏁 Script executed:
# Also check the Prerequisites section mentioned (lines 29-33)
cat -n ./mission-control/docs/guide/mcp/client-setup.mdx | sed -n '25,40p'Repository: flanksource/docs
Length of output: 776
🏁 Script executed:
# Check other client tabs for comparison
cat -n ./mission-control/docs/guide/mcp/client-setup.mdx | sed -n '70,80p'
cat -n ./mission-control/docs/guide/mcp/client-setup.mdx | sed -n '135,145p'Repository: flanksource/docs
Length of output: 679
🏁 Script executed:
# Check if there are more sections discussing other clients to see auth patterns
cat -n ./mission-control/docs/guide/mcp/client-setup.mdx | grep -A 10 "Authorization"Repository: flanksource/docs
Length of output: 2927
🏁 Script executed:
# Check the full file length and structure
wc -l ./mission-control/docs/guide/mcp/client-setup.mdxRepository: flanksource/docs
Length of output: 113
Fix authentication type mismatch in Claude Code section: Bearer should be Basic.
The Claude Code section (line 103) uses Bearer authentication, but the Prerequisites (lines 29-33) explicitly define the generated token as a Basic token that requires base64 encoding. All other client examples also use Basic auth. This inconsistency will cause authentication failures for users following the documented setup flow.
Change line 103 from:
"Authorization": "Bearer YOUR_TOKEN_HERE"to:
"Authorization": "Basic YOUR_TOKEN_HERE"🤖 Prompt for AI Agents
In `@mission-control/docs/guide/mcp/client-setup.mdx` around lines 102 - 104,
Update the Claude Code example's Authorization header to use Basic auth instead
of Bearer: change the "Authorization" header value in the Claude Code section
from "Bearer YOUR_TOKEN_HERE" to "Basic YOUR_TOKEN_HERE" so it matches the
Prerequisites' generated base64 token and the other client examples; ensure the
example uses the same token format described earlier.
resolves: #429
Summary by CodeRabbit
.mcp.jsonfile instead of browser-based settings✏️ Tip: You can customize this high-level summary in your review settings.