Sapling MCP Server
The Sapling MCP Server makes Sapling's language APIs available as tools in Claude Desktop, Claude Code, ChatGPT connectors, and other assistants that speak the Model Context Protocol.
There are two ways to connect:
| Hosted server | Local server | |
|---|---|---|
| Address | https://mcp.sapling.ai/mcp | runs on your machine via npx |
| Transport | Streamable HTTP | stdio |
| Requires | An MCP client that supports remote servers | Node.js 18+ |
| Sign-in | Sapling account (OAuth) or an API key header | API key in the client's environment |
Use the hosted server unless your client only supports local stdio servers, or
you need requests to go to an on-premises Sapling deployment.
Hosted server
Add https://mcp.sapling.ai/mcp as a remote MCP server in your client. On first
connection the client opens a Sapling page in your browser where you sign in and
choose which of your API keys the connection should use. Approve it, and the
client receives a token — no key is ever pasted into the client.
Claude Code:
claude mcp add --transport http sapling https://mcp.sapling.ai/mcp
Then run /mcp in Claude Code and choose Authenticate to complete sign-in.
In Claude Desktop or claude.ai, add a custom connector with the same URL.
Connecting with an API key instead
Clients that let you set request headers can skip the sign-in flow and send a Sapling API key directly:
claude mcp add --transport http sapling https://mcp.sapling.ai/mcp \
--header "Authorization: Bearer YOUR_API_KEY"
Requests without a credential are refused with 401.
What a connection can do
An approved connection can call the Sapling tools listed below using the API key you selected. Usage counts against that key's quota and billing, exactly as your own API calls do. The connection cannot read your documents, team data, or account settings, and it cannot create or change API keys.
Access tokens last 24 hours and are renewed automatically by the client for up to 90 days. To disconnect an application, delete or rotate the key it uses in API settings, or remove the server from your MCP client.
Local server
The local server runs through Node.js. When you call a Sapling tool, it sends the requested text to the Sapling API and returns the API's structured response to your assistant.
Before you begin
You need:
- Node.js 18 or newer, including the
npxcommand. - A Sapling API key. Trial keys are available after registration.
- An MCP client that supports local
stdioservers.
Keep the API key in your MCP client's environment configuration. Do not place it in prompts, source code, or a committed configuration file.
Claude Desktop
Add the following entry to your Claude Desktop configuration, replacing
YOUR_API_KEY with your Sapling API key:
{
"mcpServers": {
"sapling": {
"command": "npx",
"args": ["-y", "@saplingai/mcp-server"],
"env": {
"SAPLING_API_KEY": "YOUR_API_KEY"
}
}
}
}
The configuration file is located at:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Restart Claude Desktop after saving the file.
Claude Code
Run:
claude mcp add sapling --env SAPLING_API_KEY=YOUR_API_KEY \
-- npx -y @saplingai/mcp-server
Then run claude mcp list to confirm that sapling is configured.
Tool permissions
Claude Code asks for approval the first time Claude calls each Sapling tool. Choose the "don't ask again" option to approve a tool permanently.
To pre-approve tools — or if a tool call is denied instead of prompted, which
can happen in auto-accept or non-interactive sessions — run /permissions in
Claude Code and add an allow rule:
mcp__saplingallows every Sapling tool.mcp__sapling__sapling_grammar_checkallows one tool.
Rule names follow mcp__<server>__<tool>, where the server name is the one you
passed to claude mcp add (sapling above). MCP permission rules do not
support wildcards; use mcp__sapling to allow all Sapling tools.
You can also add the rules directly to the permissions.allow list in
~/.claude/settings.json (all projects) or .claude/settings.json (one
project):
{
"permissions": {
"allow": ["mcp__sapling"]
}
}
Other MCP clients
Use the following local-server settings in any client that accepts a command, arguments, and environment variables:
| Setting | Value |
|---|---|
| Transport | stdio |
| Command | npx |
| Arguments | -y, @saplingai/mcp-server |
| Environment | SAPLING_API_KEY=YOUR_API_KEY |
With this configuration your client starts the local stdio process and the
process calls https://api.sapling.ai. For a remote server, use
https://mcp.sapling.ai/mcp as described in Hosted server.
Configuration
These environment variables configure the local stdio server. The hosted
server is configured through its sign-in flow or Authorization header instead.
| Environment variable | Required | Default | Description |
|---|---|---|---|
SAPLING_API_KEY | Yes | — | Sapling API key used for each request |
SAPLING_API_BASE_URL | No | https://api.sapling.ai | Alternate Sapling API base URL, such as an on-premises deployment |
SAPLING_MCP_TIMEOUT_MS | No | 120000 | Positive request timeout in milliseconds |
Available tools
The two servers share most tools but not all of them, and two tools are spelled differently on each — the hosted names were published first and cannot change without breaking connected clients.
| Tool (hosted server) | Purpose | Optional inputs | On the local server |
|---|---|---|---|
sapling_grammar_check | Grammar, spelling, punctuation, and style suggestions | session_id, lang, variety, auto_apply, medical, advanced_edits | same name |
sapling_spellcheck | Spelling-focused suggestions | session_id, lang | sapling_spell_check |
sapling_ai_detect | AI-generated content detection (see the AI detector API) | sent_scores, score_string | same name |
sapling_rephrase | Paraphrase, tone, and tense transformations | mapping, tone_mapping, tense_mapping, num_results (1–8) | same name |
sapling_summarize | Summarize longer text | None | same name |
sapling_sentiment | Analyze sentiment | None | same name |
sapling_detect_language | Detect a text's language, with runner-up candidates and an optional per-segment breakdown for mixed-language text | top_k (1–10), segments | sapling_language_detect |
sapling_detect_pii | Detect PII (emails, phones, SSNs, cards, IPs, IBANs, routing numbers) with exact offsets and optionally return a redacted copy | types, redact | same name |
sapling_quality | Score writing quality 1–5, optionally per sentence and with an LLM rubric (clarity, coherence, correctness, concision, quoted issues with suggested rewrites) | sentence_scores, rubric | same name |
sapling_seo | SEO analysis and metadata: on-page stats, keyword density, top terms, and suggested title tags, meta descriptions, slug and focus keywords | keywords (up to 10), suggestions, lang | same name |
sapling_classify | Zero-shot classification into labels you supply (single- or multi-label), with a score per label and a one-sentence rationale | labels (required, 2–20), multi_label, threshold, context | same name |
sapling_extract | Extract fields you name from unstructured text, with a typed value and the quoted source span for each | fields (required, 1–20), context | same name |
sapling_tone | Classify emotional tone, overall and per sentence | None | not available |
sapling_readability_statistics | Grade level, reading time, and text counts | lang | not available |
sapling_autocomplete | Predict how a partial sentence continues | session_id | not available |
Every tool requires a non-empty text input, except sapling_autocomplete,
which takes query (200 characters maximum) and needs a key with autocomplete
enabled. For endpoint-specific limits and response formats, see the
API documentation.
Prompts and reference resources
The hosted server also publishes ready-made prompts — proofread, adjust tone,
check for AI-generated content, summarize, and readability report — which
clients surface as slash commands or quick actions, and reference resources
under sapling://reference/ listing the language codes and argument values each
tool accepts.
Try it
After restarting or reconnecting your MCP client, try:
- "Check this sentence for grammar:
This are a test." - "Classify this support ticket as billing, technical issue, shipping or other."
- "Detect the language of:
Bonjour tout le monde." - "Pull the invoice number, total and due date out of this email."
- "Rewrite this sentence in a friendlier tone."
- "Suggest a title tag and meta description for this article, targeting
grammar checker." - "Analyze the sentiment of this customer message."
- "Redact any PII from this support transcript before I paste it into the ticket."
Your assistant should ask for confirmation when appropriate and then call a
tool whose name begins with sapling_.
Troubleshooting
Missing SAPLING_API_KEY environment variable
Add SAPLING_API_KEY to the server's env configuration and restart the MCP
client. Setting it only in a shell that does not launch the client may not pass
it to the server.
npx or node is not found
Install Node.js 18 or newer and restart the MCP client so it receives the updated system path.
402 Payment Required
The API key may be expired, inactive, or over its monthly billing limit. Review API access and payment-required responses.
Claude Code denies a Sapling tool call
If a sapling_* tool call is blocked with a permission error rather than an
approval prompt, add an allow rule for the tool: run /permissions and allow
mcp__sapling (all Sapling tools) or mcp__sapling__<tool_name> (one tool),
then retry. See Tool permissions.
The hosted server returns 401
The request carried no credential, or the token expired and the client did not
renew it. Reconnect the server in your client to sign in again, or check the
Authorization: Bearer header if you configured a key directly.
A tool times out
For unusually long API calls, set SAPLING_MCP_TIMEOUT_MS to a larger positive
number. For large documents, follow the chunking guidance on the relevant API
page.
Security and data handling
Neither server logs nor persists your API key or submitted text. The hosted server stores no text and no credentials: it forwards your token or key to the Sapling API with the request and keeps nothing afterward. Tool inputs are sent to the configured Sapling API endpoint for processing. Review Data Processing and contact Sapling if you require no-data-retention or an on-premises deployment.
If you set SAPLING_API_BASE_URL, the server sends your API key and submitted
text to that endpoint. Point it only at a Sapling endpoint you trust, such as
your own on-premises deployment.
Releases are published on npm as
@saplingai/mcp-server.