BeLikeNative Grammar Server
BeLikeNative MCP 服务器
一个模型上下文协议 (MCP) 服务器,为 Claude Desktop、ChatGPT、Cursor 等 AI 客户端提供语法检查、写作改进、翻译和语气调整工具。
无需 API 密钥。 语法和风格检查使用本地基于规则的引擎。翻译和语气调整功能会返回结构化提示词,供宿主 AI 处理。
工具
工具 | 描述 | 处理方式 |
| 检查语法、拼写和标点,并提供 L1 语言感知解释 | 本地基于规则(50+ 条正则表达式规则) |
| 分析文本的风格、冗长程度、被动语态、句子长度 | 本地基于规则 + 风格指南 |
| 在不同语言间进行翻译,输出自然流畅 | 返回给宿主 AI 的提示词 |
| 调整文本语气(正式、随意、专业、外交辞令等) | 返回给宿主 AI 的提示词 |
前置要求
Node.js 18+
仅此而已。无需 API 密钥,无需环境变量,无需外部服务。
安装
cd mcp-server
pnpm install独立运行
pnpm start服务器通过 stdio (stdin/stdout) 进行通信。它旨在由 MCP 客户端启动,而非交互式运行。
MCP 客户端配置
Claude Desktop
添加到您的 Claude Desktop 配置中(macOS 上位于 ~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"belikenative": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/src/index.mjs"]
}
}
}Claude Code
添加到您的 Claude Code MCP 设置中:
{
"mcpServers": {
"belikenative": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/src/index.mjs"]
}
}
}Cursor
添加到您的 Cursor MCP 配置中(项目内的 .cursor/mcp.json 或全局的 ~/.cursor/mcp.json):
{
"mcpServers": {
"belikenative": {
"command": "node",
"args": ["/absolute/path/to/mcp-server/src/index.mjs"]
}
}
}Windsurf / 其他 MCP 客户端
任何支持 stdio 传输的 MCP 客户端都可以使用此服务器。将其指向 node src/index.mjs。无需环境变量。
工具架构
check_grammar
{
"text": "string (required, max 6000 chars)",
"language": "string (optional, default 'en') -- writer's native language for L1-tailored explanations"
}improve_writing
{
"text": "string (required, max 6000 chars)",
"style": "enum: academic | business | creative | technical | simple | concise (optional, default 'business')"
}translate
{
"text": "string (required, max 6000 chars)",
"source_language": "string (required) -- e.g. 'en', 'English', 'fr'",
"target_language": "string (required) -- e.g. 'es', 'Spanish', 'de'"
}adjust_tone
{
"text": "string (required, max 6000 chars)",
"tone": "enum: formal | casual | friendly | professional | persuasive | confident | empathetic | diplomatic (required)"
}架构
src/
index.mjs -- MCP server entry point (stdio transport, tool registration)
tools.mjs -- Tool definitions (JSON schemas) and handler functions
rules.mjs -- Local grammar rules engine (50+ regex patterns, style analyzer)传输: stdio (MCP 标准)
语法/风格: 本地基于规则的引擎(无外部 API 调用)
翻译/语气: 返回结构化提示词供宿主 AI 客户端处理
日志: 所有日志输出到 stderr (stdout 保留给 MCP 协议)
错误处理: 永不崩溃 —— 所有错误均返回结构化的 MCP 错误响应
工作原理
核心洞察:MCP 工具由已经内置 AI 的 AI 客户端(Claude Desktop、Cursor 等)调用。MCP 服务器无需自行进行 API 调用。
check_grammar 和 improve_writing 使用 50 多条基于正则表达式的规则来检测语法错误、拼写错误、风格问题、被动语态和句子长度问题。结果是确定性的且即时的。
translate 和 adjust_tone 确实需要 AI 智能,因此它们返回带有指南的结构化提示词,由宿主 AI 直接处理。这比双重 API 调用更快、更便宜且更可靠。
代码质量
此服务器遵循 NASA Power of 10 规则:
所有函数不超过 60 行
每个函数至少有 2 个断言
所有循环都有固定的上限
无全局可变状态(常量已冻结)
检查每个返回值
零警告
BeLikeNative 开发者工具
此工具是 BeLikeNative 生态系统的一部分 —— 为非英语母语者提供的 AI 写作工具。
工具 | 类型 | 描述 |
GitHub Action | 带有 60 条规则和 L1 语言感知洞察的 PR 语法检查器 | |
GitHub Action | 写作质量分析:可读性、结构、清晰度 | |
GitHub Action | 查找需要国际化的硬编码字符串 | |
GitHub Action | 提交信息语法、格式和清晰度检查器 | |
Web 工具 | 免费网站性能评分工具 |
BeLikeNative Chrome 扩展程序 —— 适用于 100 多种语言、15 种语气、15 种风格的 AI 写作助手。拥有 10,000 多名用户,4.6 星评分。
许可证
MIT
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/theluckystrike/bln-mcp-grammar-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server