Token导航 LogoToken导航TokenDH.com
MCP Corrector Catala logo
运维云端stdio官方级别未说明来源级核验

MCP Corrector Catala

MCP Server

一个支持混合加泰罗尼亚语和英语技术术语的文本校正服务,适用于教学材料和代码注释的多语言环境。

工具数

4

提示词数

0

GitHub Stars

1

资源数

0
PythonClaude云端部署Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

INS-JVidal

提供方

INS-JVidal

最后核验

2026/5/17 20:20

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

uv run python -m corrector.server

详细介绍

MCP Corrector de Català (多语种)

一个MCP(模型上下文协议)服务器,用于纠正包含英语技术术语和代码的加泰罗尼亚语文本。专为将加泰罗尼亚语散文与英语编程词汇和代码块相结合的教材而设计。

特性

  • 混合语言支持:处理内嵌英语技术术语的加泰罗尼亚语散文
  • 代码感知:自动检测和跳过代码块、内联代码和编程模式
  • 评论检查:提取代码块中的注释并进行拼写检查
  • 语言检测:对评论语言(加泰罗尼亚语/英语)进行分类,以便正确路由
  • 精确的偏移:所有更正都精确地映射到原始文件位置
  • 加泰罗尼亚语变体:支持通用、巴伦西亚和巴利阿里变体

快速开始

# Install and setup
uv sync && uv pip install -e .
docker compose up -d

# Run the MCP server
uv run python -m corrector.server

# Run tests
uv run pytest tests/ -v

建筑

Claude (Code CLI or claude.ai)
  → MCP Server (src/corrector/server.py, Python + FastMCP)
    → LanguageTool Docker (localhost:8011)

三相管道

  1. 第1阶段-冲裁:检测代码块和内联代码模式,将其留空以防止误报
  2. 第2阶段-双路由:将加泰罗尼亚语文本路由到ca ES,将检测到的英语术语路由到en-US
  3. 第3阶段-评论:从代码块中提取注释,对语言进行分类,单独检查

安装

先决条件

  • Python 3.11+
  • Docker(用于LanguageTool)
  • 紫外线 包管理器

设置

# Clone the repository
git clone 
cd mcp-corrector-dual-cat-en

# Install dependencies
uv sync

# Start LanguageTool Docker
docker compose up -d

# Verify LanguageTool is running
curl http://localhost:8011/v2/languages | head

使用克劳德代码注册

claude mcp add corrector-catala -- uv run python -m corrector.server

用法

MCP工具

corregir_text_mixt (推荐)

对加泰罗尼亚语/英语混合文本和代码进行全面的多语言更正。

corregir_text_mixt(
    text: str,           # Text to correct (prose, Markdown, or full files)
    variant: str = "general",  # "general", "valencia", or "balear"
    picky: bool = False,       # Enable strict style rules
    debug: bool = False,       # Include debug info in response
    format_json: bool = True   # Return JSON or plain text
)

示例输入:

El `callback` es crida quan el *promis* es resol.

// Això carrega les dades fetch(url).then(data => { console.log(data); // Log the respons });

Detected errors:

  • promispromise (English term, checked with en-US)
  • Això in comment → checked with ca-ES
  • responsresponse (English comment typo)

corregir_text

Simple monolingual Catalan correction (no code handling).

verificar_servidor

Check if LanguageTool Docker is running.

llistar_idiomes

List available languages on the LanguageTool server.

Running the Server

# stdio transport (for Claude Code CLI)
uv run python -m corrector.server

# HTTP transport (for claude.ai via ngrok)
uv run python -m corrector.server --transport streamable-http --port 8000

配置

环境变量默认值描述
LANGUAGETOOL_URLhttp://localhost:8011LanguageTool服务器URL
CORRECTOR_LANGca-ES默认语言变体
CORRECTOR_TIMEOUT30HTTP超时(秒)

代码检测模式

预处理器检测并清空这些模式以防止误报:

模式示例检测
倒勾` variable `显式标记
点符号console.log对象访问
函数调用forEach(x)之前没有空间 (
camelCasemyVariable案例转换
尖叫_蛇MAX_VALUE常量

重要:加泰罗尼亚语括号表达,如 funció (que és important) 没有空白,因为括号前有空格。

英语术语词典

data/terms_en.txt 该文件包含约980个技术术语。系统:

  1. 让LanguageTool标记未知单词
  2. 检查标记的单词是否在英语词典中
  3. 如果是:前往en-US进行拼写检查的路线
  4. 如果否:保持为加泰罗尼亚语错误

模糊匹配(编辑距离1)捕获拼写错误的英语术语,如 calbackcallback.

发展

运行测试

# Run all tests (requires LanguageTool Docker running)
uv run pytest tests/ -v

# Run specific phase tests
uv run pytest tests/test_phase1.py -v
uv run pytest tests/test_phase2.py -v
uv run pytest tests/test_phase3.py -v

项目结构

├── src/
│   └── corrector/
│       ├── __init__.py           # Package exports
│       ├── server.py             # MCP server and tool definitions
│       ├── preprocessor.py       # Phase 1: code detection and blanking
│       ├── text_spans.py         # Span utilities (merge, blank, filter)
│       ├── english_detector.py   # Phase 2: English dictionary and fuzzy matching
│       ├── match_filter.py       # Phase 2: match partitioning and remapping
│       ├── comment_extractor.py  # Phase 3: string-aware comment parser
│       └── comment_checker.py    # Phase 3: comment batching and routing
├── data/
│   └── terms_en.txt              # English technical terms dictionary
├── tests/
│   ├── conftest.py               # pytest configuration
│   ├── test_phase1.py            # Blanking tests
│   ├── test_phase2.py            # English term routing tests
│   ├── test_phase3.py            # Comment extraction tests
│   └── test_document_phases.py   # Integration tests
├── docs/
│   ├── CLAUDE.md                 # Project instructions
│   └── plans/                    # Implementation design documents
├── pyproject.toml
├── docker-compose.yml            # LanguageTool Docker config
└── README.md

依赖项

  • fastmcp -MCP服务器框架
  • httpx -异步HTTP客户端
  • lingua-language-detector -评论语言检测
  • rapidfuzz -模糊字符串匹配

许可证

麻省理工学院

致谢

目录标签

目录标签

PythonClaude云端部署多语言支持本地部署代码感知注释检查语言检测加泰罗尼亚语变体

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP