Remote MCP with OAuth in Grok Bot: the checklist that made it work for us (+ a template to try)

If your remote MCP server works in the Cursor IDE but the sign-in never starts from Grok Bot or cloud agents, this is what we checked on ours (TraderWAI, a trading MCP) until the Connect card worked:

  1. Public HTTPS, reachable from Cursor’s cloud. No VPN or IP allowlist: Grok Bot and cloud agents connect from Cursor’s servers, not from your machine.
  2. 401 with resource_metadata. An unauthenticated request must return 401 with WWW-Authenticate: Bearer ... resource_metadata="https://your-server/.well-known/oauth-protected-resource".
  3. Both discovery documents public: /.well-known/oauth-protected-resource and /.well-known/oauth-authorization-server, with a registration_endpoint (dynamic client registration), PKCE S256 and token_endpoint_auth_methods_supported including none.
  4. Redirect URI. Grok Bot and cloud agents register https://www.cursor.com/agents/mcp/oauth/callback (the IDE uses a localhost one). If your server restricts redirect URIs, allow that one.
  5. Refresh tokens. Bots run for days; without refresh_token the connection drops when the access token expires.

Then, in the Bot’s chat: Add the remote MCP server https://your-server and press Connect on the card.

If you want to see it working end to end, there’s a public template built on ours: TraderWAI Strategy Lab (TraderWAI Strategy Lab by Leonardo). You describe a trading strategy and it backtests it on 1-minute data and marks the trades on a chart. Free plan works.

Disclosure: I’m the founder of TraderWAI. Happy to answer questions about the OAuth setup.

A second public template is up, built the same way: TraderWAI Trade Checker (TraderWAI Trade Checker by Leonardo). You give it a trade idea (symbol, direction, entry, stop, target) and it checks the chart and market structure, today’s news and a quick backtest of the setup on 1-minute history, then marks the plan on the chart. It only places the order if you confirm, always with a stop loss.

It’s also a decent test of the OAuth flow above: the first time, the Bot adds the MCP server and shows the Connect card.