Model Context Protocol (MCP) & AI Tooling

Give AI coding assistants live access to your content models, field types, and CMS entries without copy-pasting schemas.

What is the SCHMA MCP Server?

The Model Context Protocol (MCP) is an open standard that allows AI assistants like Cursor, Claude Desktop, and autonomous agents to securely call external tools and inspect data sources.

SCHMA publishes @schmadev/mcp-server, a lightweight stdio server that runs locally on your machine. When active, your AI coding assistant can introspect your exact PostgreSQL content schemas, search your CMS entries, and generate type-safe frontend components that match your database reality.

Native stdio transport10 verified AI toolsCursor & Claude Desktop ready

Quickstart

You do not need to install the package globally. Most AI clients run the server on-demand using npx:

Execution command
npx -y @schmadev/mcp-server

The process communicates via standard input/output (stdio) and authenticates using environment variables.

Environment variables

Configure the following environment variables in your client configuration file:

MCP Environment variables
VariableRequiredDescription
SCHMA_API_URLYesThe API endpoint (e.g. https://api.schma.dev or local host).
SCHMA_API_KEYYesDelivery API key (read-only) or Admin key (for schema management).
SCHMA_TENANT_SLUGYesYour workspace slug (found in Studio URL or workspace settings).

Client setup

Cursor IDE

Add the server configuration to your project root at .cursor/mcp.json (or globally in Cursor Settings → Features → MCP):

.cursor/mcp.json
{
  "mcpServers": {
    "schma": {
      "command": "npx",
      "args": ["-y", "@schmadev/mcp-server"],
      "env": {
        "SCHMA_API_URL": "https://api.schma.dev",
        "SCHMA_API_KEY": "YOUR_SCHMA_API_KEY",
        "SCHMA_TENANT_SLUG": "YOUR_WORKSPACE_SLUG"
      }
    }
  }
}

Read the complete step-by-step Cursor IDE setup guide →

Claude Desktop

Add the configuration to your Claude Desktop configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "schma": {
      "command": "npx",
      "args": ["-y", "@schmadev/mcp-server"],
      "env": {
        "SCHMA_API_URL": "https://api.schma.dev",
        "SCHMA_API_KEY": "YOUR_SCHMA_API_KEY",
        "SCHMA_TENANT_SLUG": "YOUR_WORKSPACE_SLUG"
      }
    }
  }
}

Read the Claude Desktop configuration guide →

MCP tool reference

When connected, your assistant automatically discovers these 10 tools:

SCHMA MCP registered tools
Tool NameParametersPurpose
list_content_typesnoneList all defined content models in the CMS workspace.
get_schemacontentTypeGet field names, data types, and validation rules for a content model.
get_entriescontentType, limit?, status?Fetch published or draft entries matching a content type.
search_contentqueryNatural-language semantic vector search across all content entries.
create_entrycontentType, data, status?Create a new entry with field validation (draft by default).
update_entryentryId, dataUpdate fields of an existing entry by UUID.
publish_entryentryIdTransition a draft or edited entry to published status.
create_content_typename, slug, fieldsDefine a brand new content model and create the database schema.
update_schemacontentType, fieldsEvolve schema fields, add new attributes, or reorder model columns.
generate_schemapromptSynthesize a complete schema definition from natural language instructions.

Example interaction in Cursor

When prompting Cursor or Claude with the SCHMA MCP server active, the model queries tools automatically:

Model conversation flow
User: "I want to create a new testimonial section on the homepage. What fields does our 'testimonial' content model have?"

Cursor / Claude Agent:
Calls get_schema({ contentType: "testimonial" })
Returns:
- quote (richText, required)
- authorName (string, required)
- authorRole (string, optional)
- company (string, optional)
- avatarImage (media, optional)

Agent: "The 'testimonial' schema has 5 fields: quote, authorName, authorRole, company, and avatarImage. I can write the React component to display these fields now."

Security & key scoping

To prevent AI agents from accidentally altering your content models, configure your MCP server with appropriate key scopes:

  • Read-Only Key (Recommended for development): Grants list_content_types, get_schema, get_entries, and search_content. Ideal for building frontend components.
  • Admin Key: Required if you want the agent to create entries or synthesize schemas (create_entry, create_content_type).

Learn how to configure scoped API keys in Studio →