Skip to content

Conversation

@zerx-lab
Copy link

The MCP server was unconditionally requiring BigBrain (Convex Cloud) authentication for all tool calls, which caused local, anonymous, and self-hosted deployments to fail with "Not Authorized" error.

Changes:

  • Add requiresBigBrainAuth() method to RequestContext that checks deployment type before requiring cloud authentication
  • Add requiresBigBrainAuthForDeployment() helper function
  • Modify MCP tool handler to use smart auth checking
  • Add clear usage documentation in --help for different deployment types

Deployment types that NO LONGER require cloud login:

  • Self-hosted (CONVEX_SELF_HOSTED_URL + CONVEX_SELF_HOSTED_ADMIN_KEY)
  • CLI direct (--url + --admin-key)
  • Anonymous local development (CONVEX_AGENT_MODE=anonymous)

Deployment types that STILL require cloud login:

  • Cloud-hosted projects (CONVEX_DEPLOYMENT)
  • Deploy key based (CONVEX_DEPLOY_KEY)
  • Preview deployments

Fixes: #78
Related: PR #92


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The MCP server was unconditionally requiring BigBrain (Convex Cloud)
authentication for all tool calls, which caused local, anonymous,
and self-hosted deployments to fail with "Not Authorized" error.

Changes:
- Add requiresBigBrainAuth() method to RequestContext that checks
  deployment type before requiring cloud authentication
- Add requiresBigBrainAuthForDeployment() helper function
- Modify MCP tool handler to use smart auth checking
- Add clear usage documentation in --help for different deployment types

Deployment types that NO LONGER require cloud login:
- Self-hosted (CONVEX_SELF_HOSTED_URL + CONVEX_SELF_HOSTED_ADMIN_KEY)
- CLI direct (--url + --admin-key)
- Anonymous local development (CONVEX_AGENT_MODE=anonymous)

Deployment types that STILL require cloud login:
- Cloud-hosted projects (CONVEX_DEPLOYMENT)
- Deploy key based (CONVEX_DEPLOY_KEY)
- Preview deployments

Fixes: get-convex#78
Related: PR get-convex#92
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.

Convex MCP errors for local projects

2 participants