Gitworthy supports two MCP transports:
| Transport | Command | Use when |
|---|---|---|
| stdio (default) | gitworthy mcp / npx -y gitworthy@latest mcp |
Local desktop IDE, agent VM with Node |
| Streamable HTTP | gitworthy mcp --http or a hosted /mcp URL |
Cursor Cloud Agents, mobile/iPad, remote hosts |
HTTP MCP is the remote interface. It is not a multi-tenant SaaS product: you run or deploy the same open-source engine and protect it with a bearer token.
export GITWORTHY_MCP_TOKEN="$(openssl rand -hex 32)"
export GITHUB_TOKEN="github_pat_..."
gitworthy mcp --http --host 127.0.0.1 --port 8787Useful flags:
--host— bind address (default127.0.0.1, orGITWORTHY_MCP_HOST)--port— listen port (default8787, orGITWORTHY_MCP_PORT)--path— MCP path (default/mcp, orGITWORTHY_MCP_PATH)--stateless— no session map; preferred behind serverless proxies
Bind policy:
-
Loopback (
127.0.0.1,localhost,::1) may start without a token for local dev. Tokenless loopback still enforces a localhost Host allow-list (DNS-rebinding protection). -
Any non-loopback bind (
0.0.0.0, public host) refuses to start withoutGITWORTHY_MCP_TOKEN. -
Shared/serverless handlers fail closed without a token (no unauthenticated mode).
-
When a token is configured, every MCP request must send:
Authorization: Bearer <GITWORTHY_MCP_TOKEN>
Optional Host allow-list: GITWORTHY_MCP_ALLOWED_HOSTS=mcp.example.com,localhost.
Health check: GET /healthz.
Add a custom HTTP MCP server in cursor.com/agents (personal) or Dashboard → Integrations & MCP (team):
{
"mcpServers": {
"gitworthy": {
"url": "https://mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer ${env:GITWORTHY_MCP_TOKEN}"
}
}
}
}Notes:
- Cloud Agents recommend HTTP over stdio so credentials stay out of the agent VM.
- Use type
http/ URL-based config (not legacy SSE /mcp-remote). - Keep
GITHUB_TOKENon the server environment, not in the client headers, unless you intentionally forward it.
- Expose
api/mcp.ts(thin re-export ofsrc/mcp/vercel-handler.tsfor Vercel bundling). - Set project env:
GITWORTHY_MCP_TOKEN(required — handler fails closed without it)GITHUB_TOKEN(recommended)- optional
GITWORTHY_MCP_ALLOWED_HOSTS - optional
GITWORTHY_MCP_PATH(defaults to the invoked URL path, e.g./api/mcp)
- Point Cloud Agents at
https://<deployment>/api/mcp.
The serverless handler is stateless Streamable HTTP with JSON responses. Ephemeral serverless disks are not a durable outcome store.
- Treat a public MCP URL as a hostile-network surface.
- Rotate
GITWORTHY_MCP_TOKENif it leaks. - Never put GitHub tokens in config files, captures, or MCP logs.
- Prefer short-lived deploy URLs or network allow-lists for early betas.
See SECURITY.md.