Docs/MCP

feega MCP

feega exposes a Model Context Protocol server so coding agents (Cursor, Claude, and others) can read and write a brand's canvas, posts and ad campaigns directly — with the same OAuth login as the CLI.

Your agent
   │  stdio (local)     →  bun run mcp  /  feega-mcp
   │  HTTPS (remote)    →  https://mcp.feega.app/mcp  + Bearer
   ▼
feega API  (/api/v1/*)
No static API tokens. Authentication is always OAuth (browser login or Bearer from your session).

Quick start

Pick a transport: local stdio is simplest on your machine; remote HTTP is for cloud hosts.

Option A — Local stdio

Best for Cursor and other local agents.

  1. Install Bun and clone the feega repo (or install the CLI binary so feega-mcp is on your PATH).
  2. Authenticate once:
    feega login
    # once, in a terminal — the CLI and the local MCP server share one session
  3. Add to Cursor MCP config (absolute path required when using Bun):
    {
      "mcpServers": {
        "feega": {
          "command": "bun",
          "args": ["run", "/ABS/PATH/to/feega/cli/mcp/stdio.ts"]
        }
      }
    }

    If the binary is on PATH after install:

    {
      "mcpServers": {
        "feega": { "command": "feega-mcp" }
      }
    }
  4. Restart Cursor / reload MCP. Call `query` on `brands`, then work with a brand_id.

Session file (shared with the CLI): ~/.config/feega/session.json.

Option B — Remote HTTP

  1. Confirm the server is up:
    curl -sS https://mcp.feega.app/health

    Expect a JSON health payload with ok: true and mcp: "/mcp".

  2. Cursor MCP config:
    {
      "mcpServers": {
        "feega": {
          "url": "https://mcp.feega.app/mcp"
        }
      }
    }
  3. Clients that speak MCP OAuth (opencode, Claude Code, Cursor, the Inspector…) authenticate on their own: on first connect they open feega.app, you approve, and the token is stored by the client. The initial 401 is the start of that handshake, not a crash.

Custom option — if your client cannot do OAuth, attach the token by hand: Authorization: Bearer <access_token>, using the Supabase access token that feega login saves in ~/.config/feega/session.json. Static API keys (feega_…) are not accepted by the remote server.

Option C — Local HTTP

cd cli
bun install
bun run mcp:http
# → http://localhost:8787/mcp
#    http://localhost:8787/health

Auth: Bearer or the local session file.

Auth rules

ContextHow you authenticate
Local stdio / local HTTPfeega login → shared session file
Remote HTTPOAuth 2.1 + PKCE, or Authorization: Bearer <access_token>
Static API keyNot supported

Protected resource metadata: GET /.well-known/oauth-protected-resource.

What to call first

  1. query({ table: "brands", columns: ["id","slug","name"] }) — — confirm auth and see which brands/orgs this session can see
  2. query({ table: "posts", columns: ["id","status","caption"], where: [...] }) — a brand's pending posts (add a brand_id filter once you have one)
  3. Ids from list-derived reads accept short unambiguous prefixes; a `where` on `id` in `delete_row`/`update_row` needs the full id.

Twelve tools total — the CLI is narrower and brand-scoped, and does not expose the six generic ones below.

Tool areas

query reaches every table your org can see, as you: Postgres RLS returns exactly what you would see in the app. Always name columns, or the character cap drops whole rows to fit a long answer into a short one.

AreaExamples
Reading and writing any tablequery, insert_row, update_row, delete_row, describe_node_types
Canvas generationrun_node_generation
Ad campaignslist_ad_campaigns, create_ad_campaign, approve_ad_campaign

Full catalog, with parameters and CLI equivalents: tools.md.

Troubleshooting

SymptomLikely causeFix
401 on /mcpMissing or invalid Bearer on remoteLogin locally and pass the access token, or use stdio
Tools missingMCP not connected in the hostCheck the Cursor MCP panel and restart the host
Auth works in CLI but not MCPDifferent machine / no session fileRun feega login on the machine running the MCP server
'conflict' on run_node_generationStale version — someone else wrote the node since you read itRe-read the node with query, take its current version, retry

Next

  • Agent skill — install the feega skill so agents know when and how to call MCP or the CLI
  • CLI — terminal commands when MCP is not available
  • API reference — REST endpoints the CLI calls
  • feega — source, tools map, and development notes