mcp-server
v0.1.13MCP server for using Sapling.ai language tools from Claude and other MCP-compatible assistants.
Use Sapling's grammar checking, AI detection, paraphrasing, summarization, sentiment analysis, language detection, and zero-shot text classification tools from Claude and other MCP-compatible assistants. Create a Sapling API key from . Node.js 18 or newer is required. Every successful tool call returns the Sapling API's JSON response as a text block. When that response is a JSON object, the result also carries it as structuredContent, so clients on MCP protocol 2025-06-18 or later can read scores, offsets and edits as typed fields without parsing the text.
Summary extracted from the README.
Sapling MCP Server
Use Sapling's grammar checking, AI detection, paraphrasing, summarization, sentiment analysis, language detection, and zero-shot text classification tools from Claude and other MCP-compatible assistants.
Setup
Create a Sapling API key from https://sapling.ai/docs/api/api-access. Node.js 18 or newer is required.
Claude Desktop
Add this to your Claude Desktop config:
{
"mcpServers": {
"sapling": {
"command": "npx",
"args": ["-y", "@saplingai/mcp-server"],
"env": {
"SAPLING_API_KEY": "YOUR_API_KEY"
}
}
}
}
Claude Code
claude mcp add sapling --env SAPLING_API_KEY=YOUR_API_KEY \
-- npx -y @saplingai/mcp-server
Environment
SAPLING_API_KEY: Required Sapling API key.SAPLING_API_BASE_URL: Optional API base URL. Defaults tohttps://api.sapling.ai.SAPLING_MCP_TIMEOUT_MS: Optional request timeout. Defaults to120000.
Tools
sapling_grammar_check: Grammar, spelling, punctuation, and style suggestions. Optionalvarietyenforces an English variety (us-variety,gb-variety,au-variety,ca-variety,s-variety,t-varietyornull-variety). Optionalauto_applyreturns the corrected text;include_error_categories: falseskips error classification.sapling_spell_check: Spelling-focused suggestions.sapling_ai_detect: AI-generated text detection — overall score,ai_fraction(share of the text in sentences scoring ≥ 0.5, for partially AI-written documents), averdict(human,mixedorai),segments(character offsets of the AI-scored passages),low_confidencewithlow_confidence_reasons(short_text,list_format: inputs where false positives are more likely), and per-sentence scores with character offsets. English, Arabic, Chinese, Dutch, French, German, Italian, Japanese, Korean, Polish, Portuguese, Romanian, Russian, Spanish, Swedish and Turkish (the non-English languages scored by a multilingual model) are supported; the language is detected automatically, or set it with optionallang. Optionalzero_retention: truekeeps no copy of the text (no result cache, usage logged without the text).sapling_ai_detect_url: AI-generated text detection for a web page — give it a public http(s)url(a page, or a linked .pdf, .docx, .pptx, .odt, .txt or .md document) instead of the text. Sapling fetches it, scores only the main readable text, and returns thesapling_ai_detectfields plussource(final URL after redirects, title, content type, characters scored and billed,truncated). A page that is down, blocks automated requests or has no readable text comes back as an error result. Same optionalsent_scores,score_string,version,langandzero_retention.sapling_rephrase: Paraphrase or transform text —mappingpicks the transformation (paraphrase, formality, voice, expand/shorten,switch_tonewithtone_mapping,switch_tensewithtense_mapping, ...);num_results1-8 alternatives.sapling_summarize: Summarization — a prosesummaryplus akey_pointslist for a longer text, webpage or email thread (HTML is accepted and flattened); optionallength(short,medium(default) orlong) sets the size.sapling_extract: Structured data extraction — name 1-20fields(plain names or{name, type, description, required}objects, withtypeone ofstring,number,integer,boolean,dateorlist) and get back adatamap of typed values, a per-field breakdown with the verbatimevidencespan each value came from, and the names the text didn't yield inmissing. Optionalcontextdescribes what the document is. Values must be grounded in the text, so nothing is invented.sapling_sentiment: Sentiment analysis — overall and per-sentence positive / neutral / negative with confidence scores.sapling_tone: Tone classification — overall and per-sentence emotional tone (e.g. friendly, confident, sad, angry) as[probability, tone, emoji]triples.sapling_readability_statistics: Readability statistics — grade-level readability scores, estimated reading time, and character / word / sentence counts; optionallang(defaults toen).sapling_autocomplete: Autocomplete — the predicted continuation of a partially written sentence (query, at most 200 characters; optionalsession_id). Requires an API key with autocomplete enabled. An empty array back means no completion is available.sapling_language_detect: Language detection — top language with name and confidence,reliable(whether the detection is confident enough to act on) andscript(dominant writing system, ISO 15924), runner-up candidates (top_k), and an optional per-segment breakdown for mixed-language text (segments).sapling_translate: Translation — translate text intotarget_lang(ISO 639 code or English name; region variants likezh-TW,pt-BR,en-GBsupported), preserving line breaks and markup in place. Reports the detected source language alongside the translation; optionalsource_langhint andformality(formal/informal) register.sapling_classify: Zero-shot text classification — assign one (or several, withmulti_label) of your ownlabels(plain names or{name, description}objects, 2–20) to a text; returns the bestlabel, applicablelabels, per-labelscoresand a one-sentencerationale. Optionalcontextdescribes what the texts are.sapling_styleguide: Style-guide compliance check — enforce 1–20 of your ownrules(plain names or{name, description}objects) against a text; returnsviolations(each with the verbatim offending passage, itsstart/endoffsets, anoteand a compliant rewritesuggestion), the checkedrulesand acompliantboolean; passruleset(the name of a rule set saved via the API) in place of inlinerulesto check against a saved house style.sapling_simplify: Plain-language simplification — rewrite a text at a targetreading_level(plain,elementary,middle_school,high_school), keeping all content, structure and language; returns thesimplifiedrewrite plus a before/afterreadabilityblock (Flesch-Kincaid grade and reading ease) when the language supports it.preserve_termskeeps names and defined terms verbatim.sapling_seo: SEO analysis and metadata — readability stats, target-keyword density (keywords), the page's top terms, and LLM-generated title tags, meta descriptions, slug and focus keywords;suggestions: falsegives the free stats-only mode.sapling_quality: Writing quality score (1–5), optionally per sentence (sentence_scores) and with an LLM-judged rubric — clarity/coherence/correctness/concision, summary, quoted issues with suggested rewrites (rubric, billed at a higher rate).sapling_detect_pii: PII detection and redaction — emails, phone numbers, US SSNs, credit cards, IP addresses, IBANs and US bank routing numbers with exact character offsets;redact: truealso returnsredacted_textwith[TYPE]placeholders. Listingperson,organization, orlocationintypesopts into LLM-backed detection of those named-entity types in the same call (never run by default).sapling_ner: Named-entity recognition — people, organizations, locations, dates, times, money amounts, percentages, quantities, products and events, each with exact character offsets into the submitted text;typesrestricts recognition to a subset.sapling_inclusive: Inclusive-language check — flags gendered defaults, ableist idioms, ageist framing, outdated terms for groups and classist or appearance-based wording, each with offsets, a category, a severity (low/medium/high), a note and a neutral replacement;categoriesrestricts the check to a subset.sapling_safety: Content-safety scores — toxicity, profanity, harassment, hate speech, self-harm, sexual content and violence, each scored 0–1 with flagged categories (threshold, default 0.5).
Tool results
Every successful tool call returns the Sapling API's JSON response as a text block. When that response is a JSON object, the result also carries it as structuredContent, so clients on MCP protocol 2025-06-18 or later can read scores, offsets and edits as typed fields without parsing the text. The hosted server (https://mcp.sapling.ai/mcp) has returned the same shape since October 13, 2026. Tools declare no outputSchema, because the API adds response fields over time. Error results (isError: true) are text-only: a JSON object with the API's error message, HTTP status and raw body. When the block clears by waiting, the error also has a top-level retry_after in whole seconds; wait at least that long before retrying. It comes from the API's retry_after body field on 402 and 429 answers, or from the Retry-After header on 5xx answers. A 402 or 429 without it won't succeed by waiting: fix the account, or shrink the request (see Rate Limits & Errors).
Development
npm ci
npm test