ProductsFor your stack

MCP ServerNew

Your coding agent, fluent in your content.

The Capa MCP server lets Claude Code, Codex, Cursor and any MCP client read your project, write the query a page needs, and run it against real content before it hands you the code. It reads with your key and never writes content.

~/site · your coding agent · capa connected
You

Write the query for the blog index: the 10 newest featured articles with their author’s name. Give me the SDK code for a Next.js server component.

  1. capa_graphql_schema{"model":"articles"}

    Read articles: fields, filters and sorts. author points at authors.

  2. capa_explore_data{"model":"articles","field":"featured"}

    13 published articles, 6 featured. No empty values.

  3. capa_graphql_build{"model":"articles","fields":["title",{"field":"author","fields":["name"]}],"filter":{"featured":{"eq":true}},"first":10,"run":true,"code":"next"}

    Ran it once against your content: 6 entries, inside the 5,000-entry budget.

Agent

Here is the page. The query has already run against your content, and the read is tagged with both models it touches, so a publish refreshes it.

page.tsxapp/blog/page.tsx
// app/blog/page.tsx
import { draftMode, headers } from "next/headers";
import { graphql, tagsFor } from "@capacms/sdk/nextjs";
import { BlogIndexModels } from "./capa-graphql";

const BLOG_INDEX = `#graphql
  query BlogIndex($first: Int) {
    articles(first: $first, sort: [publishedAt_DESC],
             filter: { featured: { eq: true } }) {
      nodes { id model title author { name } }
    }
  }
`;

export default async function Blog() {
  const { data } = await graphql(BLOG_INDEX, { first: 10 }, {
    draftMode, headers,
    tags: tagsFor({ namespace: BlogIndexModels }),
  });
  return <ul>{data?.articles?.nodes.map((a) => <li key={a.id}>{a.title}</li>)}</ul>;
}
Setup

One command. Then just ask.

Mint a read key under Developers > Keys, keep it in your shell, and register the server with your client.

  • Runs where your agent runs

    A small stdio server started with npx. It needs Node 20 or later and nothing else: it has no dependencies to install.

  • Sees exactly what the key sees

    A key that reads one model gives the agent a schema with one model in it. Relations to anything else show as plain ids.

  • Published or drafts, your call

    A production key reads what visitors see. A development key also reads drafts, and every answer says so.

  • One .env for app and agent

    CAPA_API_URL and CAPA_KEY are the names the SDK, codegen and the server all read.

terminal
claude mcp add capa \
  -e CAPA_API_URL=https://cdn.capacms.com \
  -e CAPA_KEY="$CAPA_KEY" \
  -e CAPA_API_VERSION=2026-10-01 \
  -- npx -y @capacms/mcp
The tools

Five tools do the querying. Their names are final.

Every query tool answers with structured content, so the agent checks its own work instead of guessing.

  • capa_graphql_schema

    What can I read?

    The models and fields the key can read. With a model, its filters, sorts and a runnable example.

  • capa_explore_data

    What is in there?

    Counts, ranges and the values a field takes, plus how many references point at nothing.

  • capa_graphql_build

    Write the query

    From a goal to GraphQL, a REST URL and SDK code, run once against your content before it is handed over.

  • capa_graphql_query

    Run any read

    Data, errors with hints, and what the read cost against the 5,000-entry budget.

  • capa_explain_error

    Why did that fail?

    Explains any API error code from a log or a failed call, and the fix, without calling Capa at all.

  • Resources and prompts

    Context on tap

    The schema as SDL for clients that attach it, a querying guide, and three prompts: explore-content, write-query and fix-query-error.

By the numbers

Small, sharp and read-only where it counts.

  • 19Tools in all
  • 17That only read
  • 0That touch your contentThe two writes change an editor layout or a nav view
  • 20,000Characters per answer, at mostSo a big result never floods the chat
What it will not do

Safe to leave connected all day.

  • Write, publish or delete content

    Content is edited in Capa. Every tool is marked as reading or writing, so your client can run the reads without asking and ask you before anything else.

  • See a model the key cannot read

    No answer names a model outside the key's reach. A one-model key really is one model.

  • Flood the conversation

    Answers are cut to a budget and say what was cut and how to ask for less. A cut list can still be paged without skipping an entry.

  • Pass off a draft as published

    Every answer names the key's environment, and a development key's answers say they include drafts.

Questions

Agents, keys and the Assistant.

Which clients does it work with?

Claude Code, Codex and Cursor have setup above. Any other MCP client takes the same command and the same environment variables in its own config.

How is this different from the Assistant?

The MCP server works in your editor or terminal and reads. The Assistant lives inside Capa and can create models and draft content, with its changes waiting in the publish queue for a person to approve.

Which key should I give it?

A production cap_live_ key for anything a site will ship, so the agent sees what visitors see. A development key only when it should see drafts, such as building a preview.

What happens when a query is too big?

The API refuses it with the number it reached and the change that fits, and the agent passes that on. capa_graphql_build names the first value that fits too.

Give your agent the real schema.

One npx line, one read key, and every query it writes has already run against your content.