# Statamic MCP

> Statamic MCP Server lets you query your entire CMS content structure through natural language. Use the server to list entries from specific collections, fetch global site settings, inspect navigation menus, or check taxonomy term details without touching the admin dashboard. It reads all of your flat-file and database-driven content directly via conversation.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** statamic, cms-api, flat-file, laravel, content-strategy

## Description

You connect your AI client to this **Statamic MCP Server** and you get full access to every piece of data on your site's backend—no logging into the admin dashboard required. Your agent reads all your flat-file content and database settings using plain language prompts.

When you need to understand how your site is built, start by mapping the structure. Use `get_nav_tree` when you want the full, nested map of your main navigation menu. For content sections, run `get_collection_tree` to see the entire hierarchy of structured entries in a collection.

To pull article data, you've got options. You can use `list_entries` to grab paginated lists of articles from any defined collection; this tool supports filtering by field value or entry status, so you don't get junk data. If you just need everything for one specific piece, run `get_entry`. 

For media management, your agent handles it too. Run `list_assets` to see every file inside a specified asset container or folder. To pull all the specifics on a single image or document, use `get_asset` with its unique ID.

When you're dealing with site-wide configuration, you need global data. First, run `list_globals` to get names of every Global set used across your site. Then, if you know which one you want, use `get_global` to fetch all the variables and settings stored within that specific set.

Want to check out how users are set up? Use `list_users` to pull a roster of every account configured in Statamic. To get detailed profile info or roles for just one person, run `get_user`. 

For forms, you can't miss them either. Run `list_forms` to return a list of every submission form across the site. If you need to inspect the specific fields and structure of one particular form, use `get_form`.

Taxonomy and categorization are handled by two tools. Start with `list_terms` if you want to see all the available categories (or tags) within a specific taxonomy. When you know the exact term's details—like its description or usage count—run `get_term`. 

It wraps up by giving you access to system-level lists: use `list_forms` for every form, and `list_users` for all accounts. Basically, it lets your AI client talk directly to the CMS API so you can pull everything—from individual article fields using `get_entry`, to checking which specific taxonomy term details with `get_term`, or listing multiple items from a collection using `list_entries`. It's clean data, straight conversationally.

***

**To summarize the process:** You ask your agent for something—say, 'Give me all active blog posts in 2023 that mention X.' Your client runs the necessary API calls behind the scenes using `list_entries`, applies the filters and sorting you asked for, and spits out clean JSON data. It’s about direct access to structure: **`get_collection_tree`** maps the content flow; **`get_nav_tree`** maps the site's actual menus; and **`get_global`** pulls all the variable settings that drive the whole thing.**

*Use your AI client to:* 

*   List articles from any collection, supporting advanced filtering and pagination via `list_entries`. 
*   Inspect media assets by listing files (`list_assets`) or retrieving specific data points using `get_asset`. 
*   Map the site's entire structure: use `get_collection_tree` for content sections and `get_nav_tree` for main menus.
*   Check configuration variables across the whole platform with `list_globals` and `get_global`.
*   Query categories: list all available terms using `list_terms`, or get deep details on one term using `get_term`. 

Your agent handles these systems calls so you don't have to touch the admin dashboard. You just talk to it.

## Tools

### get_asset
Retrieves the data for a single media asset by its ID.

### get_collection_tree
Reads the hierarchical structure of content entries within a structured collection.

### get_entry
Gets all specific data points for one single Statamic article entry.

### get_form
Retrieves the details and structure of a single submission form on the site.

### get_global
Fetches all configuration variables stored in a specific global set.

### get_nav_tree
Gets the complete, nested structure of your site's main navigation menu.

### get_term
Retrieves all data for a single taxonomy term (category tag).

### get_user
Gets the profile details and roles assigned to one specific user account.

### list_assets
Lists all media assets contained within a specified folder or container.

### list_entries
Lists multiple articles from any given Statamic content collection, supporting filtering and sorting.

### list_forms
Returns a list of every form available across the entire website.

### list_globals
Lists all the different global set names used in your site's configuration.

### list_terms
Returns a list of every available term within a specified Statamic taxonomy.

### list_users
Retrieves a list of all user accounts configured in the CMS.

## Prompt Examples

**Prompt:** 
```
List the most recent 5 entries from the 'blog' collection.
```

**Response:** 
```
I've retrieved the latest 5 blog entries. The most recent is 'New Features in v5' followed by 'Getting Started with MCP'. Would you like the full content of any of these?
```

**Prompt:** 
```
Show me the navigation structure for the 'footer' menu.
```

**Response:** 
```
The 'footer' navigation tree contains 3 main items: 'Privacy Policy', 'Terms of Service', and 'Contact Us'. Each points to its respective entry ID.
```

**Prompt:** 
```
Get the details for the term 'tutorials' in the 'categories' taxonomy.
```

**Response:** 
```
The term 'tutorials' (slug: tutorials) in the 'categories' taxonomy has been found. It is currently associated with 12 entries in your collections.
```

## Capabilities

### List articles and entries
Retrieves paginated lists of content items from any defined collection, allowing filtering by field or status.

### Map site navigation and collections
Reads the full hierarchical structure of your website's menus and structured content sections for accurate mapping.

### Retrieve global settings
Fetches all variables, configuration data, or settings stored in Statamic Global sets across the site.

### Query taxonomy terms and categories
Lists available terms within a specific category or retrieves detailed metadata for a single term.

### Inspect media assets
Lists all files (images, documents) contained in a specified asset container on the site.

## Use Cases

### Checking site-wide branding variables
The developer needs the primary color hex code used on every page. Instead of navigating through multiple global settings, they ask their agent to use `get_global` for the 'branding' set. The agent returns the exact variable value in seconds.

### Auditing a new content collection
The marketing manager needs to know if the 'product reviews' collection has entries from last quarter. They ask the agent to use `list_entries` on that collection, applying date filters. The list shows exactly which articles need updating.

### Mapping out a complex menu system
The UX designer needs to understand the full relationship between the main footer links. They ask for the navigation structure (`get_nav_tree`). The agent returns the complete, nested tree, allowing the designer to model the site map accurately.

### Finding a specific user's access level
The ops engineer suspects a team member has elevated permissions. They ask the agent to use `get_user` on that person's ID. The agent confirms the exact roles and permissions, solving the security concern without needing admin login.

## Benefits

- Audit content entries and taxonomy terms using `list_entries` and `list_terms`. You can check if all collections have consistent metadata without running manual reports in the CMS panel.
- Understand site architecture immediately. Use `get_nav_tree` to see every menu item nested under your main navigation, or use `get_collection_tree` for structured content flows.
- Verify global configuration settings instantly. Call `get_global` to confirm if a specific variable (like the current marketing year or site favicon URL) is set correctly across the entire site.
- Inspect user permissions and roles by listing users with `list_users`. This helps you quickly see who has editor access versus just viewer status.
- Manage your content workflow through direct querying. Use `get_entry` to fetch a specific article's full data payload—perfect for debugging frontend components.

## How It Works

The bottom line is: you ask a question about your content structure or data, and the server runs the exact API call needed to answer it.

1. First, subscribe to the server and provide your Statamic Base URL and API Token.
2. Second, your AI client sends a natural language request (e.g., "List all users who are editors.").
3. Finally, the agent executes the necessary tool calls (like `list_users`), fetches the structured data from Statamic, and presents it to you.

## Frequently Asked Questions

**How do I use the `list_entries` tool on Statamic?**
`list_entries` lets you pull multiple articles from a specific collection. You need to specify which collection and what parameters (like sorting or filtering) you want for the results.

**What is `get_global` used for in Statamic?**
`get_global` retrieves site-wide configuration variables. It lets you check settings—like a brand color or legal disclaimer text—that apply across multiple parts of the site.

**Can I use `list_terms` to find all my categories?**
Yes, that's what it does. You pass in the taxonomy name, and `list_terms` returns every available category tag used across your collections. It helps audit consistency.

**`get_nav_tree` gives me the site menu structure, right?**
Exactly. This tool maps out the entire hierarchy of your main navigation. You get a structured view that shows every submenu item and its relationship to the parent link.

**What happens when I try to run `get_entry` for an entry that doesn't exist?**
It returns a clear 404 status code. The agent catches this gracefully, letting you know exactly which slug or ID failed the lookup. This makes error handling straightforward in your chat flow.

**How do I use `list_assets` to get an inventory count of all media files?**
`list_assets` pulls a list of assets within a specified container, including metadata like file type and creation date. This lets you quickly audit your entire site's media library without navigating the CMS UI.

**What credentials do I need to run any tool, like `get_user`?**
You must provide a valid Statamic Base URL and an API Token. The token dictates exactly what data your agent can see—it's crucial for maintaining security scope.

**Can I use `list_forms` to check which contact forms are active on the site?**
Yes, `list_forms` retrieves a list of every form defined in your Statamic setup. You get the form slug and its status, helping you confirm if a form is live or needs updating.

**Can I see the hierarchical structure of my site navigation?**
Yes. Use the `get_nav_tree` tool with the handle of your navigation (e.g., 'main'). The agent will return the full nested structure of your menu items.

**How do I fetch specific variables like the site name or social media links?**
You can use `list_globals` to see all available sets, then use `get_global` with the specific handle to retrieve all variables stored within that global set.

**Is it possible to filter entries when listing a collection?**
The `list_entries` tool supports `limit`, `sort`, and `fields` parameters, allowing you to paginate results and choose exactly which data fields the agent should process.