Skip to main content

Sapling MCP Server

The Sapling MCP Server makes Sapling's language APIs available as tools in Claude Desktop, Claude Code, and other assistants that support local Model Context Protocol servers over standard input and output (stdio).

The server runs locally 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:

  1. Node.js 18 or newer, including the npx command.
  2. A Sapling API key. Trial keys are available after registration.
  3. An MCP client that supports local stdio servers.

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__sapling allows every Sapling tool.
  • mcp__sapling__sapling_grammar_check allows 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:

SettingValue
Transportstdio
Commandnpx
Arguments-y, @saplingai/mcp-server
EnvironmentSAPLING_API_KEY=YOUR_API_KEY

The Sapling package does not expose a remote HTTP MCP endpoint. Your client starts the local stdio process and the process calls https://api.sapling.ai.

Available tools

ToolPurposeOptional inputs
sapling_grammar_checkGrammar, spelling, punctuation, and style suggestionssession_id, lang, variety, medical, advanced_edits
sapling_spell_checkSpelling-focused suggestionssession_id, lang
sapling_ai_detectAI-generated content detectionsent_scores, score_string
sapling_rephraseParaphrase, tone, and tense transformationsmapping, tone_mapping, tense_mapping, num_results (1–8)
sapling_summarizeSummarize longer textNone
sapling_sentimentAnalyze sentimentNone
sapling_language_detectDetect a text's language, with runner-up candidates and an optional per-segment breakdown for mixed-language texttop_k (1–10), segments

Every tool requires a non-empty text input. For endpoint-specific limits and response formats, see the API documentation.

Configuration

Environment variableRequiredDefaultDescription
SAPLING_API_KEYYesSapling API key used for each request
SAPLING_API_BASE_URLNohttps://api.sapling.aiAlternate Sapling API base URL, such as an on-premises deployment
SAPLING_MCP_TIMEOUT_MSNo120000Positive request timeout in milliseconds

Try it

After restarting or reconnecting your MCP client, try:

  • "Check this sentence for grammar: This are a test."
  • "Detect the language of: Bonjour tout le monde."
  • "Rewrite this sentence in a friendlier tone."
  • "Analyze the sentiment of this customer message."

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.

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

The package does not log or persist your API key or submitted text. 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.