mcp-server

v0.1.13
@saplingai/mcp-server Checked 1 day ago Published 5 days ago

MCP 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 to https://api.sapling.ai.
  • SAPLING_MCP_TIMEOUT_MS: Optional request timeout. Defaults to 120000.

Tools

  • sapling_grammar_check: Grammar, spelling, punctuation, and style suggestions. Optional variety enforces an English variety (us-variety, gb-variety, au-variety, ca-variety, s-variety, t-variety or null-variety). Optional auto_apply returns the corrected text; include_error_categories: false skips 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), a verdict (human, mixed or ai), segments (character offsets of the AI-scored passages), low_confidence with low_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 optional lang. Optional zero_retention: true keeps 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 the sapling_ai_detect fields plus source (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 optional sent_scores, score_string, version, lang and zero_retention.
  • sapling_rephrase: Paraphrase or transform text — mapping picks the transformation (paraphrase, formality, voice, expand/shorten, switch_tone with tone_mapping, switch_tense with tense_mapping, ...); num_results 1-8 alternatives.
  • sapling_summarize: Summarization — a prose summary plus a key_points list for a longer text, webpage or email thread (HTML is accepted and flattened); optional length (short, medium (default) or long) sets the size.
  • sapling_extract: Structured data extraction — name 1-20 fields (plain names or {name, type, description, required} objects, with type one of string, number, integer, boolean, date or list) and get back a data map of typed values, a per-field breakdown with the verbatim evidence span each value came from, and the names the text didn't yield in missing. Optional context describes 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; optional lang (defaults to en).
  • sapling_autocomplete: Autocomplete — the predicted continuation of a partially written sentence (query, at most 200 characters; optional session_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) and script (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 into target_lang (ISO 639 code or English name; region variants like zh-TW, pt-BR, en-GB supported), preserving line breaks and markup in place. Reports the detected source language alongside the translation; optional source_lang hint and formality (formal/informal) register.
  • sapling_classify: Zero-shot text classification — assign one (or several, with multi_label) of your own labels (plain names or {name, description} objects, 2–20) to a text; returns the best label, applicable labels, per-label scores and a one-sentence rationale. Optional context describes what the texts are.
  • sapling_styleguide: Style-guide compliance check — enforce 1–20 of your own rules (plain names or {name, description} objects) against a text; returns violations (each with the verbatim offending passage, its start/end offsets, a note and a compliant rewrite suggestion), the checked rules and a compliant boolean; pass ruleset (the name of a rule set saved via the API) in place of inline rules to check against a saved house style.
  • sapling_simplify: Plain-language simplification — rewrite a text at a target reading_level (plain, elementary, middle_school, high_school), keeping all content, structure and language; returns the simplified rewrite plus a before/after readability block (Flesch-Kincaid grade and reading ease) when the language supports it. preserve_terms keeps 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: false gives 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: true also returns redacted_text with [TYPE] placeholders. Listing person, organization, or location in types opts 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; types restricts 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; categories restricts 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