A Model Context Protocol server for code analysis, project navigation, memory management, and AI persona control. Provides static code analysis via AST indexing, code impact analysis, project mapping, business flow tracing, symbol search, memo recording, and persona switching.
MPM-Coding provides 12 tools with detailed Chinese descriptions and structured JSON schemas. Most tools have complete input schemas with proper type definitions and enum constraints. However, there are significant gaps: (1) Output schemas are entirely undocumented, no tool declares what it returns, forcing LLMs to guess at response structure. (2) Error handling is completely absent, no tool documents how to recover from failures or what errors it might raise. (3) Descriptions, while extensive and culturally localized, are often longer than production baselines (>1000 chars in many cases) and could be more concisely written for LLM consumption. (4) Parameter descriptions are verbose but lack formal constraints for many numeric fields (e.g., max_nodes has no documented bounds). (5) Tool composition shows some concerning patterns: 'persona' is a god-tool managing multiple responsibilities (list, activate, create, update, delete), and 'memo' mixes recording concerns with fact extraction. The server provides good foundational structure but lacks the polish required for production-grade agent interaction.
check_update - 检查 MPM-Coding 新版本 用途: 检查 GitHub Releases 是否有新版本, 提示用户手动更新。 参数: 无 触发词: "mpm 更新", "mpm update", "mpm check update"
code_impact - 改动风险报警 用途: 基于静态索引提示明显上游/下游风险点;用于改前优先检查,不是完整影响范围证明 参数: symbol_name (必填) 要分析的符号名(函数名或类名) 注意:必须是精确的代码符号,不支持字符串搜索 direction (默认: backward) - backward: 谁调用了我(影响上游) - forward: 我调用了谁(影响下游) - both: 双向分析 返回: - 风险等级(low/medium/high) - 明显风险点列表(前10个) - 间接风险线索数量 - 改前优先检查锚点 示例: code_impact(symbol_name="Login", direction="backward") -> 分析谁在调用 Login 函数 触发词: "mpm 影响", "mpm 依赖", "mpm impact"
code_search - 代码符号定位 (比 grep 更懂代码) 用途: 【精确定位】当你只知道名字(函数名/类名),但不知道它在哪个文件时,别用 grep,用我。 参数速查: query (必填) 符号名,如 "SessionManager"、"handleRequest" scope (可选) 限定目录,如 "internal/core" search_type (可选) any|function|class(默认 any) ⚠️ 注意:query 是符号名,不要写自然语言。 调用示例: { "query": "SessionManager" } { "query": "handleRequest", "scope": "internal/services", "search_type": "function" } 触发词: "mpm 搜索", "mpm 定位", "mpm 符号", "mpm find"
ensure_languages - 确保 tree-sitter grammar 已下载 用途: 扫描项目文件扩展名,下载缺失的 tree-sitter grammar。通常在 initialize_project 时自动执行。 参数: project_root (可选) 指定项目根路径。留空时使用当前会话项目。 触发词: "mpm 下载语法", "mpm ensure languages"
flow_trace - 业务流程追踪(文件/函数) 用途: 给 LLM 建立代码阅读候选主链: 先定位入口锚点, 再看上下游候选依赖, 按关键节点顺序阅读源码。 参数: symbol_name 函数名、类名或文件路径, 系统自动识别 scope 限定目录(大项目建议填), 例如 "internal/services" direction both|forward|backward(默认 both) mode brief|standard|deep(默认 brief) max_nodes 输出节点上限(默认 40) 触发词: "mpm 流程", "mpm flow"
No output schemas documented for any tool. LLMs cannot infer response structure, downstream tool chaining is impossible, and agents must reason about unstructured results.
No error handling documented. Tools do not specify failure modes, recovery guidance, or actionable error messages. E.g., code_impact offers no guidance on 'symbol not found' or 'index unavailable' scenarios.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | D | 57 | 2025-06-18+ | v2 |
| 2026-03-09 | F | 49 | - | v1 |
index_status - 查看 AST 索引后台任务状态 用途: 查询 initialize_project 启动的后台索引任务进度、心跳和数据库文件大小。 参数: project_root (可选) 指定项目根路径。留空时使用当前会话项目。 返回: - status/mode/started_at/finished_at - heartbeat(processed/total) - symbols.db / symbols.db-wal / symbols.db-shm 文件大小 触发词: "mpm 索引状态", "mpm index status"
initialize_project - 初始化项目环境与数据库 用途: 任何其他 MPM 操作前,必须先调用此工具初始化项目环境。它会建立数据库索引、检测技术栈并生成项目规则。 参数: project_root (必填) 项目根目录的绝对路径。如果留空,工具会尝试自动探测。 force_full_index (可选) 强制全量索引(禁用大仓库 bootstrap 策略)。默认 false。 skip_rules (可选) 跳过 AGENTS.md 协议注入。默认 false。 说明: - 手动指定 project_root 时必须使用绝对路径。 - 调用前先检查你的上下文/系统提示词中是否已包含 MPM 协议(如用户级 AGENTS.md 已有 MPM 工具协议)。若已包含,传 skip_rules=true 避免项目级 重复注入;若未包含,协议将注入项目根 AGENTS.md 顶部(marker 区段, 幂等更新),客户端自动加载。 示例: initialize_project(project_root="D:/AI_Project/MyProject") -> 初始化指定路径的项目 initialize_project(project_root="D:/AI_Project/MyProject", skip_rules=true) -> 上下文已有 MPM 协议,跳过项目级注入 触发词: "mpm 初始化", "mpm init"
memo - 项目的"黑匣子" (如果不记,等于没做) 用途: 【修改后必选】任何代码/文档修改后,严禁不留记录直接结束。 这不仅是给用户看的,更是为了你自己以后能检索到 "当时为什么这么改"。它是项目演进的唯一真理源 (SSOT)。 参数: items (必填 - JSON 数组): ⚠️ 注意:items 本身就是一个数组,即使只记录一条也要用 [{...}] 包裹 每个数组元素包含以下字段(全部必填): - category: 分类,如 "修改"、"开发"、"决策"、"重构"、"避坑" - entity: 改动的实体(文件名、函数名、模块名) - act: 简要行为描述,如 "修复Bug"、"新增功能"、"技术选型" - path: 文件路径 - content: 详细说明,解释"为什么这么改"而非只说"改了什么" lang (可选,默认 zh): 记录语言,建议始终使用中文 fact_observations (可选): 本次修改揭示的可复用项目经验(每条一句),会追加到项目根 known-facts.md 作 candidate。 只写可复用经验(格式:"在XX条件下应该/不应该YY"),不写任务完成确认或流水账;没有就别填。 完整调用示例(JSON格式): { "items": [ { "category": "修改", "entity": "SessionManager", "act": "修复空指针异常", "path": "core/session.go", "content": "添加 nil 检查,防止未初始化的配置导致 panic" } ], "lang": "zh" } 触发词: "mpm memo", "mpm 记录", "mpm 存档"
open_timeline - 项目演进可视化界面 用途: 生成并展示交互式时间线,可视化项目的开发历史和决策演进。 参数: 无 说明: - 基于 memo 记录生成 project_timeline.html。 - 会尝试自动在默认浏览器中打开生成的文件(Windows 下已加强空格/中文等路径的兼容性,优先使用系统文件关联)。 示例: open_timeline() -> 在浏览器中打开项目演进时间线 触发词: "mpm 时间线", "mpm timeline"
persona - AI 人格管理工具 用途: 切换或列出可用的 AI 人格(角色)。通过改变语气、回复风格和思维协议,提升交互体验或特定场景的处理效率。 参数: mode (默认: list) - list: 列出所有可用的预设人格。 - activate: 激活指定的人格。 - create: 新增人格(写入 .mcp-config/personas.json)。 - update: 更新人格(支持重命名)。 - delete: 删除人格。 name (activate/update/delete 模式必填) 目标人格名称或别名。 自然语言触发示例: - "激活人格 孔明" - "切换到白起人格" - "列出所有人格" - "创建人格 xxx" - "删除人格 xxx" create/update 可选字段: - new_name, display_name, hard_directive, aliases - style_must, style_signature, style_taboo, triggers 说明: - 激活人格后,LLM 将严格遵守该角色的语言特征和指令。 - 常驻角色包括诸葛(孔明)、懂王(特朗普)、哆啦(哆啦 A 梦)等。 - 建议在对话中展示简要结果(如已激活人格名称),避免输出冗长内部提示文本。 示例: persona(mode="activate", name="zhuge") -> 切换到孔明人格,使用文言文风格响应 persona(mode="create", name="my_architect", display_name="架构师", hard_directive="回答要简洁严谨") -> 新增自定义人格 触发词: "mpm 人格", "mpm persona", "激活人格", "切换人格", "切换到.*人格", "列出人格", "创建人格", "删除人格"
project_map - 项目导航仪(不知道代码在哪时用) 用途: 宏观视角:当你迷路了,或不知道该改哪个文件时,用我获取项目导航锚点。 参数速查: level symbols|structure(默认 symbols) scope 项目内相对目录(留空=整个项目) ⚠️ 注意:scope 是相对路径,如 "internal/services",不要填绝对路径。 调用示例: { "level": "structure" } { "level": "symbols", "scope": "internal/core" } 触发词: "mpm 地图", "mpm 结构", "mpm map"
system_recall - 你的记忆回溯器 (少走弯路) 用途: 【下手前推荐】想改某个功能,但不确定以前有没有类似的逻辑?或者怕踩到以前的坑? 用此工具查一下记忆库,避免重复造轮子或重蹈覆辙。 参数策略: keywords (必填) 想查什么就填什么,支持模糊匹配(空格拆分)。 category (可选) 缩小范围:如 "避坑" / "开发" / "决策" 触发词: "mpm 召回", "mpm 历史", "mpm recall"
Tool 'persona' violates single-responsibility principle. It combines list, activate, create, update, delete operations, one tool should not manage a full CRUD lifecycle. Split into separate tools: list_personas, activate_persona, create_persona, update_persona, delete_persona.
Descriptions are excessively verbose (many >800 chars, some >1000). Production baseline is 194 chars average. While cultural localization is valued, these descriptions waste tokens and bury actionable details. Refactor to 100-250 char summaries with links to detailed docs.
Many numeric parameters lack documented bounds. E.g., 'max_nodes' (default 40) has no stated minimum/maximum; 'limit' in system_recall defaults to 20 but no range. Specify constraints like 'max_nodes: 1 - 1000' to guide LLM input.
Tool 'open_timeline' has no input schema visible in source. The Input field shows '{}', indicating an empty schema. Cannot verify parameters or types. If the tool truly has no parameters, this is correct, but the tool's utility is questionable, what triggers timeline generation? Is it the current project context or explicit selection?
Parameter 'fact_observations' in 'memo' is documented as optional but its relationship to 'items' is unclear. Does each item contribute its own observation, or is fact_observations a separate top-level extraction? This ambiguity can cause silent misuse.
Tool 'initialize_project' writes to disk (AGENTS.md, project_timeline.html, database files) but its description does not clearly state the side effects or what files it creates. An LLM might call it unexpectedly, causing unwanted file modifications.
Inconsistent parameter naming conventions. Some tools use snake_case (symbol_name, project_root), others would benefit from type suffixes (e.g., 'project_path' vs 'project_root', is it a string path or an object?). Standardize to verb_noun_type format.