Headless page builder
## Prismic MCP Server: Headless Website Builder The **Prismic MCP Server** integrates Prismic into Google Antigravity, enabling headless content management with Slice Machine, custom types, and integration fields directly from your development environment. ### Why Prismic MCP? - **Slice Machine**: Component-based content modeling synced with code - **Integration Fields**: Connect external data sources as content fields - **Scheduling**: Schedule content releases in advance - **A/B Testing**: Built-in experimentation for content optimization - **Multi-Language**: First-class localization with fallback support ### Key Features #### 1. Content Queries ```python # Query by custom type documents = await mcp.query( predicates=[ ["at", "document.type", "blog_post"], ["at", "my.blog_post.category", "technology"] ], orderings={"field": "my.blog_post.date", "direction": "desc"}, page_size=10 ) for doc in documents["results"]: print(f"Post: {doc['data']['title'][0]['text']}") # Get by UID document = await mcp.get_by_uid( custom_type="blog_post", uid="my-first-post", lang="en-us" ) ``` #### 2. Document Management ```python # Create document doc = await mcp.create_document( custom_type="blog_post", lang="en-us", uid="new-article", data={ "title": [{"type": "heading1", "text": "New Article"}], "body": [{"type": "paragraph", "text": "Article content..."}], "author": {"id": "author_123", "type": "author", "link_type": "Document"} } ) # Update document await mcp.update_document( document_id=doc["id"], data={"title": [{"type": "heading1", "text": "Updated Title"}]} ) # Publish document await mcp.publish_document(document_id=doc["id"]) ``` #### 3. Slice Operations ```python # Get slices from document document = await mcp.get_by_uid("page", "homepage") for slice in document["data"]["body"]: print(f"Slice: {slice['slice_type']}") if slice["slice_type"] == "hero": print(f" Title: {slice['primary']['title']}") print(f" Items: {len(slice['items'])}") ``` #### 4. Asset Management ```python # Upload media media = await mcp.upload_media( file_path="./images/banner.jpg", filename="banner.jpg" ) # Reference in document await mcp.update_document( document_id="doc_123", data={ "image": { "origin": {"id": media["id"]}, "alt": "Banner image" } } ) ``` ### Configuration ```json { "mcpServers": { "prismic": { "command": "npx", "args": ["-y", "@anthropic/mcp-prismic"], "env": { "PRISMIC_REPOSITORY": "your-repo-name", "PRISMIC_ACCESS_TOKEN": "your-access-token", "PRISMIC_CUSTOM_TYPES_TOKEN": "your-custom-types-token" } } } } ``` ### Use Cases **Marketing Sites**: Build marketing websites with modular slices that marketers can rearrange. **Developer Experience**: Sync content models with Slice Machine for type-safe development. **Multi-Region Sites**: Manage localized content with region-specific variations. **Blog Platform**: Create blog platforms with rich text, media, and author relationships. The Prismic MCP enables component-based content management within your development environment.
{
"mcpServers": {
"prismic": {
"mcpServers": {
"prismic": {
"env": {
"PRISMIC_REPO": "your-repo-name",
"PRISMIC_TOKEN": "your-access-token"
},
"args": [
"-y",
"prismic-mcp-server"
],
"command": "npx"
}
}
}
}
}