# @content-island/mcp

## Content Island MCP

A Model Context Protocol (MCP) server that enables seamless integration between modern web frameworks and [Content Island](https://contentisland.net/) headless CMS. This server empowers LLMs to scaffold, configure, and build web applications using frameworks like Astro, Next.js, Nuxt, and others while automatically integrating with Content Island's content management capabilities.

### Key Features

- **Modern framework support**. Scaffold projects with Astro, Next.js, Nuxt, SvelteKit, and other popular frameworks.
- **Headless CMS integration**. Seamlessly connect to your Content Island project, retrieve content models, and configure data fetching.
- **Content-driven development**. Generate components, pages, and data fetching logic based on your Content Island schema.
- **Type-safe integration**. Generate TypeScript types from your Content Island content models.
- **Zero-config setup**. Streamlined project initialization with pre-configured build tools and settings.
- **LLM-optimized workflow**. Purpose-built for AI-assisted development with clear, structured commands.
- **Content authoring**. Create content entries and upload media files directly from your LLM.

### Available Tools

| Tool                                | Description                                                                                                         | Token required    |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------- | ----------------- |
| `get-content-island-project`        | Get project details (languages, content types, fields)                                                              | Read **or** Write |
| `list-content-island-contents`      | List content entries with filters, sort and pagination (returns hasMore)                                            | Read **or** Write |
| `create-content-island-content`     | Create a new content entry with fields per language                                                                 | **Write**         |
| `update-content-island-field-value` | Update or insert a field value identified by `(fieldName, language)`                                                | **Write**         |
| `publish-content-island-content`    | Promote a content's current draft to the live state (preflight-gated)                                               | **Write**         |
| `upload-content-island-media`       | Upload a media file from a local path or URL                                                                        | **Write**         |
| `create-content-island-model`       | Create an Entity (content type) with a structured field list                                                        | **Write**         |
| `update-content-island-model`       | Edit an Entity with declarative ops (rename / add / update / remove fields); destructive removals are dry-run-gated | **Write**         |
| `delete-content-island-model`       | Delete an Entity (dry-run by default; `confirm: true` to apply; 409 if referenced)                                  | **Write**         |
| `create-content-island-enum`        | Create an Enum (a closed list of string values)                                                                     | **Write**         |
| `update-content-island-enum`        | Edit an Enum with declarative ops (rename / add / rename / remove values); destructive removals are dry-run-gated   | **Write**         |
| `delete-content-island-enum`        | Delete an Enum (dry-run by default; `confirm: true` to apply; 409 if referenced)                                    | **Write**         |

> **Note**: A **read token** is sufficient for read-only tools. Tools that create or upload data require a **write token**. A write token also works for read-only tools.

### Behavior notes

- The MCP server always reads in **preview mode**, so drafts and unpublished field values are visible. The configured access token is automatically prefixed with `PREVIEW_` before it reaches the API. This keeps reads and writes consistent: the tools `create-content-island-content` and `update-content-island-field-value` write to the working state, and `list-content-island-contents` / `get-content-island-project` read from that same working state.
- `publish-content-island-content` runs a **server-side preflight** before publishing and refuses the call when the content is not valid: every `isRequired` field must have a non-empty value in every project language, and populated values must satisfy their `min-length`, `max-length` and `media-type` validations. `unique` is enforced by the backend. If the preflight fails, the response lists every problem in one pass so the caller can fix them via `update-content-island-field-value` and retry.

### Requirements

- Node.js 18 or newer
- VS Code, Cursor, Windsurf, Claude Desktop or any other MCP client

### Getting started

First, install the Content Island MCP server with your client. A typical configuration looks like this:

```js
{
  "mcpServers": {
    "contentIsland": {
      "command": "npx",
      "args": [
        "@content-island/mcp@latest"
      ],
      "env": {
        "CONTENT_ISLAND_ACCESS_TOKEN": "<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>"
      }
    }
  }
}
```

> **Note**: Replace `<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>` with your actual Content Island project token. You can get it from the [Content Island account](https://docs.contentisland.net/ui/project/general/).

[<img src="https://img.shields.io/badge/VS_Code-VS_Code?style=flat-square&label=Install%20Server&color=0098FF" alt="Install in VS Code">](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522contentIsland%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540content-island%252Fmcp%2540latest%2522%255D%252C%2522env%2522%253A%2520%257B%2522CONTENT_ISLAND_ACCESS_TOKEN%2522%253A%2522%253CYOUR_CONTENT_ISLAND_ACCESS_TOKEN%253E%2522%257D%257D) [<img alt="Install in VS Code Insiders" src="https://img.shields.io/badge/VS_Code_Insiders-VS_Code_Insiders?style=flat-square&label=Install%20Server&color=24bfa5">](https://insiders.vscode.dev/redirect?url=vscode-insiders%3Amcp%2Finstall%3F%257B%2522name%2522%253A%2522contentIsland%2522%252C%2522command%2522%253A%2522npx%2522%252C%2522args%2522%253A%255B%2522%2540content-island%252Fmcp%2540latest%2522%255D%252C%2522env%2522%253A%2520%257B%2522CONTENT_ISLAND_ACCESS_TOKEN%2522%253A%2522%253CYOUR_CONTENT_ISLAND_ACCESS_TOKEN%253E%2522%257D%257D)

<details><summary><b>Install in VS Code</b></summary>

You can also install the Content Island MCP server using the VS Code CLI:

```bash
# For VS Code
code --add-mcp '{"name":"contentIsland","command":"npx","args":["@content-island/mcp@latest"],"env": {"CONTENT_ISLAND_ACCESS_TOKEN":"<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>"}}'
```

> **Note**: Replace `<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>` with your actual Content Island project token. You can get it from the [Content Island account](https://docs.contentisland.net/ui/project/general/).

After installation, the Content Island MCP server will be available for use with your GitHub Copilot agent in VS Code.

</details>

<details>
<summary><b>Install in Cursor</b></summary>

#### Click the button to install:

[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/install-mcp?name=contentIsland&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyJAY29udGVudC1pc2xhbmQvbWNwQGxhdGVzdCJdLCJlbnYiOnsiQ09OVEVOVF9JU0xBTkRfQUNDRVNTX1RPS0VOIjoiPFlPVVJfQ09OVEVOVF9JU0xBTkRfQUNDRVNTX1RPS0VOPiJ9fQ%3D%3D)

#### Or install manually:

Go to `Cursor Settings` -> `MCP` -> `Add new MCP Server`. Name to your liking, use `command` type with the command `npx @content-island/mcp@latest`. You can also verify config or add command like arguments via clicking `Edit`.

```json
{
  "mcpServers": {
    "contentIsland": {
      "command": "npx",
      "args": ["@content-island/mcp@latest"],
      "env": {
        "CONTENT_ISLAND_ACCESS_TOKEN": "<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>"
      }
    }
  }
}
```

> **Note**: Replace `<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>` with your actual Content Island project token. You can get it from the [Content Island account](https://docs.contentisland.net/ui/project/general/).

</details>

<details>
<summary><b>Install in Windsurf</b></summary>

Follow Windsurf MCP [documentation](https://docs.windsurf.com/windsurf/cascade/mcp). Use following configuration:

```json
{
  "mcpServers": {
    "contentIsland": {
      "command": "npx",
      "args": ["@content-island/mcp@latest"],
      "env": {
        "CONTENT_ISLAND_ACCESS_TOKEN": "<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>"
      }
    }
  }
}
```

> **Note**: Replace `<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>` with your actual Content Island project token. You can get it from the [Content Island account](https://docs.contentisland.net/ui/project/general/).

</details>

<details>
<summary><b>Install in Claude Desktop</b></summary>

Follow the MCP install [guide](https://modelcontextprotocol.io/quickstart/user), use following configuration:

```json
{
  "mcpServers": {
    "contentIsland": {
      "command": "npx",
      "args": ["@content-island/mcp@latest"],
      "env": {
        "CONTENT_ISLAND_ACCESS_TOKEN": "<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>"
      }
    }
  }
}
```

> **Note**: Replace `<YOUR_CONTENT_ISLAND_ACCESS_TOKEN>` with your actual Content Island project token. You can get it from the [Content Island account](https://docs.contentisland.net/ui/project/general/).

</details>

### `Environment Variables`

You can configure the MCP server using environment variables. The following variables are available:

| name                             | required | description                                                                                                                                                                                                                                                                                              |
| -------------------------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `CONTENT_ISLAND_ACCESS_TOKEN`    | `true`   | Your project’s access token. A **read token** is sufficient for `get-content-island-project`. A **write token** is required for `create-content-island-content` and `upload-content-island-media`.<br/>You can find this token in the [General tab](https://docs.contentisland.net/ui/project/general/). |
| `CONTENT_ISLAND_DOMAIN`          | `false`  | Domain used for requests. Useful if you're using Content Island `On Premise`.<br/>Default: `api.contentisland.net`                                                                                                                                                                                       |
| `CONTENT_ISLAND_SECURE_PROTOCOL` | `false`  | Whether to use HTTPS for requests.<br/>Default: `true` (use HTTPS)                                                                                                                                                                                                                                       |
| `CONTENT_ISLAND_API_VERSION`     | `false`  | Version of the [REST API](https://docs.contentisland.net/rest-api/v1/overview/).<br/>Default: `1.0`                                                                                                                                                                                                      |
