# Cosmic MCP for AI Agents MCP

> Cosmic gives your AI agents full control over your headless CMS and digital content workflows. You can use natural conversation to list, create, update, and audit every object type, media asset, and schema in your Cosmic bucket without ever touching the web interface. It’s total programmatic control for developers and content teams managing complex data structures.

## Overview
- **Category:** developer-tools
- **Price:** Free
- **Tags:** api-first, content-modeling, digital-assets, schema-management, json-api, web-development

## Description

Managing a modern website often means juggling multiple platforms: a CMS for content, an asset manager for photos, and a separate database for structured metadata. This MCP connects all of that into one conversation layer. Instead of logging into the Cosmic web app to check if a certain field exists or manually running API calls just to patch a title block, your AI agent handles it all through simple chat commands. You can ask your agent to list every active object type, verify what fields they require, and even clear out old media assets when you need to manage storage quotas.

This means content creation becomes purely conversational. Your agent doesn't just read data; it writes it back. Need to spin up a new article draft? Just ask. Want to update the date on an event listing and change its main image? Give the command, and the agent handles the necessary patching behind the scenes. By connecting this MCP via Vinkius, you give your AI client direct, safe access to the entire digital content lifecycle, making developers and editors work in one unified chat session.

## Tools

### create_cms_object
Generates and provisions entirely new draft CMS objects based on provided JSON payload data.

### wipe_media_asset
Runs a validation check that permanently deletes specified media assets from the system.

### wipe_cms_object
Permanently removes entire CMS object nodes, dropping live content records.

### get_media_asset
Retrieves the detailed structural data for a specific media ID.

### get_single_object
Fetches all cloud logging traces and details for a single specified content payload ID.

### get_schema_details
Performs a structural analysis to retrieve properties that drive the active data fields within an object type.

### list_uploaded_media
Inspects internal arrays, providing metadata and details for specific picture assets.

### list_schema_types
Enumerates all structured rules attached to the system, showing every active object type available.

### list_bucket_objects
Identifies and lists all bounded routing spaces within your headless CMS environments.

### patch_cms_object
Modifies existing content objects by replacing draft values for specific fields using a unique ID.

## Prompt Examples

**Prompt:** 
```
List all available content models for me.
```

**Response:** 
```
*Content Model List*

* **posts**: Primary type for blog articles.
* **products**: Structured data for e-commerce listings.
* **events**: Used for scheduling and announcements.

I found 3 main types. Which one should I check the schema details for?
```

**Prompt:** 
```
What fields does the 'product' type require?
```

**Response:** 
```
**Product Schema Details:**

This object requires the following properties:
* `name`: Text (required)
* `price`: Number (must be > 0)
* `description`: HTML (max 5k chars)
* `image`: File reference (mandatory for listing)
```

**Prompt:** 
```
Create a new event object: Name 'Q3 Review', Date '2024-10-01'
```

**Response:** 
```
**Object Creation Successful.**

The new draft has been added to your `event` type.
* **Title:** Q3 Review
* **Status:** Draft
* **Date Mapped:** 2024-10-01
* **New Object ID:** abc_987
```

## Capabilities

### Create new content objects
Generate completely new draft CMS objects with formatted JSON payloads.

### Update existing content drafts
Patch specific object metadata, like titles or dates, on live content records without overwriting the whole thing.

### Inspect and define schemas
List all active object types and retrieve a structural breakdown of which fields they require.

### Manage media assets
Retrieve detailed information about specific images or list all uploaded media to track asset metadata.

### Clean up content data
Irreversibly delete entire object nodes or wipe specified media assets to clear storage space.

### View bucket contents
Get a list of all major routing spaces (content models) available within your environment.

## Use Cases

### Checking if a new field exists before coding
A developer needs to know what metadata fields are required for their 'product' type. Instead of guessing or running slow documentation lookups, they ask the agent to perform structural extraction via `get_schema_details`. The agent responds instantly with all necessary properties.

### Updating a batch of expired event listings
A marketing manager needs to change the status and update the featured image for 10 old 'event' objects. They ask the agent to patch those records using `patch_cms_object` with the new data, saving hours of manual API calls.

### Finding all available content models
A product team is setting up a new microsite and needs to know what content types already exist. They ask the agent to list all available routing spaces using `list_bucket_objects`, giving them an immediate map of possibilities.

### Cleaning up abandoned media files
A developer detects old, unused images taking up space. They instruct the agent to inspect deep internal arrays and wipe those specific image assets using `wipe_media_asset` for storage quota management.

## Benefits

- Instead of writing multi-step API scripts, you can tell your agent to list object types using `list_schema_types` and get the full schema details in one go.
- Content updates are simple. Use `patch_cms_object` to modify a title or date on an existing draft without risking data loss from replacing the entire record.
- When you need to audit content, your agent can check both object metadata using `get_single_object` and verify media assets with `list_uploaded_media`—all conversationally.
- Need to clear out old junk? You can irreversibly delete nodes via `wipe_cms_object` or wipe specific images using `wipe_media_asset`, keeping your database clean.
- Getting started is easy. You simply connect the MCP, and the agent immediately knows how to find all content models available by executing `list_bucket_objects`.

## How It Works

The bottom line is you manage complex digital content workflows by talking to your AI client, not by logging into an application UI.

1. Subscribe to the Cosmic MCP and provide your specific Cosmic Bucket Slug along with an API Write Key.
2. Your AI client connects using those credentials, establishing a secure link to your content data structure.
3. You talk to your agent naturally—asking it to list object types or patch a title—and the agent executes the action directly against your CMS.

## Frequently Asked Questions

**How can I use the Cosmic MCP to update content objects?**
You can patch existing content by telling your agent which object needs changing and what new metadata it should have. This is much safer than trying to rewrite or overwrite the entire record manually.

**Does this MCP help me figure out my CMS structure?**
Yes, you can ask the agent to list all object types and retrieve structural details for any type. This tells you exactly what fields your content model supports before you write a single line of code.

**Can I use Cosmic MCP to clean up old media files?**
Absolutely. You can tell the agent to inspect internal media arrays and wipe out specific image assets that are no longer needed, helping you manage storage quotas without risk.

**Is this better than using a dedicated API client?**
For conversational workflows, yes. While an API client requires writing code for every step, this MCP lets you accomplish complex tasks—like listing types and then patching objects—using natural conversation.

**Does Cosmic MCP support creating new content drafts?**
Yes, the agent can provision brand-new draft CMS objects. You just provide the structured data payload, and it handles the creation process for you.