# Cosmic [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/cosmicjs/mcp  
**GitHub Stars:** 1  
**npm Downloads (last month):** 623  
**Views:** 2  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/cosmic

## Description
Manage Cosmic CMS content, media, object types, and AI generation from any MCP client.

## Tools
Capabilities this server exposes over MCP:

- **cosmic_objects_list** — List objects from the Cosmic bucket with optional filters for type, status, and pagination. Returns an array of objects with their metadata.
- **cosmic_objects_get** — Get a single object by ID or by slug+type. Returns the full object with all metadata.
- **cosmic_objects_create** — Create a new object in the Cosmic bucket. Requires write access.
- **cosmic_objects_update** — Update an existing object by ID. Only provided fields will be updated. Requires write access.
- **cosmic_objects_delete** — Delete an object by ID. This action is permanent. Requires write access.
- **cosmic_media_list** — List media files from the Cosmic bucket with optional folder filter and pagination.
- **cosmic_media_get** — Get details of a single media file by ID. Returns the full media object with URL and metadata.
- **cosmic_media_upload** — Upload a media file to the Cosmic bucket from a URL or base64-encoded data. Requires write access.
- **cosmic_media_delete** — Delete a media file by ID. This action is permanent. Requires write access.
- **cosmic_types_list** — List all object types in the Cosmic bucket. Returns the schema definitions including metafields for each type.
- **cosmic_types_get** — Get a single object type by slug. Returns the full schema including all metafield definitions.
- **cosmic_types_create** — Create a new object type with a custom schema. Define metafields to structure your content. Requires write access.
- **cosmic_types_update** — Update an existing object type schema. Can modify title, metafields, and options. Requires write access.
- **cosmic_types_delete** — Delete an object type by slug. WARNING: This will also delete all objects of this type. Requires write access.
- **cosmic_ai_generate_text** — Generate text content using Cosmic AI. Useful for creating content, descriptions, summaries, and more.
- **cosmic_ai_generate_image** — Generate an image using Cosmic AI and automatically upload it to your media library. Use format "svg" for logos, icons, illustrations, and vector artwork. For PNG display media.imgix_url; for SVG display media.url (imgix does not serve SVG). Requires write access.
- **cosmic_ai_generate_video** — Generate a video using Cosmic AI (powered by Veo) and automatically upload it to your media library. Requires write access.
- **cosmic_ai_generate_audio** — Generate audio from text using OpenAI text-to-speech and upload it to your media library. Supports 13 natural-sounding voices. Requires write access.
- **cosmic_blocks_list** — List the reusable rich-text Content Blocks defined in the Cosmic bucket. Blocks are referenced inside rich-text metafields with a {{name /}} token. Use this to discover which block shortcodes exist before writing rich-text content that references them. Returns each block's name (shortcode), title, description, editor type, and content.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "cosmic": {
    "command": "npx",
    "args": ["-y","@cosmicjs/mcp"],
    "env": {
      "COSMIC_BUCKET_SLUG": "",
      "COSMIC_READ_KEY": "",
      "COSMIC_WRITE_KEY": ""
    }
  }
}
```

**Requires environment variables:** `COSMIC_BUCKET_SLUG`, `COSMIC_READ_KEY`, `COSMIC_WRITE_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Cosmic MCP server does

Cosmic MCP server exposes a Cosmic bucket through Model Context Protocol tools. Agents can inspect, create, edit, and remove content objects; browse and manage media; and read or modify object-type schemas. It also lists reusable rich-text Content Blocks, represented by tokens such as `{{name /}}`.

The server includes Cosmic AI operations for generating text, producing an image or SVG and storing it in the media library, and producing and uploading a video. These capabilities make it suitable for agent workflows that combine structured CMS updates with content production.

## How it works

The hosted service uses streamable HTTP. Its endpoint is scoped to a bucket slug:

```text
https://mcp.cosmicjs.com/v1/buckets/{bucket-slug}
```

Authentication uses the bucket's read key, with the optional write key appended to the bearer value for full access:

```text
Authorization: Bearer <read_key>
Authorization: Bearer <read_key>:<write_key>
```

Clients that cannot send the combined bearer value can provide the write key in the `X-Cosmic-Write-Key` header. Read-only access covers list and get operations. Creating, updating, or deleting content and schemas, uploading or deleting media, and generating uploaded images or videos require write access.

For environments that do not use remote MCP connections, the package provides a local stdio mode. The hosted and local modes expose the same server capabilities.

## Setup and configuration

The hosted endpoint requires no local installation. Add the bucket URL to an MCP client and provide the appropriate bearer token. Cosmic documents remote setup for Claude Desktop and Cursor.

For local stdio use, run the package with `npx @cosmicjs/mcp`, install it globally with `npm install -g @cosmicjs/mcp`, or build it from source with Bun. Configure the process with:

- `COSMIC_BUCKET_SLUG`: the target Cosmic bucket
- `COSMIC_READ_KEY`: the key used for read operations
- `COSMIC_WRITE_KEY`: the optional key needed for write operations

Keys and the bucket slug are available from the bucket's **Settings → API Access** area in the Cosmic dashboard. Local Claude Desktop and Cursor configurations start the package with `npx` and pass these values as environment variables.

## Tools and capabilities

Object tools support filtered and paginated listing, lookup by ID or slug, and full create, update, and delete operations. Listings can filter by object type and status.

Media tools list files, optionally by folder, retrieve file details, upload from a URL or base64 data, and delete files.

Object-type tools list schemas, retrieve a schema by slug, and create, update, or delete object types with their custom metafields. The Content Blocks tool lists reusable rich-text blocks available in the bucket.

AI tools generate text, generate and upload images or SVGs, and generate and upload videos. Write access is required for the generation operations that store media.

## Limitations and notes

Access is scoped to a Cosmic bucket and depends on its API credentials. A read key is sufficient for inspection but cannot perform mutations or write-enabled generation tasks. Operations that change content, schemas, or media should use a write key and therefore grant broader access than read-only configurations.

_Full upstream README: https://allmcps.com/mcp/cosmic/readme_

