# 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; legacy SSE at `/sse`)
- Auth: your ScriptGrain API key (`sg_live_...`), minted at Settings -> API (https://scriptgrain.com/settings?tab=api)
- 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 asks you to paste your API key once; after that the connector just works.

Other MCP clients: add a custom connector with the same URL. Both the OAuth flow and a plain `Authorization: Bearer` header are supported.

## Tools

Free: `list_profiles`, `get_profile`, `create_outline`, `check_voice_match`, `ai_detect`, `list_generations`, `get_generation`, `save_edit`, `get_billing`, `get_invoice`, `upgrade_plan`.

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

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

Payments never happen through the API: `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
