# ScriptGrain MCP server

Wire ScriptGrain into Claude (or any MCP client) so your assistant can build voice profiles, draft in your measured voice, and score drafts, directly in conversation.

- Endpoint: `https://mcp.scriptgrain.com/mcp` (streamable HTTP, JSON responses; legacy SSE at `/sse`)
- Auth: sign in with your ScriptGrain account on the OAuth consent page (the connector mints its own API key, which you can revoke in Settings -> API), or send a key you minted yourself as `Authorization: Bearer sg_live_...`
- Available on every plan, including Free
- Client configs and worked examples: https://github.com/StovBuilds/scriptgrain-mcp (a public guide; it holds no ScriptGrain code)

## Connect

Claude Code:

```bash
claude mcp add scriptgrain https://mcp.scriptgrain.com/mcp \
  --transport http --header "Authorization: Bearer sg_live_<your-secret>"
```

claude.ai (web and desktop): Settings -> Connectors -> Add custom connector -> paste `https://mcp.scriptgrain.com/mcp`. The OAuth consent page signs you in with your ScriptGrain email and password (or takes a pasted API key if you signed up with Google); after that the connector just works.

Meta Muse: ask Muse to build a custom integration and give it the MCP endpoint, for example "Build a custom integration to ScriptGrain. Its MCP server URL is https://mcp.scriptgrain.com/mcp". Muse will ask for credentials: mint an API key at Settings -> API and enter it in Muse's secure credential store when prompted (Muse sends it as the `Authorization: Bearer` header; the key never reaches the conversation). Muse is available in the US, and a ScriptGrain account created from the US is quoted in dollars. Once ScriptGrain is listed in the Muse connector directory, connecting is a sign-in on the consent page instead.

Other MCP clients: add a custom connector with the same URL. Both the OAuth flow and a plain `Authorization: Bearer` header are supported. Every POST is answered as plain JSON (never as an event stream), so clients and proxies that only handle request-response work as well; send the `Mcp-Session-Id` header from the initialize response on every later call.

## Tools

The connector is how ScriptGrain makes ChatGPT, Claude, Muse and any MCP client better at being you: the assistant keeps doing what it does, and it writes from your measured voice with a score on every draft. The server has 41 tools.

Free: `list_profiles`, `get_profile`, `create_outline`, `check_voice_match`, `compare_voice`, `ai_detect`, `list_generations`, `get_generation`, `get_job`, `save_edit`, `get_billing`, `get_invoice`, `upgrade_plan`, company context: `list_companies`, `create_company` (importing from a website needs a paid plan), the Voice Brain memory: `get_memory`, `sync_memory`, `check_novelty`, `what_next`, `add_to_memory`, `set_repeat_policy`, shared brains and memory edits: `list_brains`, `set_voice_brain`, `edit_memory`, `delete_memory`, `forget_piece`, draft versions: `list_draft_versions`, `restore_draft_version`, brief templates: `list_brief_templates`, `save_brief_template`, `delete_brief_template` (and `template_id` on `create_outline` and `generate_content`), and the voice monitor on paid plans: `get_voice_monitor`, `add_monitor_url`, `remove_monitor_url`, `run_voice_monitor`.

Credit-consuming: `create_profile` (one extraction slot), `generate_content` (credits by length, per variant: up to 5,000 words 1 credit, up to 10,000 words 2, up to 15,000 words 3), `polish` and `humanize` (the same tiers on the words processed, free skip when the text already passes), `mimic_brand` (1 brand-mimic credit, consent required), `rewrite_page` (1 credit per 1,500 words of page copy, paid plans).

## Long drafts

Drafts go up to 15,000 words (long-form articles, short stories and website pages; newsletters up to 5,000; short formats keep their short ranges). Several variants are available up to 4,000 words.

A draft over 4,000 words, or a polish or humanise over 3,000 words, is written in the background, section by section, because MCP clients wait on one tool call:

- `generate_content` returns at once with status `generating`, the generation id and a job; `polish` and `humanize` return with status `processing` and a job.
- The assistant then calls `get_job` (or `get_generation`, whose content fills in as sections land) until the job has succeeded. Writing takes about a minute per 2,000 words.
- Credits are charged as the words are delivered, never above the tier asked for. A job cancelled through the API (`POST /v1/jobs/{id}/cancel`) is charged by what was delivered, and the delivered text is kept.
- `humanize` also takes a `generation_id`, so a long draft does not have to travel back through the conversation.

Two prompts ship with the server: `write_in_my_voice` (draft, score, iterate, save) and `build_my_voice_profile` (gather samples, extract, walk through the result).

## No account yet: `/try`

`https://mcp.scriptgrain.com/try` needs no key and no sign-in. Its six tools let an assistant measure someone's voice before they have an account: `start_session` (returns a `guest_token` and a `claim_url`), `create_profile` (one profile, at most 25,000 words, from the person's own writing), `get_profile`, `check_voice_match`, `compare_voice` (5 free checks an hour per network) and `claim_status`. Every tool but `start_session` takes the `guest_token`. The person keeps the profile in a free account, or deletes it, at `claim_url`; an unclaimed session is archived after 7 days and the link still works.

## Access requirements

- A ScriptGrain account (free to create). Every plan, including Free, can connect; generation calls need a paid plan's credits or a top-up, and the assistant gets a clear `out_of_credits` error otherwise.
- Building a voice profile works best with three or more pieces of your own human-written prose, 3,000+ words in total.
- `mimic_brand` needs your explicit consent to analyse a website's writing; the tool asks for it.
- Rate limit: 60 requests per minute per key. Content is generated in UK or US English.
- Payments never happen through the connector: `upgrade_plan` returns a Stripe-hosted link and everything money-related completes in your browser.

## The loop worth knowing

`create_profile` -> `generate_content` (-> `get_job` for a long draft) -> `check_voice_match` -> `save_edit` is the full product cycle without opening the app. Saving your final edit feeds ScriptGrain's closed-loop voice learning, so future drafts get closer to you.

REST API reference: https://scriptgrain.com/docs/api.md
Questions: support@scriptgrain.com
