Docs / Ship / MCP

MCP

The FASTBASE MCP server lets AI coding agents — Claude Code, Cursor, Codex and others — operate FASTBASE directly. You say “Publish this project with FastBase” and the agent analyzes, deploys and reports the live URL.

Set up

  1. Create an access token: Settings → Access tokens.
  2. Register the server with your agent. For Claude Code:
claude mcp add fastbase \
  --env FASTBASE_API_URL=https://api.<your-fastbase-domain> \
  --env FASTBASE_TOKEN=fbp_… \
  -- npx -y fastbase-mcp

The server is the fastbase-mcp package on npm; npx -y downloads it on first use, nothing else to install. Keep the token in the agent's configuration — never paste it into a chat. Inside this repository the same server runs with pnpm fastbase-mcp.

For other clients, add a stdio server with the same command and environment. If you already ran fastbase login on the machine, the token variable can be omitted.

Tools

Tool What it does
fastbase_deploy Analyze, provision, build, migrate, start and health-check a local folder. Waits for the result and returns the URL or a diagnosis.
fastbase_analyze_project Detection only, nothing deployed
fastbase_list_projects, fastbase_create_project Projects
fastbase_get_project_status Live / building / failed, URL, database health
fastbase_get_deployment, fastbase_get_logs Deployment details and logs (secrets masked)
fastbase_create_database, fastbase_get_database Managed PostgreSQL
fastbase_create_storage Storage bucket
fastbase_set_environment, fastbase_list_environment Variables — values can be written, never read
fastbase_rollback Restore the last working version

What the agent handles for you

FASTBASE is built for people who build with coding agents and do not want to think about servers. The MCP server tells the agent (through its server instructions and the guidance returned by fastbase_analyze_project) to take care of the mechanics itself:

  • secrets the app signs its own data with (JWT_*_SECRET, SESSION_SECRET, signing keys…) are generated by FASTBASE — the agent never asks you for them;
  • the PostgreSQL database is created on the first deployment and DATABASE_URL is injected;
  • background processes are declared by the agent in a Procfile (web: and worker: lines), also for monorepos deployed from the repository root;
  • ports come from process.env.PORT.

The only things the agent should ask you for are credentials issued by other services (payment, email, OAuth, third-party APIs). Give them to the agent in your own terminal or editor, never in a chat you might share.

What a deploy looks like to the agent

{
  "status": "LIVE",
  "url": "https://example.<your-fastbase-domain>",
  "project": { "slug": "example", "created": true },
  "detected": { "framework": "Next.js", "summary": ["Next.js detected", "PostgreSQL required"] },
  "log": ["✓ PostgreSQL database created.", "✓ Build finished in 41s.", "✓ Deployment is healthy and live at …"]
}

When a required value is missing the tool returns a structured error the agent can act on:

{ "error": { "code": "MISSING_ENVIRONMENT_VARIABLES", "details": { "missing": ["STRIPE_SECRET_KEY"] } } }

The agent asks you for the value and calls fastbase_deploy again with env.

Safety

  • The server acts as you, limited by the token’s scopes and your role in the workspace. Give an agent’s token only the scopes it needs.
  • No destructive tool exists. Deleting a project, a database or a bucket is not available through MCP at all; it requires a person typing a confirmation in the dashboard.
  • Secret values are write-only and masked in logs.
  • Every action is recorded in the audit log under the token’s name.

Without MCP

Agents that only run shell commands can use the CLI: fastbase deploy --json returns the same information as one JSON document. See CLI.