# Prismic MCP

> Prismic connects your headless CMS content directly to any AI agent. Use this server to query document data, list custom types, and check schema definitions without leaving your chat or IDE. It lets you perform advanced searches using Prismic predicates, fetch full document JSON by ID, and audit the entire repository structure programmatically.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** cms, content-modeling, api-first, web-development, document-query, json-schema

## Description

You're running into content structure issues? This server connects your Prismic headless CMS straight to your AI agent. You can query and manage document content and schema definitions without ever having to leave your chat or IDE—no jumping back to the main dashboard, I mean.

This setup lets you do way more than just simple searches; it gives your agent deep access into the repo's guts. It handles everything from querying specific fields with raw predicates to listing every single structural element in your content model.

### Getting Data: What You Can Pull Down

You can grab the whole payload for any single document using its unique ID via `get_document_by_id`. This gives you all the component architecture and metadata, wrapped up in one solid JSON blob. If you need to perform a specific search, you'll use `query_prismic_documents` which executes powerful searches across your entire repo using raw Prismic predicates; this tool handles pagination and lets you filter by locale right out of the box.

Need something more targeted? You can run an advanced search restricted only to a specific language locale—say, Spanish in Mexico—using `search_filtered_locale`. Or, if you know what type or tag you're looking for, you don't need complex queries. You can list all documents just by their custom content type using `list_documents_by_type`, or find every document assigned a specific global tag with `list_documents_by_tag`.

### Mapping the Structure: Understanding Your Repo

Before you write any code, you gotta know what's available. This server gives you visibility into the entire content model. You can run `get_repo_metadata` to pull high-level info about your Prismic repository—it spits out every defined type and every language locale it supports. Want to see everything in one go? Use `list_custom_types` to get a complete list of all configured custom content types. Similarly, you can run `list_global_tags` to pull every single global tag used across the entire system.

It also lists every available language locale (like 'en-us' or 'fr-ca') through `list_i18n_languages`. If you want to understand how data is filtered, check out `get_query_form_schema` which fetches the schema details for any specified query form, like checking what fields are involved in an 'everything' search.

### The Bottom Line

In short, your AI client uses these tools to perform a full audit of your CMS structure. It reads all custom types and global tags; it checks out the underlying schema definitions for any given query form; it pulls complete document JSONs by ID; and finally, it runs complex, filtered searches using raw predicates against specific types or tags. You're getting deep structural access to Prismic without needing admin credentials or manual dashboard navigation.

## Tools

### get_document_by_id
Retrieves the complete content payload of a single Prismic document using its unique ID.

### get_query_form_schema
Fetches and displays the schema details for a specified query form (e.g., 'everything').

### get_repo_metadata
Retrieves high-level information about your Prismic repository, including all defined types and languages.

### list_custom_types
Lists every custom content type that has been configured in the repository.

### list_documents_by_tag
Finds and lists all documents that have been assigned a specific global tag.

### list_documents_by_type
Lists all documents belonging to one specified custom content type.

### list_global_tags
Retrieves a complete list of every global tag used across the entire repository.

### list_i18n_languages
Lists all language locales (e.g., 'en-us', 'fr-ca') configured for content in the repository.

### query_prismic_documents
The main query tool: executes powerful searches using raw Prismic predicates, supporting pagination and locale filters.

### search_filtered_locale
Performs a filtered search for documents, restricting results to a specific language locale (e.g., 'es-mx').

## Prompt Examples

**Prompt:** 
```
List all custom types available in my Prismic repository.
```

**Response:** 
```
I found 4 custom types in your repository: 'homepage', 'blog_post', 'author', and 'navigation'. Would you like me to fetch a few documents of type 'blog_post' to check out the structure?
```

**Prompt:** 
```
Can you fetch the document JSON for the ID 'ZbHwWxEAACUAx9'?
```

**Response:** 
```
Here is the full JSON payload for document 'ZbHwWxEAACUAx9'. It is a 'page' type with the slug 'about-us'. I can generate a Next.js component to map this slice structure if you'd like.
```

**Prompt:** 
```
Search for all documents tagged with 'seo' and 'landing'.
```

**Response:** 
```
I performed a search using Prismic predicates for the tags 'seo' and 'landing'. The API returned 12 documents. They are mostly of type 'article'. Want to see the titles of the first 5 results?
```

## Capabilities

### Get Full Document JSON by ID
Fetch all content and metadata for a single Prismic document using its unique identifier.

### Query Content with Predicates
Perform powerful, filtered searches across the entire repository using raw search predicates (e.g., finding documents tagged 'seo' in locale 'en-us').

### List Repository Structure Elements
Retrieve metadata like all custom types, global tags, and supported languages defined in your CMS.

### Check Query Form Schemas
Get the underlying schema details for a specific query form (e.g., 'everything') to understand how it filters data.

### Search by Tag or Type
Limit searches quickly by requesting only documents belonging to a specific custom type or possessing a global tag.

## Use Cases

### Need to verify a content model for a new feature.
A developer needs to know if the 'author' profile type exists and what fields it uses. Instead of checking documentation or opening the CMS settings, they ask their agent: 'List all custom types.' The agent runs `list_custom_types` and returns the list, confirming the model structure instantly.

### Debugging a broken localized page.
An SEO specialist finds that the French version of a landing page is missing content. They ask the agent to 'Search for documents tagged 'landing' in locale 'fr-fr'.' The agent runs `search_filtered_locale`, returning only the necessary JSON data so they can confirm if the document exists and where the content broke.

### Fetching a single component payload for local testing.
A frontend developer has an ID (`ZbHwWxEAACUAx9`) and needs its full structure to test a new React component. They run `get_document_by_id`. The agent pulls the entire JSON, allowing the dev to copy the exact slice structure without needing to open the CMS preview panel.

### Finding all content related to 'AI' across multiple types.
A content manager needs a list of all articles and homepages mentioning 'AI'. They use `query_prismic_documents`, inputting predicates for both the tag ('ai') AND specific document types, getting one unified, filtered result set.

## Benefits

- **Stop manual ID lookups.** Use `get_document_by_id` to pull a full document JSON payload in one step. You get the complete component structure, not just a snippet of text.
- **Audit your CMS at scale.** Run `list_global_tags` or `list_custom_types` instantly. Know exactly what content models exist without clicking through settings pages.
- **Target specific language versions.** If you only need the German version of a blog post, use `search_filtered_locale`. You don't waste time filtering out irrelevant locales.
- **Perform complex queries in chat.** The `query_prismic_documents` tool accepts raw predicates. This means you can ask for content that matches 'tag X AND type Y'—it handles the logic for you.
- **Understand your schema constraints.** Run `get_query_form_schema` to see exactly how Prismic structures a query, which helps you build more accurate API calls.
- **Verify multi-language setup.** Use `list_i18n_languages` first. Knowing all available locales ensures your code handles every language variant correctly.

## How It Works

The bottom line is, you can treat your entire CMS repository like a database queried through plain English conversation.

1. You connect your AI client and specify the Prismic Repository Name (and token, if needed).
2. Your agent calls one of the 10 exposed tools (e.g., `query_prismic_documents`) with specific parameters like tags or locales.
3. We execute the query against the live Prismic API and return the structured data payload directly to your agent.

## Frequently Asked Questions

**How do I start extracting content from my Prismic repository?**
Subscribe, enter your Prismic Repository Name, and if your repository is private, grab an Access Token from **Settings → API & Security**. No manual SDK setups or GraphQL integrations — just connect and start querying your custom types and documents directly through your AI agent.

**Can my AI agent help me build Next.js components matching my Custom Types?**
Yes! Ask your agent to query a specific document ID or list custom types. It will retrieve the exact JSON payload returned by the Prismic API. Based on that structure, the agent can instantly generate your Next.js/React component props, mock data, and TS interfaces natively inside Cursor.

**What happens when I need to find all blog posts tagged with 'announcement' in French?**
Just ask your AI agent. It uses the `search_filtered_locale` tool and Prismic predicates to filter documents precisely by type, tag, and language code without requiring you to manually craft complex API query strings or write ad-hoc fetch scripts.

**Does it support deep repository insights for large content websites?**
Absolutely. You can list all custom types, pull an array of all global tags, and verify all configured languages for multi-lingual websites. It acts as an instant audit tool for publishers, content operations teams, and architects managing extensive CMS architectures.

**How do I get started with `get_repo_metadata` and what credentials are needed?**
You need to provide your Prismic Access Token during setup. This token gives the AI client read-only access, allowing you to pull core repository data like master references, custom types, and available languages.

**What is the practical difference between `query_prismic_documents` and `list_documents_by_tag`?**
The general query tool supports complex filtering using raw Prismic predicates. Use it when you need to combine multiple criteria (e.g., type AND tag AND locale) for precise content retrieval.

**If I use `get_document_by_id`, do I receive the full component structure and copy?**
Yes, this tool fetches the entire document payload as a single JSON object. It provides all necessary data—including internal slists and component architecture—for rendering without needing follow-up API calls.

**How does `get_query_form_schema` help me build accurate queries?**
It returns a JSON schema that details the exact structure of query parameters for any given form. Your agent uses this blueprint to construct predicates, ensuring your search request is valid and complete.