grokbot-cursor-bridge
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@grokbot-cursor-bridgeask the cursor agent to review the code in my workspace"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
GrokBot ↔ Cursor Agent Bridge
A self-hosted MCP gateway and Agent Plugin template that lets Grok Bot talk to
your local Cursor Agent CLI
(agent / cursor-agent). Grok Bot remains the chat interface; Cursor Agent
runs on your machine and produces the answer.
Pattern and security model inspired by iamsupersocks/grokbot-hermes-bridge: exactly two MCP tools, OAuth + PKCE, localhost bind, fail-closed startup.
The repository is operator-agnostic: it contains no live endpoint, token, hostname, private address, user path, account handle, or conversation.

Quick start
Linux or macOS, in one auditable command:
git clone https://github.com/kdriedger/grokbot-cursor-bridge.git && cd grokbot-cursor-bridge && ./scripts/install.shAlready cloned:
./scripts/install.sh
python3 scripts/doctor.pyThe installer is local and auditable. It does not download a remote shell,
does not use sudo, does not start the gateway, and does not write a real
public hostname unless you pass one. Non-interactive and dry-run modes are
available for review and tests:
./scripts/install.sh --dry-run --non-interactive
./scripts/install.sh --non-interactive --endpoint https://mcp.example.com/mcpThen fill the remaining local paths in .env.local (mode 600, never commit
it). The owner code is generated on disk; do not paste it into chat. See
docs/TUTORIAL.md for the illustrated walkthrough.
Doctor deliberately stays red while the example hostname or agent paths are
still placeholders.
Related MCP server: xAI Grok MCP Bridge
How it works
The gateway runs beside your Cursor Agent CLI and exposes exactly two MCP tools:
cursor_askandcursor_status.An HTTPS reverse proxy or tunnel makes
/mcpreachable from Grok Bot.Grok Bot discovers the gateway's OAuth flow. You approve the connection in a browser with a private owner code stored only in the server environment.
The plugin sends user requests to
agent --printand returns the bounded reply.
There is no SSH endpoint, generic shell tool, environment dump, or committed credential. The owner code is not accepted as an MCP bearer token.
Requirements
Python 3.11+
A working Cursor Agent CLI (
agentorcursor-agent) on the gateway machineA workspace directory the agent is allowed to operate on
A Cursor API key (
CURSOR_API_KEY/CURSOR_BRIDGE_API_KEY) or an existingagent loginsession on that machineA public HTTPS hostname or tunnel that forwards to
127.0.0.1:8099Grok Bot, Codex, Cursor, or another Streamable HTTP MCP client with OAuth
Run the gateway
After the installer (or the equivalent local venv + .env.local setup):
. .venv/bin/activate
set -a
. ./.env.local
set +a
python -m cursor_gateway.mcp --host 127.0.0.1 --port 8099At minimum .env.local must contain:
CURSOR_BRIDGE_SECRET=<64-random-hex-characters>
CURSOR_BRIDGE_PUBLIC_BASE_URL=https://mcp.example.com
CURSOR_BRIDGE_ALLOWED_HOSTS=localhost,127.0.0.1,mcp.example.com
CURSOR_BRIDGE_AGENT_BIN=/absolute/path/to/agent
CURSOR_BRIDGE_WORKSPACE=/absolute/path/to/workspace
CURSOR_BRIDGE_API_KEY=<cursor-api-key>GET /health should return {"status":"ok"}. Put HTTPS in front of the
service; do not expose port 8099 directly. See deploy/ for generic examples.
Configure the plugin
The installer calls scripts/configure_plugin.py for you. To repeat it:
python scripts/configure_plugin.py https://mcp.example.com/mcpThe generated config contains only the URL. Do not add an Authorization
header: Grok Bot uses OAuth discovery and PKCE to obtain its own access token.
Install or package this folder as a plugin, restart Grok Bot, then enable the
connector. The first connection opens the approval page. Enter the same owner
code stored in CURSOR_BRIDGE_SECRET.
Agent CLI flags used by the bridge
Tool | Command shape |
|
|
|
|
Defaults: --force on (full agentic tools). Set CURSOR_BRIDGE_MODE=ask for
read-only Q&A, or plan for plan mode. Set CURSOR_BRIDGE_FORCE=0 to disable
force when running in default agentic mode.
Add Composio beside this bridge
Corey Ganim's Grok Bot tip uses Composio Connect to go beyond a client's native connector catalog. Keep the two connections separate:
Client | This repository | Optional Composio connection |
Grok Bot | Install the Grok plugin and connect | Add Composio Connect as a second MCP connector |
Cursor | Install the Cursor plugin or add this MCP URL | Add Composio Connect as a second MCP server |
Codex | Install the Codex plugin or add this MCP URL | Prefer Composio's native Codex plugin, or choose Connect MCP explicitly |
The .grok-plugin, .cursor-plugin, and .codex-plugin manifests here install
only the Cursor Agent bridge. Composio traffic does not pass through this
gateway. See the
tutorial for
the complete setup model and safety boundaries.
Grok Bot's visible-message limitation
Grok Bot currently emits a short visible message before every tool call, such as “I’ll pass that to Cursor Agent.” The plugin cannot hide or remove that host-level step. The bundled skill keeps it brief and prevents Grok Bot from impersonating Cursor Agent.
Security model
fixed Cursor Agent executable; no shell invocation
bounded prompt, output, timeout, payload, rate, and concurrency
minimal child-process environment (API key forwarded only when configured)
OAuth discovery, dynamic client registration, authorization code + PKCE, signed access tokens, and refresh tokens
owner approval required; owner code never works as a bearer token
host/origin checks, DNS-rebinding protection, localhost-only bind, log redaction, and filtered status output
fail-closed startup if the endpoint, owner code, agent binary, or workspace is invalid
The OAuth provider is intentionally single-owner. Registered clients persist
locally in a mode-0600 JSON file; pending approvals and authorization codes are
in memory. Rotating CURSOR_BRIDGE_SECRET invalidates issued tokens.
Test and audit
python -m pip install -e '.[dev]'
python -m unittest discover -s tests -v
python src/privacy_scan.py --root .
python scripts/audit_git_history.py
python3 scripts/doctor.pyAlso read SECURITY.md before exposing the endpoint.
License
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
OAuth 2.1 short-link tools for AI agents with scoped tokens, approvals, audit logs, and revocation.
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables local MCP clients to interact with xAI Grok through OAuth PKCE, supporting chat, X search, image/video generation, TTS, and transcription.94 npm2MIT
- FlicenseAqualityBmaintenanceEnables using the xAI Grok CLI as an MCP sub-agent for code review, asking questions, and continuing conversations within MCP hosts like Claude Code.4-
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to generate text, images, and videos via Grok's web UI using MCP tools (grok_chat, grok_generate_image, grok_generate_video) without an API key.MIT
- AlicenseNot gradedqualityCmaintenanceEnables Grok Bot to securely send requests to a local Hermes Agent through OAuth-authenticated MCP tools, returning Hermes-generated answers in chat.3MIT