# 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

## 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.

Free: `list_profiles`, `get_profile`, `create_outline`, `check_voice_match`, `compare_voice`, `ai_detect`, `list_generations`, `get_generation`, `save_edit`, `get_billing`, `get_invoice`, `upgrade_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`, 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` (1 credit per variant), `polish` and `humanize` (1 credit each, 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).

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).

## 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` -> `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
