Remote MCP server exposing GitHub-backed tools for launching Codex tasks, reviewing pull requests, gating merges, and triggering validations. Implements the MCP Streamable HTTP transport with SSE fallback.
initialize,tools/list, andtools/callJSON-RPC endpoints on a single/mcproute- Streamable HTTP responses with optional
text/event-streamtransport - Event emission for Codex and PR activities (codex.task.* and pr.*)
- GitHub workflow dispatch, PR review, gate evaluation, merging, and validation triggering tools
- Bearer token authentication, origin validation, and rate limiting
- Zod-based runtime validation of tool arguments
-
Install dependencies:
npm install
-
Copy environment variables and configure:
cp .env.example .env # edit .env with AUTH_TOKEN, GITHUB_TOKEN, ALLOWED_ORIGINS, etc. -
Build and run:
npm run build npm start
or start in development mode with live reload:
npm run dev
POST /mcp— Streamable HTTP endpoint accepting JSON-RPC 2.0 payloadsGET /mcp— Opens an SSE stream for server-pushed eventsGET /sse— Legacy alias redirecting to/mcp
Include the following headers on requests:
Authorization: Bearer <AUTH_TOKEN>— matchesAUTH_TOKENfrom configurationMCP-Protocol-Version: 2025-06-18Mcp-Session-Id— required after the initialinitializehandshake
curl -X POST http://localhost:8080/mcp \
-H "Authorization: Bearer change-me" \
-H "Content-Type: application/json" \
-H "MCP-Protocol-Version: 2025-06-18" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{"tools":{}},"clientInfo":{"name":"curl","version":"0.0.1"}}}'curl -X POST http://localhost:8080/mcp \
-H "Authorization: Bearer change-me" \
-H "Content-Type: application/json" \
-H "MCP-Protocol-Version: 2025-06-18" \
-H "Mcp-Session-Id: <session-id-from-initialize>" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'curl -X POST http://localhost:8080/mcp \
-H "Authorization: Bearer change-me" \
-H "Content-Type: application/json" \
-H "Accept: text/event-stream" \
-H "MCP-Protocol-Version: 2025-06-18" \
-H "Mcp-Session-Id: <session-id>" \
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"launch_codex_task","arguments":{"owner":"your-org","repo":"your-repo","ref":"main","instruction":"Add tests"}}}'docker build -t codex-mcp-gateway .
docker run --env-file .env -p 8080:8080 codex-mcp-gatewaynpm testIn ChatGPT Connectors, configure a new MCP server with:
- URL:
https://<host>/mcp - Headers: include the
Authorizationbearer token andMCP-Protocol-Version - SSE URL: optional; the server automatically supports GET
/mcp
MIT