# Bay Run for Grok Use Bay Run when Grok needs to choose and run a specialist under explicit quality, latency, privacy, and price constraints. The canonical MCP transport is https://run.huggingbay.xyz/mcp/ ## Grok custom connector 1. Open https://grok.com/connectors and create a Custom MCP connector. 2. Enter `https://run.huggingbay.xyz/mcp/`. 3. Complete OAuth when Grok asks. Do not paste an owner or operator credential. ## Grok Build ```sh grok mcp add --transport http bay-run https://run.huggingbay.xyz/mcp/ grok mcp doctor bay-run --json ``` ## xAI Responses API Mint a resource-bound free bearer: ```sh BAY_RUN_TOKEN=$(curl -sS -X POST 'https://run.huggingbay.xyz/oauth/token' \ -H 'content-type: application/json' \ -d '{"grant_type":"urn:bay-run:grant-type:demo","scope":"mcp:demo","resource":"https://run.huggingbay.xyz/mcp/"}' | jq -r .access_token) ``` Use this focused Remote MCP tool object in the xAI Responses API `tools` array: ```json { "type": "mcp", "server_url": "https://run.huggingbay.xyz/mcp/", "server_label": "bay_run", "server_description": "Find and run a small specialist for a task under explicit quality, latency, data-handling, and price constraints; return a verifiable result.", "allowed_tools": [ "solve_task", "run_bakeoff", "get_task_quote", "run_task", "verify_result" ], "authorization": "$BAY_RUN_TOKEN", "headers": { "X-Bay-Run-Source": "grok", "X-Bay-Run-Harness": "grok", "X-Bay-Run-Client-Class": "agent_harness" } } ``` The `authorization` value is the token itself. Keep `allowed_tools` focused so Grok does not ingest the 32 advanced compatibility schemas unless the task needs one. ## Recovery - `401`: complete OAuth or mint the bearer above, then retry the same POST. - `405`: send MCP JSON-RPC with POST; GET is discovery only. - `422`: refresh `tools/list` and use the selected tool's exact `inputSchema`. - `503`: inspect `https://run.huggingbay.xyz/readyz` and `Retry-After`. Before sending sensitive data, inspect `https://run.huggingbay.xyz/.well-known/data-policy.json` and `https://run.huggingbay.xyz/.well-known/assurance.json`. Full machine-readable setup: `https://run.huggingbay.xyz/.well-known/grok.json`.