# Hygraph (Headless CMS) MCP

> Hygraph (Headless CMS) MCP connects your AI agent directly to your entire content backend. You can inspect schemas, run complex queries, publish drafts, or wipe out old documents—all through natural conversation. It gives you full control over federated content and structured data without ever leaving your chat client.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** graphql, content-modeling, api-first, schema-management, structured-content, federated-content

## Description

This MCP lets you treat your headless CMS like a database you talk to. Instead of writing specific GraphQL endpoints or hitting REST URLs, you simply ask your AI agent what you need done with your content models. You can discover all the available fields just by asking about a model's structure, then run complex queries that pull out exactly the data points you want—like titles and slugs from published posts. Need to update a draft? Tell it which document ID needs changing, or instruct it to promote existing drafts to live content. If you're managing multiple international versions of content, you can audit all your locales in one go. Because this MCP lives on Vinkius, you connect once across any compatible client and instantly get access to Hygraph's entire suite of tools.

## Tools

### create_cms_document
Automates the creation of a new dynamic model instance.

### wipe_cms_document
Irreversibly deletes specified content arrays, leaving clean states.

### list_project_locales
Identifies active translation spaces across your project's different languages.

### get_model_fields
Inspects the specific internal fields available within a given content model.

### list_schema_introspection
Determines and lists all content models that your entire project hosts.

### list_media_assets
Lists all attached media files, providing structured rules about media limits.

### publish_cms_document
Performs the process of promoting content properties to a live, published state.

### execute_graphql_mutation
Sends a structured payload that executes direct data writes to your schema.

### execute_graphql_query
Runs pure GraphQL queries to fetch specific, bounded routing data from Hygraph.

### update_cms_document
Changes global web content boundary values for a document, safely updating drafts.

## Prompt Examples

**Prompt:** 
```
List all content models in my project
```

**Response:** 
```
I've performed a schema introspection. Your project contains 8 content models including 'BlogPost', 'Author', 'Category', 'Product', and 'CustomerReview'. Which one would you like to inspect?
```

**Prompt:** 
```
Show me the fields for the 'BlogPost' model
```

**Response:** 
```
The 'BlogPost' model has the following fields: 'title' (String), 'slug' (String), 'content' (RichText), 'author' (Relation to Author), 'publishedDate' (DateTime), and 'coverImage' (Asset). Would you like to create a new draft post?
```

**Prompt:** 
```
Execute a query to get the title and slug of the last 3 published posts
```

**Response:** 
```
Running GraphQL query… I've retrieved the last 3 posts: 1) 'AI in 2024' (slug: ai-2024), 2) 'Mastering Hygraph' (slug: mastering-hygraph), and 3) 'Headless CMS Trends' (slug: cms-trends). All are currently in the PUBLISHED stage.
```

## Capabilities

### Discovering Content Structure
The MCP lets your agent automatically list all content models and inspect the specific fields they contain.

### Querying Structured Data
You can run complex queries to fetch related data, like getting details for the last three published blog posts.

### Creating and Updating Content
The agent handles creating new content drafts or safely mutating existing documents with specific field values.

### Managing Media Assets
You can get a list of attached media files, retrieving the necessary cloud URLs for your frontend code.

### Controlling Document Status
The MCP allows you to move content from a draft state directly to published status.

## Use Cases

### Getting metadata for a new feature launch
The developer needs all product slugs and titles for the next marketing campaign. They prompt their agent: 'Give me the title and slug of every published blog post.' The agent automatically runs an execute_graphql_query, returning a clean list that can be copied directly into code.

### Verifying content model changes
The architect needs to know if a new field was added to the 'Product' model. They ask their agent to run a schema introspection tool, which immediately lists all available fields and confirms the structure without logging into the Hygraph console.

### Fixing an old draft post
The editor realizes that Draft ID 45 needs its cover image updated and published. Instead of navigating three different screens, they command their agent to use update_cms_document, providing the new asset handle and triggering a live status change.

### Auditing multilingual content
The team lead needs to know which locales have been mapped for French translation. They simply ask the MCP to list all project locales, getting an immediate report via list_project_locales, saving hours of manual checking.

## Benefits

- Stop context switching. You can check model schemas, run complex queries, and update documents—all in one chat window with your agent.
- Maintain data cleanliness by using the 'wipe_cms_document' tool to irreversibly delete nodes when you need a completely clean content repository.
- Manage localization complexity easily. Use list_project_locales to audit all translation spaces, ensuring your internationalized content is mapped correctly before publishing.
- Speed up development cycles by letting your agent run 'execute_graphql_query' to pull data points like titles and slugs without needing a custom API call every time.
- Control the entire content lifecycle. You can publish drafts using 'publish_cms_document', moving content from draft status directly to live visibility.

## How It Works

The bottom line is that you interact with your entire headless CMS using natural language commands instead of manual API calls.

1. Subscribe to this MCP, providing your Hygraph API Endpoint and Auth Token.
2. Your AI client uses the provided credentials to connect to the CMS backend via a secure tunnel.
3. You talk naturally to your agent, telling it exactly what content action you need—like 'get me all product slugs' or 'publish draft post 123'.

## Frequently Asked Questions

**Can Hygraph (Headless CMS) MCP query content models?**
Yes, absolutely. You can use execute_graphql_query to fetch specific data points from any model, such as titles or slugs, and you can even run complex nested queries.

**How do I list all my language locales with Hygraph (Headless CMS) MCP?**
You use the 'list_project_locales' tool. This command immediately identifies every active translation space configured in your project, which is useful for localization audits.

**Can I update a document using Hygraph (Headless CMS) MCP?**
Yes, you can use the 'update_cms_document' tool to safely change data within existing documents. This lets you mutate draft values without needing manual API calls.

**What if I want to delete content permanently with Hygraph (Headless CMS) MCP?**
You can use the 'wipe_cms_document' tool for irreversible deletion of content arrays, ensuring that specific nodes are completely removed from your repository.

**Does this MCP help me discover my project schema?**
Yes. You can run list_schema_introspection to automatically determine every content model the project hosts, giving you a full overview of your data architecture.