只是mcp
   

👋 一种让LLMs说话的方法
一个生产就绪的MCP服务器,提供与 就 命令运行器,使AI助手能够通过标准化的MCP协议发现、执行和反思Justfile配方。
🎯 为什么Just+MCP=更好的代理执行
上下文保存抽象
如果不是很明显,那么让LLM使用Just与bash的好处是,运行Just命令(通过MCP)提供了一种上下文保存抽象,在这种抽象中,它们不需要浪费上下文打开/读取bash文件、Python脚本或其他构建工件。LLM通过MCP简单地获取命令、参数和提示——它在它们的内存中,因为“这些是您可用的命令”
消除了Justfile学习曲线
不再监视LLM的执行 just -l 要获取命令列表,不可避免地要开始读取justfile,然后尝试编写justfile语法(就像它是Makefile一样),损坏justfile,并造成糟糕的体验。Just不断发展的语法在今天的前沿模型中根本没有足够大的语料库——我们需要训练数据集中有justfiles的更流行的repo。
比原始Bash访问更安全
只是mcp从根本上比bash更安全。如果你读过HackerNews,每天至少有一篇关于操作员的故事,他们的LLM开始遗忘、产生幻觉,并最终崩溃——删除文件和做讨厌的不必要的事情。在不仔细监控上下文消耗的情况下,让LLM无监督、无限制地访问bash是灾难的根源。
使用Justfile可以解决这个问题。 即使LLM修改了自己的justfile,下一个上下文也会被justfile记忆(希望在幂等git仓库中)。这种抽象保护了llm免受命令行复杂性的影响,在命令行复杂性中,对当前工作目录的幻觉或注意力跟踪会导致它脱轨并坠入悬崖。
强大的代理执行工具
Just mcp非常适合任何从事代理执行的人:
- 超低开销 -可能比其他任何工具都好
- 人性化 -justfiles对人类来说很容易,对LLM来说开销很低
- 又快又脏 -虽然有些人更喜欢完整的Python FastAPI服务器,但mcp就像
- sm0l型号友好 -适用于具有8k-32k上下文限制的自托管GPU/CPU开源模型
内置安全模式
只是有一些有用的模式来介绍:
- 透明日志记录 而不会分散代理人的注意力
- 二次模型检查 -使用sm0l模型扫描命令,在执行前询问“这有害吗?”
- 类似Python装饰器的模式 用于命令验证
- 临时处决 由git repos支持
00吨
b00t mcp create just-mcp -- bash just-mcp --stdio "${REPO_ROOT}"
b00t mcp export just-mcp🚀 当前状态: 完成67% (8/12核心任务)
✅ 已实现的功能
- 🏗️ 完整的MCP服务器 -rmcp 0.3.0与MCP 2024-11-05协议完全集成
- 📋 食谱发现 -解析并列出所有可用的Justfile食谱
- ⚡ 配方执行 -使用参数执行配方并捕获结构化输出
- 🔍 食谱反思 -获取详细的配方信息、参数和文档
- ✅ Justfile验证 -语法和语义验证以及错误报告
- 🌍 环境管理 -全面的.env文件支持和变量扩展
- 🧪 全面测试覆盖 -33个通过集成和单元测试套件的测试
🎯 MCP工具可用
list_recipes-在justfile中列出所有可用的食谱run_recipe-使用可选参数执行特定配方get_recipe_info-获取特定食谱的详细信息validate_justfile-验证justfile是否存在语法和语义错误
🏃 快速开始
安装
选择您喜欢的安装方法:
npm(JavaScript/TypeScript)
# Install globally
npm install -g just-mcp
# Or use with npx (no installation required)
npx just-mcp --stdiopip(Python)
# Install with pip
pip install just-mcp
# Or use with uvx (recommended)
uvx just-mcp --stdio货物(生锈)
# Install from crates.io
cargo install just-mcp
# Or build from source
git clone https://github.com/promptexecution/just-mcp
cd just-mcp
cargo build --releasepkgx(pkgxdev)
pkgx just-mcp --stdiopkgx 下载GitHub发布的特定于平台的tarball(just-mcp-*-*.tar.gz),将可执行文件提取到 ${PKGX_DIR:-$HOME/.pkgx}/bin,并使用您传递的参数运行CLI。将该bin目录添加到shell的 PATH 如果你需要 just-mcp 长期可用。包装清单存在于 并镜像 pkgxdev/pantry 进入。
使用Docker
# Pull the latest image from GitHub Container Registry
docker pull ghcr.io/promptexecution/just-mcp:latest
# Run with Docker
docker run --rm -v $(pwd):/workspace ghcr.io/promptexecution/just-mcp:latest --stdio
# Build locally
docker build -t just-mcp:local .
docker run --rm -v $(pwd):/workspace just-mcp:local --stdio可用的Docker镜像标签:
latest-最新稳定版本X.Y.Z-特定版本(例如。,0.1.0)X.Y-最新补丁版本(例如。,0.1)X-最新次要版本(例如。,0)
Claude桌面集成
使用npm/npx
添加到您的Claude Desktop MCP配置中:
使用二进制
{
"mcpServers": {
"just-mcp": {
"command": "npx",
"args": ["-y", "just-mcp", "--stdio"]
}
}
}使用pip/uvx
{
"mcpServers": {
"just-mcp": {
"command": "uvx",
"args": ["just-mcp", "--stdio"]
}
}
}使用货物或手动安装
{
"mcpServers": {
"just-mcp": {
"command": "/path/to/just-mcp",
"args": ["--stdio"]
}
}
}使用Docker
{
"mcpServers": {
"just-mcp": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"${workspaceFolder}:/workspace",
"ghcr.io/promptexecution/just-mcp:latest",
"--stdio"
]
}
}
}使用示例
# Run as MCP server
just-mcp --stdio
# Run in specific directory
just-mcp --directory /path/to/project --stdio
# Using Docker
docker run --rm -v $(pwd):/workspace ghcr.io/promptexecution/just-mcp:latest --stdio🧪 测试
综合测试套件
# Run all tests (33 tests)
cargo test
# Run specific test suites
cargo test --test basic_mcp_test # Protocol compliance testing
cargo test --test mcp_integration_working # SDK integration testing测试体系结构
basic_mcp_test.rs-使用原始JSON-RPC进行直接协议合规性测试mcp_integration_working.rs-使用rmcp客户端进行类型安全SDK集成测试- 单元测试 -超过25个测试,涵盖解析器、执行器、验证器和环境模块
📚 建筑
项目结构
just-mcp/
├── src/main.rs # CLI binary
├── just-mcp-lib/ # Core library
│ ├── parser.rs # Justfile parsing
│ ├── executor.rs # Recipe execution
│ ├── validator.rs # Validation logic
│ ├── environment.rs # Environment management
│ └── mcp_server.rs # MCP protocol implementation
├── tests/ # Integration tests
└── justfile # Demo recipes技术栈
- 锈蚀1.82+ 支持async/await
- rmcp 0.3.0 -Rust官方MCP SDK
- Serde/Serde JSON -JSON序列化
- 一团糟 -结构化错误处理
- 东京 -异步运行时
🔄 发展路线图
🎯 下一个优先任务 (剩余33%)
- LSP风格完成系统 -配方和参数的智能自动补全
- 增强诊断 -高级语法错误报告和建议
- 虚拟文件系统 -支持stdin、远程源和内存缓冲区
- 发布准备 -文档、CI/CD和板条箱出版物
🚀 未来的增强功能
- 自定义配方类型的插件系统
- 与其他构建工具集成
- 大型justfiles的性能优化
- 高级依赖关系可视化
📖 使用模式
配方执行
// List available recipes
await client.callTool("list_recipes", {});
// Execute recipe with parameters
await client.callTool("run_recipe", {
"recipe_name": "build",
"args": "[\"--release\"]"
});
// Get recipe information
await client.callTool("get_recipe_info", {
"recipe_name": "test"
});验证
// Validate justfile
await client.callTool("validate_justfile", {
"justfile_path": "./custom.justfile"
});🤝 贡献
该项目遵循 _00吨_ 开发方法学:
- TDD方法 -先测试,后实施
- 功能分支 -切勿直接在主分支机构工作
- 结构化错误 -使用snafu进行错误管理
- Git工作流 -带有描述性消息的干净提交
开发命令
just build # Build the project
just test # Run tests
just server # Start MCP server
just clean # Clean build artifacts📄 许可证
该项目已获得许可 许可证.
🚀 发布设置和CI/CD
✅ 已完成安装
可可豆和传统承诺
- 安装cocogitto用于常规提交执行
- 已配置
cog.toml具有正确的提交类型和更改日志设置 - 设置git挂钩用于提交消息传递(
commit-msg)预推测试
GitHub操作CI/CD
- CI管道 (
ci.yml):多平台测试(Ubuntu、Windows、macOS)、格式化、clippy、提交linting - 释放管道 (
release.yml):自动版本控制、变更日志生成、GitHub发布和crates.io发布 - 二进制构建 (
build-binaries.yml):npm和pip包的跨平台二进制编译 - 集装箱管道 (
container.yaml):多平台Docker镜像构建(linux/amd64、linux/arm64)推送到GitHub容器注册表
Docker镜像
- 多平台构建
linux/amd64和linux/arm64 - 使用静态musl二进制文件和划痕基础图像实现最小图像大小
- 具有语义版本控制的自动标记(major、major.minor、major.minor.patch、latest)
- 发布到GitHub容器注册表(ghcr.io)
- 与发布工作流集成,实现自动部署
Crates.io准备
- 更新了两者
Cargo.toml具有完整元数据(描述、关键字、类别、许可证等)的文件 - 为仅用于开发的文件添加了适当的排除项
- 已验证的MIT许可证已到位
文件和结构
- README.md已准备好生产,并附有安装和使用说明
- 创建初始
CHANGELOG.md用于发布跟踪 - 更新
.gitignore具有Rust特定的条目
🚀 生产部署
开发工作流程:
- 所有提交都必须遵循传统的提交格式(由git钩子强制执行)
- 使用
feat:,fix:,docs:自动版本控制的前缀 - 推到
main分支触发自动发布和crates.io发布 - 库测试通过✅ (25/25)具有全面的测试覆盖率
发布流程:
- 自动版本控制:Cocogitto分析提交消息以进行语义版本控制
- GitHub发布:自动生成变更日志和GitHub发布创建
- 二进制分布:为Linux(x86_64,aarch64)、macOS(x86_14,aarch63)和Windows(x86\\u64)预构建的二进制文件
- Crates.io出版:图书馆板条箱(
just-mcp-lib)先发布,然后发布二进制crate(just-mcp) - npm发布:用于简化Node.js/TypeScript集成的包装包
- PyPI出版:用于pip/uvx安装的Python包装包
- CI/CD管道:使用格式化和clippy检查进行多平台测试(Ubuntu、Windows、macOS)
安装方法:
# npm (JavaScript/TypeScript ecosystems)
npm install -g just-mcp
# or
npx just-mcp --stdio
# pip (Python ecosystems)
pip install just-mcp
# or
uvx just-mcp --stdio
# cargo (Rust ecosystem)
cargo install just-mcp
# Download pre-built binaries
wget https://github.com/promptexecution/just-mcp/releases/latest/download/just-mcp-x86_64-unknown-linux-gnu.tar.gz
# Or use Docker
docker pull ghcr.io/promptexecution/just-mcp:latest
# Or download from GitHub releases
wget https://github.com/promptexecution/just-mcp/releases/latest/download/just-mcp