Token导航 LogoToken导航TokenDH.com
Just Runner MCP logo
开发工具stdio官方级别未说明来源级核验

Just Runner MCP

MCP Server

just-runner-mcp

一个将Justfile中的命令作为MCP工具暴露的服务器,允许AI助手发现和执行项目中定义的命令。

工具数

4

提示词数

0

GitHub Stars

1

资源数

0
开发工具TypeScriptClaudeClaude DesktopClaude

安装说明

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

作者 / 组织

millsaj

提供方

millsaj

最后核验

2026/5/17 20:22

运行时

Node.js

快速接入

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

命令预览

npx just-runner-mcp --justfile ./path/to/your/justfile

详细介绍

只是一个MCP命令运行器

一个模型上下文协议(MCP)服务器,它公开 食谱作为MCP工具,允许AI助手发现和执行Justfiles中定义的项目命令。

![GitMCP](https://gitmcp.io/millsaj/just-runner-mcp) ](https://www.npmjs.com/package/just-runner-mcp)

快速开始

使用npx安装并运行MCP服务器:

# Install just command runner if not already installed
# See https://github.com/casey/just#installation

# Run the MCP server pointing to a directory with a Justfile
npx just-runner-mcp --justfile ./path/to/your/justfile

# Or run from current directory (will search for Justfile)
npx just-runner-mcp

# Test via MCP inspector web UI
npx -y @modelcontextprotocol/inspector -- npx -y just-runner-mcp --justfile tests/support/basic.justfile

MCP客户端配置

添加到您的MCP客户端配置中(例如,Claude Desktop):

{
  "mcpServers": {
    "just-runner": {
      "command": "npx",
      "args": ["just-runner-mcp", "--justfile", "/path/to/your/project"]
    }
  }
}

为什么只是?

是一个命令运行器,用于在 justfile。这是向AI助手公开命令/脚本的有效选择,因为:

  • 语法简单:Justfiles使用干净、易于阅读和编写的灵感语法
  • 跨平台:适用于Linux、macOS、Windows和其他类Unix系统
  • 语言不可知论:食谱可以用任何语言编写(bash、python等)
  • 自我记录:食谱可以包括描述其作用的文档注释
  • 参数化食谱可以接受论点,使其灵活且可重复使用
  • 依赖管理:食谱可以依赖于其他食谱,确保正确的执行顺序

工具生成

MCP服务器自动解析Justfiles,并为每个配方生成MCP工具。每个工具都以配方命名,包括:

  • 名字:justfile中的配方名称
  • 描述:摘自文件评论(以…开头的行 # 食谱上方)
  • 参数:自动检测配方参数及其默认值和类型

例如,这个justfile配方:

# Compile Latex Document. FILEPATH must be an absolute path
compile-latex FILEPATH:
    tectonic {{FILEPATH}}

# Compile Typst Document. FILEPATH must be an absolute path
compile-typst FILEPATH:
    typst compile --format pdf {{FILEPATH}}
    typst compile --format png {{FILEPATH}} "page-{0p}-of-{t}.png"

将向MCP客户端公开以下工具:

{
  "tools": [
    {
      "name": "compile-latex",
      "description": "Run just recipe: compile-latex\nCompile Latex Document. FILEPATH must be an absolute path",
      "inputSchema": {
        "type": "object",
        "properties": {
          "FILEPATH": {
            "type": "string",
            "description": "Required"
          }
        },
        "required": ["FILEPATH"]
      }
    },
    {
      "name": "compile-typst",
      "description": "Run just recipe: compile-typst\nCompile Typst Document. FILEPATH must be an absolute path",
      "inputSchema": {
        "type": "object",
        "properties": {
          "FILEPATH": {
            "type": "string",
            "description": "Required"
          }
        },
        "required": ["FILEPATH"]
      }
    }
  ]
}

CLI选项

MCP服务器支持多种命令行选项:

Usage: just-mcp [options]

Expose Justfile recipes as MCP tools

Options:
  --justfile 
     Path to Justfile (default: "Justfile")
  --just-binary 
  Path to just binary (default: "just")
  --timeout         Timeout for recipe execution in milliseconds (default: 30000)
  --list-tools          Print available tools and exit
  --help                Show help message
  -h                    display help for command

例子

本节演示了一个开发项目的实用Justfile及其生成的MCP工具。每个食谱都成为AI助手可以发现和执行的工具。

简单开发Justfile

以下是一个典型开发工作流程的justfile:

# Install project dependencies
install:
    npm install

# Start the development server
dev port="3000":
    echo "Starting dev server on port {{port}}"
    npm run dev -- --port {{port}}

# Run all tests
test:
    npm test

# Deploy to staging environment
deploy-staging: build test
    echo "Deploying to staging..."
    ./scripts/deploy.sh staging

MCP工具输出

当你奔跑时 just-runner-mcp --list-tools,您将得到以下JSON响应,显示所有可用工具:

{
  "tools": [
    {
      "name": "install",
      "description": "Run just recipe: install\nInstall project dependencies",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": []
      }
    },
    {
      "name": "dev",
      "description": "Run just recipe: dev\nStart the development server",
      "inputSchema": {
        "type": "object",
        "properties": {
          "port": {
            "type": "string",
            "description": "Parameter: port (default: 3000)"
          }
        },
        "required": []
      }
    },
    {
      "name": "test",
      "description": "Run just recipe: test\n",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": []
      }
    },
    {
      "name": "deploy-staging",
      "description": "Run just recipe: deploy-staging\nDeploy to staging environment",
      "inputSchema": {
        "type": "object",
        "properties": {},
        "required": []
      }
    }
  ]
}

有了这些工具,人工智能助手可以帮助您完成常见的开发任务,如“安装依赖项”、“在端口8080上启动开发服务器”、“运行测试”或“部署到测试阶段”。

替代方案

还有其他方法可以将Just与MCP集成:

  • 只是mcp -一个基于Rust的MCP服务器,提供更全面的Justfile支持和处理。这个货物包提供了额外的功能,而不仅仅是将食谱作为工具暴露给LLM。

此存储库(just-runner-mcp)采取了一种最小化的方法,专门专注于将Just recipes作为MCP工具公开,供AI助手发现和执行。

发展

# Run all tests
just test

# Run specific test file
just test tests/integration.test.ts

许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

目录标签

目录标签

开发工具TypeScriptClaude命令运行器本地部署AI助手集成自动化脚本

支持客户端

Claude DesktopClaude

接入字段

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

stdio

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

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

just-runner-mcp

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

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

0

权限和风险

stdionone部署方式未说明

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

安装前确认

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

来源信息

继续浏览同类 MCP