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.
Quickstart
You do not need to install the package globally. Most AI clients run the server on-demand using npx:
npx -y @schmadev/mcp-serverThe process communicates via standard input/output (stdio) and authenticates using environment variables.
Environment variables
Configure the following environment variables in your client configuration file:
| Variable | Required | Description |
|---|---|---|
| SCHMA_API_URL | Yes | The API endpoint (e.g. https://api.schma.dev or local host). |
| SCHMA_API_KEY | Yes | Delivery API key (read-only) or Admin key (for schema management). |
| SCHMA_TENANT_SLUG | Yes | Your 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):
{
"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
{
"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"
}
}
}
}MCP tool reference
When connected, your assistant automatically discovers these 10 tools:
| Tool Name | Parameters | Purpose |
|---|---|---|
| list_content_types | none | List all defined content models in the CMS workspace. |
| get_schema | contentType | Get field names, data types, and validation rules for a content model. |
| get_entries | contentType, limit?, status? | Fetch published or draft entries matching a content type. |
| search_content | query | Natural-language semantic vector search across all content entries. |
| create_entry | contentType, data, status? | Create a new entry with field validation (draft by default). |
| update_entry | entryId, data | Update fields of an existing entry by UUID. |
| publish_entry | entryId | Transition a draft or edited entry to published status. |
| create_content_type | name, slug, fields | Define a brand new content model and create the database schema. |
| update_schema | contentType, fields | Evolve schema fields, add new attributes, or reorder model columns. |
| generate_schema | prompt | Synthesize 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:
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, andsearch_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).