jieba-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., "@jieba-mcp segment this Chinese text in search mode: 小明硕士毕业于中国科学院计算所"
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.
jieba-mcp
English | 简体中文
Chinese text processing for any MCP client: word segmentation, keyword extraction, part-of-speech tagging, a user dictionary and Simplified/Traditional conversion. It is built on jieba and runs locally over stdio with a single uvx jieba-mcp.
LLMs can read Chinese, but they cannot reliably count, split or rank Chinese words. These tools give them deterministic answers that are the same on every run.
Tools
Tool | What it does |
| Split text into words. Modes: |
| Top keywords by |
| Words plus part-of-speech tags ( |
| Add domain words (names, jargon, brands) so later calls keep them whole |
| Simplified ⇄ Traditional via OpenCC configs ( |
Every tool returns structured JSON (structuredContent) and declares an output schema. Parameters are described in each tool's JSON Schema, so clients can show them.
Related MCP server: MCP Jieba Server
Install
Requires Python 3.10+ and uv.
uvx jieba-mcp # runs the server on stdioUntil the package is on PyPI, run it from GitHub instead: uvx --from git+https://github.com/BACH-AI-Tools/jieba-mcp jieba-mcp.
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"jieba": {
"command": "uvx",
"args": ["jieba-mcp"]
}
}
}Cursor
Add the same block to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per project).
Claude Code
claude mcp add jieba -- uvx jieba-mcpHTTP transports (optional)
jieba-mcp --transport streamable-http --port 9998 # http://127.0.0.1:9998/mcp
jieba-mcp --transport sse --port 9998 # http://127.0.0.1:9998/sse--host defaults to 127.0.0.1. The Docker image serves SSE on 0.0.0.0:9998:
docker build -t jieba-mcp . && docker run -p 9998:9998 jieba-mcpExamples
The outputs below are real structuredContent returned over stdio by version 1.0.0. The first call takes about a second while jieba loads its dictionary.
segment
{"text": "我来到北京清华大学"}
→ {"mode": "precise", "tokens": ["我", "来到", "北京", "清华大学"], "count": 4}
{"text": "我来到北京清华大学", "mode": "full"}
→ {"mode": "full", "tokens": ["我", "来到", "北京", "清华", "清华大学", "华大", "大学"], "count": 7}
{"text": "小明硕士毕业于中国科学院计算所", "mode": "search"}
→ {"mode": "search", "tokens": ["小明", "硕士", "毕业", "于", "中国", "科学", "学院", "科学院", "中国科学院", "计算", "计算所"], "count": 11}Set "hmm": false to turn off jieba's HMM model, which joins unknown words.
extract_keywords
{"text": "我来到北京清华大学,清华大学是一所综合性大学", "top_k": 3}
→ {"method": "tfidf", "keywords": [
{"word": "清华大学", "weight": 2.308741},
{"word": "一所", "weight": 1.115948},
{"word": "综合性", "weight": 1.044143}]}
{"text": "线程是程序执行中一个单一的顺序控制流程,进程内有一个或多个线程,线程共享进程的资源",
"top_k": 3, "method": "textrank"}
→ {"method": "textrank", "keywords": [
{"word": "线程", "weight": 1.0},
{"word": "进程", "weight": 0.7957},
{"word": "共享", "weight": 0.504354}]}Options:
with_weight: falsereturns words only, and eachweightisnull.allow_poskeeps only the listed tags. For example,["ns"]keeps only place names.TextRank defaults to
["ns", "n", "vn", "v"].
pos_tag
{"text": "我爱北京天安门"}
→ {"tokens": [{"word": "我", "flag": "r"}, {"word": "爱", "flag": "v"},
{"word": "北京", "flag": "ns"}, {"word": "天安门", "flag": "ns"}], "count": 4}Tags follow jieba's ICTCLAS-compatible set; see the jieba README.
add_user_words
segment {"text": "大语言模型正在改变检索增强生成"}
→ {"tokens": ["大", "语言", "模型", "正在", "改变", "检索", "增强", "生成"], ...}
add_user_words {"words": [{"word": "大语言模型", "tag": "nz"}, {"word": "检索增强生成"}]}
→ {"added": ["大语言模型", "检索增强生成"], "count": 2}
segment {"text": "大语言模型正在改变检索增强生成"}
→ {"tokens": ["大语言模型", "正在", "改变", "检索增强生成"], ...}
pos_tag {"text": "大语言模型正在改变检索增强生成"}
→ {"tokens": [{"word": "大语言模型", "flag": "nz"}, {"word": "正在", "flag": "t"},
{"word": "改变", "flag": "v"}, {"word": "检索增强生成", "flag": "x"}], ...}Where the words live: in the server process's memory only. They apply to all later calls and to every client of that process. They are lost when the process restarts, and nothing is written to disk.
Tags: give a
tagif you wantpos_tagto label the word; words added without one are taggedx.Frequency:
freqis optional. If you omit it, jieba picks one that keeps the word whole.
convert_chinese
{"text": "软件和鼠标", "config": "s2twp"} → {"config": "s2twp", "text": "軟體和滑鼠"}
{"text": "漢字轉換", "config": "t2s"} → {"config": "t2s", "text": "汉字转换"}Development
git clone https://github.com/BACH-AI-Tools/jieba-mcp.git
cd jieba-mcp
pip install -e '.[test]'
pytest # tool tests + a real stdio session via the MCP clientLicense and acknowledgements
MIT, see LICENSE.
jieba by Sun Junyi (fxsjy), MIT License. It does all of the segmentation, tagging and keyword work.
opencc-python-reimplemented, Apache-2.0. It is a pure-Python port of OpenCC and provides
convert_chinese.The Model Context Protocol Python SDK.
Available Tools
5 toolsadd_user_wordsAdd words to the user dictionaryAIdempotent
Add domain words (names, jargon, brands) so later calls keep them whole.
The dictionary lives in this server process's memory only: it affects every later call to segment, pos_tag and extract_keywords, is shared by all clients of this process, and is gone after a restart. Nothing is written to disk.
Inputs: words (required). Returns: added, count
convert_chineseConvert Simplified / Traditional ChineseBRead-only
Convert between Simplified and Traditional Chinese.
Inputs: text (required), config. Returns: text, config
extract_keywordsExtract keywordsBRead-only
Extract the most important keywords from Chinese text.
Inputs: text (required), top_k, method, allow_pos, +1 more. Returns: method, keywords
pos_tagPart-of-speech taggingARead-only
Segment Chinese text and tag each word with its part of speech.
Inputs: text (required), hmm. Returns: count, tokens
segmentSegment Chinese textBRead-only
Split Chinese text into words with jieba.
Inputs: text (required), hmm, mode. Returns: mode, count, tokens
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
Each tool maps to a distinct operation: segmentation, keyword extraction, POS tagging, dictionary mutation, and script conversion. The only slight overlap is between segment and pos_tag, since POS tagging also returns segmentation, but the descriptions make the added value clear. add_user_words is explicitly framed as a stateful modifier of the other three, which prevents confusion.
All names are snake_case and verb-led (segment, extract_keywords, pos_tag, add_user_words, convert_chinese), forming a readable pattern. The minor deviation is `segment`, a bare verb with no object, while the others are verb_noun. That is easily understood in context and does not impair selection.
Five tools cleanly cover the scope of a jieba wrapper without redundancy. Every tool earns its place: three text-analysis operations, one configuration hook, and one conversion utility. Nothing feels bolted on or missing at the structural level.
The core jieba surface is covered: segmentation, keyword extraction, POS tagging, and user dictionary insertion, plus a useful Simplified/Traditional converter. Minor gaps remain, such as no search-engine-mode segmentation, no way to list or remove user words, and no confidence weights on keywords, but agents can work around these.
Maintenance
Related MCP Connectors
MCP server for Chinese dictionary lookup: character definitions, pinyin, stroke order and word
Speech-to-text (STT, with hotwords and 22 dialects), text-to-speech (TTS, 21 voices), OCR image/PDF text recognition, and typed decision-making with calibrated probabilities. 11 MCP tools including async tasks for long audio, long text and PDF documents. API key required; new accounts get a ¥10 trial credit at suanlinfang.cn.
MCP server for classical Chinese poetry: search poems by title, author, dynasty or verse, with full
MCP server for classical Chinese texts: sentence lookup, source attribution and full-text search
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables integration of DeepSeek's language models with MCP-compatible applications, offering features like chat completion, custom model selection, and parameter control for enhancing language-based interactions.11610 npm363MIT
- AlicenseNot gradedqualityDmaintenanceProvides high-performance Chinese text segmentation, POS tagging, and keyword extraction using Rust-based Jieba implementation. Supports both local STDIO and remote HTTP deployment modes.GPL 3.0
- AlicenseNot gradedqualityDmaintenanceMCP server that counts the number of Chinese characters (excluding punctuation, spaces, English, and numbers) in a given text, compatible with Streamable HTTP and JSON-RPC.MIT
- AlicenseAqualityCmaintenanceProvides AI models with tools to proofread and format Chinese text before delivery, covering typos, punctuation, casing, spacing, and platform-specific character limits. It runs as a zero-dependency MCP service so the model checks and fixes its own Chinese writing automatically.41MIT