MCP

Connect Claude, Cursor, Codex or any MCP client to /mcp, signed in with OAuth 2.1.

POST /mcp is a Model Context Protocol server. It lets an AI client (Claude Code, Claude Desktop, Cursor, Codex, your own agent) work in your data as one agent: every change goes through a run, and that agent's merge policy decides what reaches the data.

Transport: Streamable HTTP, stateless, protocol 2025-06-18 and earlier. No server-sent stream (GET /mcp answers 405).

Connect a client

shell
claude mcp add --transport http forkbase https://api.myapp.com/mcp

Cursor, .cursor/mcp.json:

JSON
{ "mcpServers": { "forkbase": { "url": "https://api.myapp.com/mcp" } } }

Codex, ~/.codex/config.toml:

TOML
[mcp_servers.forkbase]
url = "https://api.myapp.com/mcp"

The first call answers 401. The client finds Forkbase's OAuth server from it, registers itself, and opens a browser at /oauth/authorize. You land on the dashboard's consent page (sign in with the service key if you aren't), pick which agent the client works as and whether it may run jobs, and approve.

Clients without OAuth: send an agent's fba_ token as Authorization: Bearer fba_.... The service key is never accepted as an MCP token.

Tools

ToolArguments
describe_schematables, columns, types, primary and foreign keys
start_runintent, ttl_seconds?a new run (a private world)
run_sqlrun, sql, params?one statement in the run's world
run_changesrun, limit?the rows the run changed (default 200 per table)
propose_runrunmerged, held (with reasons) or conflict
discard_runrunthrow an open run away
list_runsstatus?, limit?this agent's runs
get_runrunone run: status, intent, policy, outcome

With the jobs scope, also:

ToolArguments
list_functionsthe functions deployed with this agent
invoke_functionname, payload?, idempotency_key?, wait_s?start a job (wait up to 60 s)
get_jobidstatus, result, attempts, steps
list_jobsfunction, status?, limit?a function's jobs

Nothing over MCP approves, rejects or undoes. A held proposal comes back as {"status": "held", "reasons": [...]} for a person to review in the dashboard.

OAuth 2.1

Route
GET /.well-known/oauth-protected-resource[/mcp]where the authorization server is
GET /.well-known/oauth-authorization-serverits metadata
POST /oauth/registerdynamic client registration (open; public clients)
GET /oauth/authorizestarts sign-in; sends you to the consent page
POST /oauth/tokenauthorization_code (PKCE S256 only) and refresh_token grants
POST /oauth/revokerevoke a token
GET /oauth/grants, DELETE /oauth/grants/{id}service key: connected apps, and disconnect one
  • Scopes: agent (the run tools), jobs (the job tools), offline_access (a refresh token).
  • Access tokens (fbm_) last an hour. Refresh tokens (fbmr_, with offline_access) last 30 days and rotate on use.
  • A reused authorization code, or a refresh token replayed after it was spent, ends the whole grant.
  • Redirect URIs: https://, http:// on localhost, or an app's own scheme.
  • The dashboard's Agents, Connected apps lists grants and disconnects them.

The agent skill

The forkbase-agent skill teaches an agent the run, check, propose, stop-when-held loop. Install the whole pack with curl -fsSL <your forkbase>/skills/install.sh | sh (see Skills), so the client works well with the tools above.

Something wrong or missing? Edit this page on GitHub or open an issue.

MCP · Forkbase