Skip to content

fix(github): send User-Agent on all GitHub API calls#400

Merged
viktormarinho merged 1 commit intomainfrom
viktormarinho/github-mcp-user-agent
Apr 23, 2026
Merged

fix(github): send User-Agent on all GitHub API calls#400
viktormarinho merged 1 commit intomainfrom
viktormarinho/github-mcp-user-agent

Conversation

@viktormarinho
Copy link
Copy Markdown
Contributor

@viktormarinho viktormarinho commented Apr 23, 2026

Summary

Post-deploy of #396, the worker crashed with CF error 1101 on the first /mcp request. Wrangler tail showed a 403 from GitHub:

Request forbidden by administrative rules. Please make sure your request has a User-Agent header

Cloudflare Workers' fetch doesn't set a default `User-Agent`; Node/k8s did, which hid the issue until the cutover. Added `User-Agent: deco-cms-github-mcp` to every outbound GitHub API call: JWT-authed installations list, user installations list, OAuth token exchange/refresh, and the MCP proxy transport.

Test plan

  • After merge + Deploy GitHub MCP workflow: `curl -X POST https://github-mcp.decocms.com/mcp -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'` returns a tool list rather than CF 1101.

🤖 Generated with Claude Code


Summary by cubic

Add a User-Agent: deco-cms-github-mcp header to all GitHub API requests to stop 403s in Cloudflare Workers and fix the CF 1101 crash on the first /mcp request.

  • Bug Fixes
    • App installation token requests (github-app-auth.ts)
    • Installation mapping fetches (installation-map.ts)
    • OAuth token exchange/refresh (github-client.ts)
    • MCP proxy upstream calls (mcp-proxy.ts)

Written for commit a2bc3cd. Summary will update on new commits.

Cloudflare Workers' fetch doesn't set a default User-Agent, and
GitHub's API rejects UA-less requests with 403 "Request forbidden
by administrative rules" — the worker was crashing at upstream tool
discovery (getAppInstallationToken) on the very first request.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@viktormarinho viktormarinho merged commit 7a4755c into main Apr 23, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant