Skip to main content
Glama
wolf123450

STE Dictionary MCP Server

by wolf123450

STE 字典 MCP 服务器

一个 MCP 服务器,用于对照 ASD-STE100 简化技术英语(STE)检查文本:哪些单词是已批准的、哪些不是,以及每个违规单词应替换为哪个 STE 单词。完全离线运行,使用 data/ 中的静态字典快照——运行时无需网络访问。完整设计见 docs/superpowers/specs/2026-08-21-ste-mcp-design.md。

设置

pip install -r requirements.txt
python scripts/download_nltk_data.py
pytest

check_structure 工具需要两个小型 NLTK 数据包(punkt_tab 句子/单词分词器和 averaged_perceptron_tagger_eng 词性标注器——经典统计模型,非深度学习)。安装依赖后运行一次 python scripts/download_nltk_data.py 即可下载它们,并会裁剪掉 NLTK 下载器默认拉取的非英语分词器语言,将磁盘占用控制在几 MB 而不是约 58MB。可以安全地重复运行。如果跳过此步骤,check_structure 会抛出 RuntimeError 提示你运行它。

服务器从 STE_DATA_DIR 环境变量读取字典快照,默认值为 ./data(相对于服务器启动时的工作目录)。data/ 中的快照已提交到本仓库,因此无需单独的下载步骤。

Related MCP server: mcp-textstats

独立运行

python -m ste_mcp.server

通过 stdio 使用 MCP 协议通信。

安装到 Claude Code

使用 Claude Code CLI 注册服务器。如果你的 PATH 中的 python 没有安装 mcp 包,请使用 Python 解释器的绝对路径。

本地作用域(仅在从本仓库运行 Claude Code 时可用):

cd /absolute/path/to/ste-dictionary-mcp
claude mcp add --transport stdio --env STE_DATA_DIR=/absolute/path/to/ste-dictionary-mcp/data ste-dictionary -- python -m ste_mcp.server

用户作用域(可从任何目录使用)。由于用户作用域的服务器不会以本仓库作为工作目录运行,请将启动过程包装在一个小脚本中,先 cd 到仓库再启动,例如 ~/.claude/ste-launcher.sh:

#!/bin/sh
cd /absolute/path/to/ste-dictionary-mcp
exec python -m ste_mcp.server

然后注册它:

chmod +x ~/.claude/ste-launcher.sh
claude mcp add --transport stdio --scope user --env STE_DATA_DIR=/absolute/path/to/ste-dictionary-mcp/data ste-dictionary -- ~/.claude/ste-launcher.sh

使用 claude mcp list 或在会话中输入 /mcp 进行验证。

Claude Desktop 配置

添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "ste-dictionary": {
      "command": "python",
      "args": ["-m", "ste_mcp.server"],
      "cwd": "/absolute/path/to/ste-dictionary-mcp",
      "env": {
        "STE_DATA_DIR": "/absolute/path/to/ste-dictionary-mcp/data"
      }
    }
  }
}

工具

工具

用途

check_word(word)

该单词/短语是否为 STE 批准词汇?如果不是,应替换为什么?

check_text(text, include_unknown=True)

扫描文档,找出非 STE、有歧义、未知和技术性单词,并标注位置。

check_structure(text)

扫描文档中的结构性 STE 违规:过长句子、被动语态、非祈使语气、4 个以上名词连用、过长段落、动名词作名词。

lookup_technical_term(term)

查找已批准的技术术语或缩写。

dictionary_info()

字典来源、更新时间和覆盖统计信息。

check_word/check_text 基于单词列表,而非语法检查器:它们检查词汇,不检查句子结构。check_structure 增加了轻量级结构检查(通过一个小型统计词性标注器,而非完整语法引擎),用于处理单词列表无法捕捉的 ASD-STE100 规则——详见 ste_mcp/structure.py 中的 docstring,了解具体规则及其启发式局限性。它仅提供诊断(不提供改写建议);使用这些工具的代理负责实际改写。

有些单词既有 STE 批准的含义,也有非 STE 的含义(例如 "long" 作为普通形容词是 STE 批准的,但 "as long as"/"no longer" 则不是)。对于这些词,check_word 返回 status: "ambiguous"(而不是 "non_ste"),并附带 note 提示调用者根据上下文判断具体含义;check_text 则将它们归入单独的 ambiguous 桶/汇总计数,而不是 non_ste。status: "non_ste" 仅保留给所有匹配含义均为非 STE 的单词。

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides lightweight documentation review tools including issue detection, readability scoring, style checking, and document summarization for integration with MCP-compatible clients.
    -
  • A
    license
    Not graded
    quality
    B
    maintenance
    Provides text statistics and readability scores (Flesch Reading Ease, Flesch-Kincaid Grade Level) via offline, keyless tools.
    9 npm
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables automated agents and writers to check Norwegian and English prose before sending, returning concrete style findings, revision hints, and verdicts instead of authorship claims, with a no-judgment band, positive quality checks, a private local mode, and phrase-bank memory.
    MIT
  • A
    license
    A
    quality
    B
    maintenance
    Enables deterministic, LLM-free checking of text against a prose editorial standard, returning violations with rule IDs, locations, severity, confidence, and suggested fixes, while also supporting safe fixes and writing measurements.
    5
    304 npm
    MIT