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
claude mcp add --transport http forkbase https://api.myapp.com/mcpCursor, .cursor/mcp.json:
{ "mcpServers": { "forkbase": { "url": "https://api.myapp.com/mcp" } } }Codex, ~/.codex/config.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
| Tool | Arguments | |
|---|---|---|
describe_schema | tables, columns, types, primary and foreign keys | |
start_run | intent, ttl_seconds? | a new run (a private world) |
run_sql | run, sql, params? | one statement in the run's world |
run_changes | run, limit? | the rows the run changed (default 200 per table) |
propose_run | run | merged, held (with reasons) or conflict |
discard_run | run | throw an open run away |
list_runs | status?, limit? | this agent's runs |
get_run | run | one run: status, intent, policy, outcome |
With the jobs scope, also:
| Tool | Arguments | |
|---|---|---|
list_functions | the functions deployed with this agent | |
invoke_function | name, payload?, idempotency_key?, wait_s? | start a job (wait up to 60 s) |
get_job | id | status, result, attempts, steps |
list_jobs | function, 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-server | its metadata |
POST /oauth/register | dynamic client registration (open; public clients) |
GET /oauth/authorize | starts sign-in; sends you to the consent page |
POST /oauth/token | authorization_code (PKCE S256 only) and refresh_token grants |
POST /oauth/revoke | revoke 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_, withoffline_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.