# CrafterCMS MCP

> CrafterCMS MCP connects your agent directly to a headless content repository. Fetch structured page data, execute complex GraphQL queries against your schema, or run raw OpenSearch searches using just natural language prompts.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** cms, headless, graphql, opensearch, content-delivery, craftercms

## Description

Need to understand what's inside a large-scale content system without logging into the Studio? This MCP lets you inspect and query CrafterCMS directly through your agent. You can ask it to pull specific components, map out entire site hierarchies, or even run advanced searches using OpenSearch syntax. It’s built for deep visibility; use `get_item` to check a single piece of content, while `graphql` lets developers test complex data requests right from their workflow. If you're already using Vinkius as your central catalog, connecting CrafterCMS means getting all that site context and structure information in one place, letting your AI client do the heavy lifting.

## Tools

### clear_cache
Clears the Crafter Engine cache, requiring an administrative token to run.

### get_breadcrumb
Retrieves the navigational path (breadcrumbs) for a specific URL.

### get_children
Lists all subfolders or items contained within a specified directory.

### get_component
Renders and pulls the data for one specific content component type.

### get_item
Retrieves all metadata and content for a single, identified item in the CMS.

### get_navigation_tree
Generates a comprehensive map of the entire site's navigation structure.

### get_status
Reports the current operational health and status of the Crafter Engine.

### get_tree
Gets a complete, deep hierarchy listing for all content under a specified folder.

### graphql
Executes any defined query using the GraphQL language against your content schema.

### rebuild_context
Forces the system to rebuild its understanding of the site context, needing a management token.

### search
Runs a raw search query using OpenSearch JSON syntax across all content.

### transform_url
Applies specific logic to modify or adjust how a content path is presented in a URL.

## Prompt Examples

**Prompt:** 
```
Get the content for the item at path '/site/website/index.xml'.
```

**Response:** 
```
I've retrieved the item. It's a page titled 'Home' with several components attached. Would you like me to list the components or show the full metadata?
```

**Prompt:** 
```
Show me the navigation tree for the root folder with a depth of 2.
```

**Response:** 
```
Generating the navigation tree... I've found the main sections: 'Products', 'Services', and 'About Us', each with their primary sub-pages. Which section should we explore further?
```

**Prompt:** 
```
Run a GraphQL query to fetch all articles with their titles and dates.
```

**Response:** 
```
Executing GraphQL query... I've retrieved 10 articles. The latest is 'New Features in v4' dated 2023-10-27. Would you like the content of a specific article?
```

## Capabilities

### Retrieve specific content items
You can pull single pieces of content using `get_item` or retrieve reusable parts of a page with `get_component`.

### Map site structure and navigation
Understand how your website is built by getting the full navigation tree (`get_navigation_tree`) or listing folders using `get_children`.

### Execute advanced content queries
Run complex data requests against the schema via `graphql` or execute raw searches with OpenSearch JSON syntax using `search`.

### Manage engine state and context
Perform administrative tasks like clearing the cache (`clear_cache`) or rebuilding the content context (`rebuild_context`).

### Analyze site paths and URLs
Determine breadcrumb navigation using `get_breadcrumb` or adjust how a URL is generated with `transform_url`.

## Use Cases

### The developer needs data validation for a new feature.
A front-end dev can't confirm if an old article still exists under its expected path. They prompt their agent, asking to run `get_item` on the suspected URI. The MCP responds with the content payload or confirms it’s missing, letting them code confidently.

### The content manager needs a full site map for audit purposes.
A marketing manager wants to confirm every section exists in the main navigation. They ask their agent to call `get_navigation_tree`, getting an immediate, comprehensive list of all top-level sections and subpages.

### The DevOps team needs to troubleshoot slow content delivery.
A sysadmin suspects the CMS cache is stale. They instruct their agent to call `get_status` first, then, if needed, execute `clear_cache`, confirming the fix was applied without logging into a dashboard.

### The product team needs to find all related content types.
A PM wants to see every folder under 'Products' and its sub-categories. They ask their agent to use `get_children` repeatedly, mapping out the entire taxonomy structure instantly.

## Benefits

- Instead of opening the Crafter Studio to check metadata, you simply ask your agent to run `get_item` for a specific path, getting immediate data confirmation.
- You can build complex queries without leaving your IDE. Use the `graphql` tool to test schema endpoints directly against your content store.
- Need to understand site scope? Running `get_navigation_tree` instantly maps out every primary section and sub-page relationships.
- Avoid manual cache flushes. If you know a deployment broke something, use `clear_cache` or `rebuild_context` via simple commands instead of jumping through admin panels.
- Don't guess the URL structure. Use `get_breadcrumb` to verify the exact pathing for any piece of content before linking it anywhere.

## How It Works

The bottom line is that your agent handles the connection details, letting you focus on asking questions about your site's content and structure.

1. Subscribe to the CrafterCMS MCP and provide your base URL, Site ID, and necessary access tokens.
2. Tell your agent exactly what content you need—for example, 'Show me all components under the /products folder.'
3. The MCP executes the correct query (like `get_children` or `graphql`) and returns structured data directly to your AI client.

## Frequently Asked Questions

**How do I check if a specific piece of content exists using CrafterCMS MCP?**
You use the `get_item` tool. Provide the full path to the item, and the MCP will return its data payload or an error indicating it's missing.

**Is GraphQL required for all content queries with CrafterCMS MCP?**
No. While `graphql` is best for structured data requests, you can use `search` if you need a general keyword search across the entire content store using OpenSearch JSON.

**What should I do if my site shows outdated information? CrafterCMS MCP?**
First, run `get_status` to see why the data might be stale. If the status is fine but the data is old, execute `clear_cache` or `rebuild_context` via your agent.

**Can I map out all my site folders with CrafterCMS MCP?**
Yes, use `get_navigation_tree`. This tool generates a comprehensive visualization of the entire content hierarchy in one go.