概述
mms 是一个Rust CLI,用于管理模型上下文协议(MCP)服务器目录,而不依赖于外部配置脚本。嵌入权威服务器列表,保存 ~/.mcp.json 同步(解析环境占位符,如 ${MMS_GITHUB_PAT} 当设置时),镜像将本地目录投影到Gemini和Codex配置中,以便助手可以自动从正确的上下文开始。
特性
- 嵌入式主目录 –规范的MCP服务器列表随二进制文件一起提供,并保存在
~/.config/mms/master.json. - 全局初始化 –自动提供
~/.mcp.json用环境变量替换(例如。${MMS_GITHUB_PAT})当第一次需要的时候。 - 项目工作流程 –创建、填充和修剪本地
.mcp.json文件与init,add,remove,以及clean命令。 - 助理集成 –
sync更新.gemini/settings.json在工作空间和[mcp_servers]内部堵塞~/.codex/config.toml. - 命令发现 –
command打印完整的服务器启动命令,并可以将其复制到macOS上的剪贴板。
安装
cargo install --path .
# or build locally
cargo build --release优化后的二进制文件在以下时间发射 target/release/mms.
用法
mms [OPTIONS]
Commands:
init Initialise a project-local .mcp.json (empty or from global)
list Display servers registered in ~/.mcp.json
add Add servers from the global catalogue into the project file
remove Remove a server from the project file
command Show the launch command for a server (optionally copy it)
sync Sync the project file with Gemini and Codex configurations
clean Remove generated catalogues and caches (local/global/master)
help Print command-specific help
Options:
-v, --verbose Enable verbose logging
--version Show version information
-h, --help Show the global usage message典型工作流程
# Create an empty project catalogue in the current directory
mms init
# Add two servers maintained in ~/.mcp.json
mms add context7 serena
# Regenerate Gemini and Codex config from the project file
mms sync
# Inspect the launch command for a server
mms command context7 --copy
# Reset generated files (local catalogue + Gemini settings)
mms clean清除命令标志
mms clean [--local] [--gemini] [--global] [--master] [--all] [--dry-run]--local删除最近的.mcp.json从当前目录中发现(未提供标记时的默认选择)。--gemini删除.gemini/settings.json在项目目录旁边。--global移除~/.mcp.json因此,在下一个命令中,它将从嵌入式主机中重新创建。--master删除缓存的主副本~/.config/mms/master.json.--all一次选择每个范围(本地、Gemini、Codex、全球、主)。--dry-run在不接触文件系统的情况下预览删除。
环境变量
- 设置秘密,例如
MMS_GITHUB_PAT在shell中运行命令之前。CLI可以 不 负载.env文件自动。 - 当变量存在时,
~/.mcp.json用解析值写入;否则${MMS_GITHUB_PAT}占位符仍供下游工具解释。
测试
该项目依赖于在隔离的临时工作区内对编译的二进制文件进行集成测试:
cargo test测试助手住在 tests/common/ 沙箱 HOME 因此操作永远不会触及真实的用户文件。
更新嵌入式目录
JSON目录捆绑在 src/config/master_data.json 被视为唯一的真理来源 mms。当上游MCP服务器定义更改时,刷新该文件并重建CLI,以便嵌入式主目录和任何派生的全局目录保持对齐。
