classic-nlp-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@classic-nlp-mcpextract triples from: Apple acquired Beats in 2014."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
classic-nlp-mcp
Deterministic, Chinese-first classical NLP, served over MCP — give your LLM agent cheap, reproducible, offline language sensors.
中英双语,中文优先。 Bilingual by design: zh and en are treated as equally first-class languages, and most tooling paths for Chinese (jieba full pipeline, HowNet sememes 义原, Chinese OpenIE) are the deepest in the project.
Developed and end-to-end tested with Z.ai GLM-5.3 as the driving agent. Works with any MCP host: Claude Desktop, Z Code (GLM Coding Plan), WorkBuddy, Cursor, Cline, or your own agent.
In the LLM era, classical NLP libraries did not become useless — they changed jobs. They are no longer the engine; they are the deterministic tool layer underneath one: batch preprocessing at near-zero cost, exact character spans, reproducible results, fully offline, zero hallucination. This project exposes that layer to any MCP-compatible agent (Claude Desktop, WorkBuddy, Cursor, your own agent...) as capability-level tools, not as one-wrapper-per-library glue.
Why
You need | LLM alone | classic-nlp-mcp |
Tokenize/parse 100k docs for RAG chunking | expensive, slow | fast, ≈0 cost, offline |
Exact character offsets for citations | drifts | always exact |
Candidate (S, P, O) triples for KG construction | good but costly | OpenIE first, LLM verifies later |
Cheap two-stage funnel (coarse NER → LLM refine) | — | built for it |
Interpretable semantics (WordNet, HowNet sememes 义原) | no native interface | first-class tools |
Reproducible research pipelines | varies | deterministic, cached logic |
Who is this for?
RAG / search engineers —
sent_split+tokenizeare the foundation of deterministic chunking;keyword_extractattaches cheap metadata to every chunk before embeddings ever run.Knowledge-graph / GraphRAG builders —
openie_triplesmines candidate (S, P, O) triples with provenance spans at ≈0 cost; the LLM only normalizes and verifies against your ontology afterwards.Agent developers watching their token bill — the two-stage funnel: classical NER/keyword pre-filter, then send only the candidates to the LLM. Same answer, order-of-magnitude less context.
Privacy- and compliance-sensitive deployments — every tool runs locally and offline. Text never leaves the process, and results are reproducible byte-for-byte.
Researchers — exact spans, versioned engine attribution and deterministic output make pipelines auditable and papers defensible.
The one-line value: classical NLP in the LLM era is not about "understanding language better than an LLM" — it is about being the cheap, exact, reproducible sensor and preprocessor layer underneath one. This project makes that layer callable by any agent over MCP.
Related MCP server: flexorch-mcp
Design principles
Wrap capabilities, not libraries. Tools are task-oriented (
tokenize,openie_triples,seme_lookup); libraries are swappable backends behind adapters.One gateway, optional engines. A single MCP server process; heavy engines (spaCy, NLTK, OpenHowNet) are optional extras.
jiebais the only mandatory dependency, so Chinese works out of the box — tokenize, POS, keywords, sentence splitting, rule-based Chinese OpenIE and HowNet sememes all run with zero extra installs. The[zh]extra upgrades Chinese further (statistical NER).Unified output schema. Every tool returns the same envelope with honest engine attribution and exact character offsets.
Graceful degradation, never silent lies. Missing optional dependency → an actionable install hint (not a crash); fallback engines are labeled as such (
regex-fallback). Forcing an engine is equally honest:tokenize/pos_tag/ner/sent_split/openie_triplesacceptengine="jieba" | "spacy" | "stanza" | "regex" | "corenlp"— an unavailable forced engine raises an install hint instead of silently downgrading, and a forced CoreNLP on Chinese degrades to jieba rules with an explicitfallback: truemarker (v0.2.3). The model-backed tier (dependency_parse/noun_phrases/sentiment, v0.3.0) follows the same contract.mcp SDK 1.x and 2.x compatible. The
mcp2.0 release renamedFastMCP→MCPServerand removed the old import path; a compat shim (src/classic_nlp_mcp/_compat.py) supports both lines.
Architecture
MCP clients (Claude / WorkBuddy / Cursor / ...)
│
▼
classic-nlp-mcp gateway ── one process, capability routing, unified schema
│
┌──────┼───────────┬──────────────┐
▼ ▼ ▼ ▼
spaCy jieba NLTK OpenHowNet
(optional, base) (optional) (optional)Tools
Tool | Capability | Engine (zh / en) |
| What is installed, per language | — |
| Segmentation with exact offsets | jieba / spaCy → stanza → regex fallback |
| Part-of-speech tagging (+lemma) | jieba.posseg / spaCy → stanza |
| Named entities with spans | stanza statistical + jieba heuristic + spaCy / spaCy → stanza |
| TF-IDF / TextRank with weights | jieba.analyse / frequency fallback |
| Sentence segmentation (RAG chunking base) | jieba+regex / spaCy → stanza → regex fallback |
| OpenIE (S, P, O) triples with source span & confidence | jieba rule (zh, draft quality) / Stanford CoreNLP (canonical) → spaCy dep rules |
| Phrase-structure trees + node labels | stanza (Stanford stack exclusive) |
| Dependency parse: head, deprel, POS, morphological feats | stanza UD (zh) / spaCy → stanza |
| Base noun phrases (chunking) with roots | jieba rule-merge (zh, heuristic) / spaCy chunker |
| Sentiment classification (per-sentence) | stanza neural REN (zh) / NLTK VADER, stanza (en) |
| HowNet sememes (义原) lookup | OpenHowNet (zh) |
| Synsets, definitions, hypernyms | NLTK WordNet (en) |
| WordNet path similarity | NLTK WordNet (en) |
| All of the above in one call, per-capability error isolation | orchestration |
Multilingual: stanza powers tokenize / pos_tag / ner / sent_split / constituency_parse for any stanza language code (fr, de, ja, es, ...) - just pass it as lang once that language's models are downloaded.
Unified output schema
Every tool returns the same envelope:
{
"tool": "tokenize",
"lang": "zh",
"engine": "jieba",
"engine_version": "0.42.1",
"tokens": [{"text": "知识", "start": 2, "end": 4, "pos": "n"}]
}openie_triples additionally returns confidence and the source span + sentence, so triples are candidates with provenance — ready for ontology alignment or LLM verification downstream.
Compatibility & versions
Written against the current APIs of every wrapped toolkit; the pinned ranges deliberately include the latest releases:
Package | Supported range | Latest at time of writing | Notes |
Python | >= 3.10 | 3.13 / 3.14 | spaCy wheels cover 3.9–3.14 |
mcp SDK |
| 2.0.x | 2.0 renamed |
| 0.42.1 (stable, pure Python) | base dependency — Chinese works out of the box | |
| 3.8.x (2026-08) | current | |
| 1.15.x | written against 1.15 (models under the platform cache dir); any language code works once its models are downloaded. No released stanza version ships OpenIE - use the CoreNLP bridge for that | |
Stanford CoreNLP | any 4.x server | 4.5.10 | optional: canonical OpenIE via local |
| 3.10.x |
| |
any (extras | 0.0.x (2020 release, data bundled) | last upstream release is old; wrapped defensively ( |
Everything optional degrades with an actionable install hint — the server starts and stays useful even with only jieba installed.
Installation
Chinese-first: the base install already covers the full Chinese pipeline; the [zh] extra is the recommended upgrade path for statistical Chinese NER.
# base — Chinese works immediately (jieba: tokenize/POS/keywords/sent_split/
# rule-based Chinese OpenIE, OpenHowNet sememes with [semantic])
pip install classic-nlp-mcp
# zh — recommended: statistical Chinese NER via spaCy
pip install "classic-nlp-mcp[zh]"
python -m spacy download zh_core_web_sm # statistical Chinese model
# en — English pipeline (same spaCy dependency, English model)
pip install "classic-nlp-mcp[en]"
python -m spacy download en_core_web_sm # spaCy English model
# other engines
pip install "classic-nlp-mcp[semantic]" # NLTK + OpenHowNet (HowNet sememes 义原)
pip install "classic-nlp-mcp[stanford]" # stanza (60+ languages, constituency)
pip install "classic-nlp-mcp[all]"
# optional: python -c "import nltk; nltk.download('wordnet')"What the [zh] path unlocks, by language coverage:
Chinese capability | base install (jieba) | with |
tokenize / pos_tag / keyword / sent_split | ✅ full pipeline | spaCy used where it wins |
| jieba POS heuristic | spaCy statistical NER (auto-preferred) |
| jieba rules (0.35, draft) | jieba rules / CoreNLP bridge unchanged |
| ✅ (with | — |
Or from source:
git clone https://github.com/liftkkkk/classic-nlp-mcp.git
cd classic-nlp-mcp
pip install -e ".[all,dev]"
pytestPlug it into your agent host (MCP configuration)
classic-nlp-mcp is a plain stdio MCP server, so any host that speaks MCP works. Development and end-to-end testing were done with Z.ai GLM-5.3 as the driving agent.
Claude Desktop / Cursor / Cline / any mcpServers client
{
"mcpServers": {
"classic-nlp": {
"command": "python",
"args": ["-m", "classic_nlp_mcp"]
}
}
}Z Code (Z.ai, GLM Coding Plan / GLM-5.3)
Z Code consumes the same standard mcpServers block — add it to Z Code's MCP settings and the GLM-5.3 agent can call tokenize, openie_triples, annotate_full etc. directly from your coding sessions:
{
"mcpServers": {
"classic-nlp": {
"type": "stdio",
"command": "python",
"args": ["-m", "classic_nlp_mcp"]
}
}
}Typical Z Code loop: annotate_full on a module's docstrings → keep openie_triples with confidence ≥ 0.35 → let GLM-5.3 normalize them against your ontology. Cheap deterministic extraction first, expensive model reasoning only where it pays.
WorkBuddy
Add the same block to ~/.workbuddy/mcp.json, then trust the server in the connector management page.
Or use the installed console script
{
"mcpServers": {
"classic-nlp": { "command": "classic-nlp-mcp" }
}
}Example agent workflows
RAG ingestion:
sent_split→ chunk by sentence spans →keyword_extractfor per-chunk metadata.KG construction pipeline:
annotate_fullon a corpus → keepopenie_tripleswithconfidence ≥ 0.35→ LLM normalizes S/P/O against your ontology → graph.Token-saving funnel:
nerfirst; only send candidate entities to the LLM for typing/linking.Interpretable similarity:
seme_lookup(sememes) orwordnet_similarity(path similarity) before embedding-based similarity.
v0.2 - the Stanford stack is in
Two additions, because the Stanford toolchain is still irreplaceable in specific niches:
stanza adapter (optional
[stanford]extra): neural statistical NER, POS + lemma, sentence splitting for 60+ languages (pass any stanza language code aslang), andconstituency_parse- phrase-structure trees that no other wrapped engine provides. Note: no released stanza version ships OpenIE - it lives in CoreNLP, which is why the next line exists.Stanford CoreNLP OpenIE bridge: the canonical OpenIE implementation. Run a local
StanfordCoreNLPServer(Java) and this MCP uses it automatically for English triples - highest-quality candidate triples in the project, still with provenance spans. When the server is down, English falls back to spaCy dependency rules andlist_capabilitiesreports the true status.
pip install "classic-nlp-mcp[stanford]"
python -c "import stanza; stanza.download('en')"
# optional, for canonical OpenIE (Java required):
# download CoreNLP from https://stanfordnlp.github.io/CoreNLP/download.html and start:
# java -mx4g -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLPServer -port 9000 -timeout 15000Upstream projects this stands on
jieba — the classic Chinese segmentation library
NLTK · docs — WordNet & the historical standard library of NLP
OpenHowNet · HowNet homepage (keenage.com) — THUNLP's sememe dictionary (义原词典)
Stanford CoreNLP · site — the Java toolkit behind classic OpenIE (JVM; can be wrapped with the same adapter pattern)
Model Context Protocol · spec & docs — the protocol this server speaks
Note: stanza ships as the
[stanford]extra (models downloaded separately per language); CoreNLP integrates through its HTTP server - see the v0.2 section above.
Roadmap
CoreNLP adapter hardening: auto-start the server, Chinese OpenIE rules
stanza zh model CI smoke test
LRU/disk result cache keyed by
(text, lang, capability, engine_version)RDF / JSON-LD export aligned with custom ontologies
compare_enginestool (same capability, multiple engines, aligned output)
Buy me a coffee
classic-nlp-mcp is an open-source project I develop and maintain in my spare time, free forever.
If it gave your agent deterministic language sensors, cheap KG preprocessing, or saved you the trouble of gluing five NLP libraries together — consider buying me a coffee (9.9 CNY is enough). Every bit of support goes straight into new features and bug fixes.
Can't donate? Starring the repo, opening an Issue, or sharing it with someone who needs it helps just as much!
License
MIT © 2026 liftkkkk
This server cannot be deployed
Maintenance
Related MCP Connectors
- WauldoOAuthcom.wauldo
Stateless agentic tools over MCP: concept extraction, long-context, knowledge graph, planning.
JSON/YAML, regex, diff, JWT, SQL dialects — the keyless millisecond ops an agent needs mid-task.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
A hosted MCP suite providing workflow primitives: web search, content fetching, compression, deduplication, cost/budget management, and agent memory pipelines.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceModular MCP server providing text preprocessing and NLP tools for AI agent ecosystems.30 PyPIMIT

flexorch-mcpofficial
AlicenseAqualityAmaintenanceEnables Claude and other MCP-compatible agents to process documents, extract structured data, detect PII, and export LLM-ready datasets through natural language tool calls.840 PyPI1MIT- AlicenseNot gradedqualityAmaintenanceEnables coding agents to perform deterministic, model-free repository analysis and patch operations—tree-sitter repo maps, symbol/reference lookup, and SEARCH/REPLACE parsing/validation—via a CLI or MCP stdio server, without ever calling a language model.368 PyPI1MIT
- AlicenseAqualityCmaintenanceProvides MCP-compatible AI clients with offline text analysis and rewriting tools, including statistics, extractive summaries, keywords, readability scores, case conversion, entity extraction, and diffing, all running locally without API keys or network calls.7MIT