# MCP

> Only available on hosted Pages CMS.

The hosted MCP server lets AI assistants such as Claude, ChatGPT or Cursor work with your content: find entries, draft and update posts, upload images and run actions. It uses your Pages CMS permissions, and every change is a commit like any other.

## Connect

1. In your MCP client, add a remote server with the URL `https://app.pagescms.org/mcp`.
2. Sign in to Pages CMS when prompted and review the permissions it asks for.
3. Choose the repositories the assistant needs. Start with read access for discovery and review. Grant write or action permissions when the task requires them. Repository files can contain instructions written by other contributors.

Your client must support the Streamable HTTP transport; the older HTTP+SSE transport isn't supported. Clients that can't do OAuth can send a [personal access token](/docs/api/#connect) as a bearer token instead.

Disconnect a client under **Account → Connected applications**.

| Client                     | Add the server                                                                                                                                          |
| -------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Claude Code                | `claude mcp add --transport http pagescms https://app.pagescms.org/mcp`                                                                                 |
| Codex                      | `codex mcp add pagescms --url https://app.pagescms.org/mcp`                                                                                             |
| Cursor                     | [Add to Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=pagescms&config=eyJ1cmwiOiJodHRwczovL2FwcC5wYWdlc2Ntcy5vcmcvbWNwIn0=)               |
| VS Code                    | [Install in VS Code](vscode:mcp/install?%7B%22name%22%3A%22pagescms%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A//app.pagescms.org/mcp%22%7D) |
| Claude, ChatGPT and others | Add a custom connector with the URL `https://app.pagescms.org/mcp`.                                                                                     |

## What to ask

Start by having the assistant discover your project. For example: "List my Pages CMS repositories, then show me the content model for the main branch." From there it can work like an editor: "Draft a post announcing our new pricing in the blog collection", or "Find posts without a cover image".

## Tools

| Tool                   | Does                                                               | Scope         |
| ---------------------- | ------------------------------------------------------------------ | ------------- |
| `repositories_search`  | Find up to five CMS projects by name or exact `owner/name`         | `read`        |
| `branches_list`        | List a repository's branches                                       | `read`        |
| `model_read`           | Read the collections, files, media, actions and fields on a branch | `read`        |
| `usage_read`           | Show this month's API and MCP usage                                | `read`        |
| `entries_list`         | List a collection’s entries, optionally by `locale`                | `read`        |
| `entries_translations` | Look up existing and missing translations of a collection entry    | `read`        |
| `entries_read`         | Read an entry                                                      | `read`        |
| `entries_create`       | Create an entry                                                    | `write`       |
| `entries_update`       | Update an entry                                                    | `write`       |
| `entries_delete`       | Delete an entry                                                    | `write`       |
| `entries_rename`       | Move or rename an entry                                            | `write`       |
| `files_read`           | Read a single file                                                 | `read`        |
| `files_update`         | Update or create a single file                                     | `write`       |
| `media_list`           | List a media library                                               | `read`        |
| `media_read`           | Get a temporary download URL                                       | `read`        |
| `media_upload`         | Upload a file, up to 4 MiB                                         | `write`       |
| `media_delete`         | Delete a file                                                      | `write`       |
| `actions_list`         | List actions and recent runs                                       | `read`        |
| `actions_status`       | Check runs by ID                                                   | `read`        |
| `actions_run`          | Run an action                                                      | `actions:run` |

To find French posts, call `entries_list` with `locale: "fr"`. Omitting the locale uses the collection default. For collections that store one file per language, pass a returned entry path to `entries_translations`. Each item gives the locale, exact path, whether the file exists, and its revision. When translations share fields in a single file, use `entries_read` to see those fields.

Skip repository search when the ID is already known.

Each tool publishes its input schema to the client. Every tool except `repositories_search` takes a `repository` ID, and every tool except `repositories_search` and `branches_list` also takes a `branch`. Writes require an `idempotencyKey`, and changes to existing content require the `revision` from a previous read:

```json
{
  "repository": "123",
  "branch": "main",
  "collection": "posts",
  "path": "content/posts/hello.md",
  "revision": "0123456789abcdef0123456789abcdef01234567",
  "content": { "title": "Hello" },
  "idempotencyKey": "update-hello-1"
}
```

## Same rules as the API

MCP is a different interface to the same operations as the [REST API](/docs/api/). It shares the API's:

- [permissions and repository controls](/docs/api/#permissions-and-controls);
- [monthly usage allowance](/docs/api/#usage-limits), counted together with REST calls;
- [write, idempotency and retry rules](/docs/api/#writing-content);
- [error codes](/docs/api/#errors), returned as tool results with `isError: true`.

For OAuth discovery, the protected resource metadata is at `/.well-known/oauth-protected-resource/mcp`.
