# Agents & MCP

Connect Claude, ChatGPT, Cursor, Codex or Claude Code to CleanScript, or let a coding agent build it into your project.

## The MCP server

Add `https://api.cleanscript.ai/mcp` to any client that supports remote MCP servers (streamable HTTP). You sign in to CleanScript once and approve the connection; clients that can't sign in send an API key instead, as `Authorization: Bearer <key>`. The [Agents page](https://cleanscript.ai/connect) sets up each client in one step.

| Tool | What it does | Credits |
| --- | --- | --- |
| `get_transcript` | The transcript as paragraphs under their section titles, each with its `[m:ss]` time. Long videos come in pages: pass `next_start` as `start`. | Same as `/v1/transcript` |
| `extract` | Fields from a `prompt`, a `preset` or a `schema`, with quotes. | Same as `/v1/extract` |
| `list_posts` | A creator's recent posts (`author`, `platform`, `limit`, `since`). | 1 credit |
| `check_account` | Checks the connection and the credits left. | Free |

Results come back in the tool reply, sized for a model's context. Calling `get_transcript` or `extract` again for the same thing within 6 hours is free (`list_posts`: within 10 minutes), and a call that fails is never charged.

## Set up your client

**Claude** (web and desktop): open Settings, then Connectors, add a custom connector with the URL above, and sign in.

**ChatGPT**: turn on developer mode, add a connector with the URL above, and sign in.

**Claude Code**:

```bash
claude mcp add --transport http cleanscript https://api.cleanscript.ai/mcp
```

Then run `/mcp` in Claude Code and sign in. To use an API key instead, add `--header "Authorization: Bearer $CLEANSCRIPT_API_KEY"`.

**Codex**:

```bash
codex mcp add cleanscript --url https://api.cleanscript.ai/mcp
codex mcp login cleanscript
```

**Cursor**, in `.cursor/mcp.json` (or `~/.cursor/mcp.json` for every project):

```json .cursor/mcp.json
{
  "mcpServers": {
    "cleanscript": { "url": "https://api.cleanscript.ai/mcp" }
  }
}
```

**VS Code**, in `.vscode/mcp.json`:

```json .vscode/mcp.json
{
  "servers": {
    "cleanscript": { "type": "http", "url": "https://api.cleanscript.ai/mcp" }
  }
}
```

## Build it into a project

To have a coding agent add CleanScript to your code, give it the skill. For Claude Code:

```bash
mkdir -p .claude/skills/cleanscript
curl -so .claude/skills/cleanscript/SKILL.md https://cleanscript.ai/SKILL.md
```

Or paste this prompt into any coding agent:

```text Prompt
Add CleanScript to this project so I can get transcripts and fields from YouTube, TikTok and Instagram links. Read https://cleanscript.ai/SKILL.md first. The API is https://api.cleanscript.ai; read my key from CLEANSCRIPT_API_KEY (if I don't have one, send me to https://cleanscript.ai/dashboard/api-keys). Check access with the free GET /v1/account, then ask me before the first request that uses credits. Tell me what you built and how to run it.
```

## Docs for agents

- [`/llms.txt`](https://cleanscript.ai/llms.txt): the base URL, auth, two calls and an index of these pages.
- [`/llms-full.txt`](https://cleanscript.ai/llms-full.txt): every page in one file, about 40 KB.
- Every page as Markdown: add `.md` to its address ([`/docs/quickstart.md`](https://cleanscript.ai/docs/quickstart.md)), or request it with `Accept: text/markdown`.
- [`/SKILL.md`](https://cleanscript.ai/SKILL.md): the skill for coding agents.
- [`/openapi.json`](https://cleanscript.ai/openapi.json): the OpenAPI 3.1 description, with examples.
- [`/integration.json`](https://cleanscript.ai/integration.json): routes, presets, credits and links as one JSON object.
