# Connect to Creght over MCP | Creght

> Set up the Creght MCP server at https://creght.com/api/mcp or https://creght.cn/api/mcp: Claude Code, Cursor and Claude configuration, site:read / site:write authorization, the site, CMS, form and asset tools, and common errors.

Overview

- [Creght API for AI](/api.md)
- [Connect to Creght over MCP](/api/mcp-server.md)

Discoverability

- [How to optimize llms.txt](/api/optimize-llms-txt.md)

Site configuration

- [Configure talizen.config.ts](/api/talizen-config.md)
- [Implement domain-based locale routing](/api/domain-locale-routing.md)

Backend

- [Calling external APIs on the server and managing the cache](/api/ssr-external-api-cache.md)
- [Build site backend workflows with Func](/api/func-backend.md)
- [JSON tables: definition, reads, and queries](/api/func-json-tables.md)
- [Uploads: signed direct upload and Func-generated files](/api/func-assets-upload.md)
- [Timeouts and streaming responses](/api/func-timeout-streaming.md)
- [Integrate Alipay PC Web Payment with Func](/api/func-alipay-payment.md)
- [Form submission webhooks: real-time delivery and signatures](/api/form-webhook.md)

Integrations

- [Send Email and Verification Codes with Integrations](/api/func-email-integration.md)
- [Take Alipay payments with an integration](/api/func-alipay-integration.md)
- [Take Stripe payments with an integration](/api/func-stripe-integration.md)
- [Call OpenAI models with an integration](/api/func-ai-integration.md)
- [Add text to speech with an integration](/api/func-tts-integration.md)

Auth

- [Require a Verified Email to Sign Up](/api/auth-verified-registration.md)
- [Reset and Change Passwords](/api/auth-password-reset.md)
- [Sign In From a Func](/api/auth-func-login.md)
- [Query users from a Func](/api/func-user-directory.md)

On this page

- [Endpoint](#endpoint)
- [Connect a client](#connect)
- [Claude Code](#claude-code)
- [Cursor and other JSON-configured clients](#cursor)
- [Claude on the web and desktop](#claude-ai)
- [Authorization and permissions](#auth)
- [Tools](#tools)
- [Sites](#tools-site)
- [CMS](#tools-cms)
- [Forms](#tools-form)
- [Assets](#tools-asset)
- [A typical flow](#workflow)
- [Limits](#limits)
- [Troubleshooting](#debug)

Overview/Connect to Creght over MCP

# Connect to Creght over MCP

Let Claude, Cursor and other AI assistants act on Creght with your account: the endpoint, how to connect each client, OAuth and permissions, every MCP tool's parameters and results, and limits such as CMS writes going live immediately and 20 MB per upload.

Copy Markdown link

Creght runs an MCP server. Once an AI assistant (Claude, Cursor and others) is connected, it can use your account to list sites, check publish status and visit analytics, read and write CMS content, read form submissions, upload assets and publish sites. Authorization is OAuth in the browser; there is no key to copy.

**Scope**

The endpoint, how to connect each client, authorization and permissions, every tool's parameters and results, and the limits you will hit if you skip them. Pulling, editing and pushing site code is not part of MCP; keep using the creght CLI for that.

For a user-facing setup guide without the tool details, see [Connect Creght to your AI assistant](/docs/ai/connect-mcp.md).

## Endpoint

| Your account is on | MCP URL |
| --- | --- |
| creght.com | `https://creght.com/api/mcp` |
| creght.cn | `https://creght.cn/api/mcp` |

- The path is `/api/mcp`, **not** `/mcp`. `https://creght.com/mcp` returns the editor page, and the client reports an invalid MCP response.
- Accounts and data on the two sites are separate: an account registered on creght.com only works with the creght.com URL.
- The transport is Streamable HTTP (stateless, one request per call). The legacy SSE transport is not supported.

## Connect a client

The examples use creght.com; swap in the creght.cn URL if that is where your account is.

### Claude Code

```
claude mcp add --transport http creght https://creght.com/api/mcp
```

Then run `/mcp` in Claude Code and pick creght to authorize.

### Cursor and other JSON-configured clients

Add this to `~/.cursor/mcp.json` (or `.cursor/mcp.json` in a project):

```
{
  "mcpServers": {
    "creght": { "url": "https://creght.com/api/mcp" }
  }
}
```

Any client that supports remote MCP with OAuth takes the same URL. There is no client id, secret or token to fill in.

### Claude on the web and desktop

Settings → Connectors → Add custom connector. Set the URL to `https://creght.com/api/mcp` and leave the OAuth fields under advanced settings empty.

## Authorization and permissions

The first call gets a 401, and the client opens your browser: sign in to Creght, approve on the consent page, and you are sent back to the client. The client handles the whole exchange; you only click Allow.

- **The app name on the consent page is whatever the client reports, and it is marked unverified.** The page also shows the callback address. Don't approve if that address isn't the client you are using (for example local `127.0.0.1`, or `claude.ai`).
- There are two scopes: `site:read` (every read tool) and `site:write` (writing CMS content, uploading assets, publishing, managing webhooks). A client that requests no scope gets `site:read` only, and write tools then fail with a permission error.
- The grant never exceeds your account: you see your own projects and projects you were invited to, with the same read/write rights as your role in each project.
- Access tokens last 1 hour and the client renews them with a refresh token. The refresh token lasts 30 days and the clock restarts every time it is used, so a client you use regularly doesn't need to be re-authorized.

## Tools

Every tool takes a `project_id` (site tools also take a `site_id`); get them from `list_sites` first.

### Sites

| Tool | Scope | Parameters | Returns / notes |
| --- | --- | --- | --- |
| `list_sites` | read | none | `sites[]`: project\_id, project\_name, site\_id, site\_name |
| `site_status` | read | `project_id`, `site_id` | Whether it is published, the live version, `live_url` (custom domain first; empty if never published), `preview_url`, and `has_changes` (whether the workspace differs from the live version) |
| `site_publish` | write | `project_id`, `site_id`, `note` (optional, kept in version history) | Publishes what the preview shows, same as `creght publish`. Errors if nothing changed. Returns the new status plus version\_id and version\_no |
| `visit_stats` | read | `project_id`, `site_id`, `start_at` / `end_at` (Unix seconds, optional), `limit` (top N per dimension, default 20) | `summary` (pv / uv / ip), `trend` (by UTC date), `breakdowns` (country, city, device, browser, OS, referrer host, channel, page). Defaults to the last 30 days; a start beyond your plan's range is narrowed, so trust the returned `start_at` |

### CMS

| Tool | Scope | Parameters | Returns / notes |
| --- | --- | --- | --- |
| `cms_collections` | read | `project_id` | `collections[]`: id, key, name, desc |
| `cms_collection` | read | `project_id`, `collection` (key or id) | The collection and its field definitions `fields` (JSON Schema). Read it before writing content |
| `cms_content_list` | read | `project_id`, `collection`, `limit` (default 20, max 100), `offset`, `status` ( `online` / `offline`), `search` | `total`, `has_more`, `list[]`: id, slug, status, body, created\_at, updated\_at |
| `cms_content_create` | write | `project_id`, `collection`, `slug` (unique in the collection), `body` | The new entry's id. **Live as soon as it is created** |
| `cms_content_update` | write | `project_id`, `collection`, `id`, `slug` (optional), `body` (optional) | `body` is merged into the existing entry; fields you don't send stay as they are. `updated: false` means the values were already the same. **Changes go live immediately** |

### Forms

| Tool | Scope | Parameters | Returns / notes |
| --- | --- | --- | --- |
| `form_list` | read | `project_id` | `forms[]`: id, key, name, desc, fields, submissions\_total |
| `form_submissions` | read | `project_id`, `form_id` (optional, id or key), `since` (RFC3339, optional), `cursor`, `limit` (default 50, max 200) | Returned in submission order with a `next_cursor`. For incremental sync, pass the last `next_cursor` back; nothing is repeated or skipped. The submitter's IP is not returned, only the country code resolved from it |
| `form_webhook_create` / `list` / `delete` / `test` | `list` read, the rest write | Push every submission to your https URL in real time; see [Form submission webhooks](/api/form-webhook.md) |

### Assets

| Tool | Scope | Parameters | Returns / notes |
| --- | --- | --- | --- |
| `asset_upload` | write | `project_id`, `site_id`, `filename` (with extension), `content_base64` (a `data:` URL also works), `content_type` (optional) | A public `url` you can use directly in pages and CMS content. Same as `creght upload`; uploading the same file again reuses it. **20 MB per file** (before base64) |

## A typical flow

Publishing a blog post:

1. `list_sites` to find the site's `project_id` and `site_id`.
2. `cms_collections` to find the blog collection, then `cms_collection` for its fields.
3. If there is a cover image, `asset_upload` it first and put the returned `url` in the right field.
4. `cms_content_create`. The post is now on the live list and detail pages; you do **not** need `site_publish`.

Use `site_publish` only after site code has changed: it publishes the page code and configuration in the workspace (what the preview URL shows). CMS content doesn't go through it.

## Limits

- **There are no CMS drafts.** `cms_content_create` and `cms_content_update` both go live directly. If someone needs to review first, draft locally and call the tool after they approve.
- **`site_publish` takes effect for every visitor at once.** Have someone check the `preview_url` before calling it.
- The keys and types in `body` must match the `fields` returned by `cms_collection`.
- There are no tools to delete CMS entries, change a collection's structure or edit site code. Use the editor or the creght CLI.
- `asset_upload` carries the whole file in one call and rejects anything over 20 MB. Use `creght upload` for larger files.

## Troubleshooting

| Symptom | Cause |
| --- | --- |
| The client says the response isn't JSON or isn't a valid MCP response | The URL ends in `/mcp`; change it to `/api/mcp` |
| You can't sign in on the consent page, or it says the account doesn't exist | Wrong site: a creght.com account connected to the creght.cn URL (or the other way round). Fix the URL, then remove the server and add it again |
| Read tools work, write tools fail with a permission error | The client only requested `site:read`, or your role in that project is read-only |
| A site is missing | The project isn't yours and you weren't invited to it. `list_sites` is everything you can act on |
| `site_publish` says there are no changes | The workspace matches the live version; when `site_status` shows `has_changes` false, there is nothing to publish |
| `asset_upload` says the request is too large | The file is over 20 MB; use `creght upload` |

> Full page index: [/llms.txt](/llms.txt)
