ActionsMCP

ActionsMCP

A Model Context Protocol server that exposes project-specific development tools (tests, linters, typecheckers) to coding assistants through a simple YAML configuration, eliminating the need for manual command approval.

Category
访问服务器

README

ActionsMCP

Write a YAML file to give your coding agents MCP access to your dev-tools: linting, tests, formatting, typechecking, etc

All Checks

Benefits

  1. Simple setup: one YAML file is all it takes to create a custom MCP server for your coding agents, and share it with your team. Similar to package.json scripts or Github Actions workflows.
  2. Tool discovery: coding agents know which dev-tools are available and the exact arguments they require. No more guessing CLI strings.
  3. Improved security: limit the list of the commands agents can run without approval, and extra validation of the arguments agents generate (e.g. ensure a file path exists inside the project).
  4. Works anywhere MCP works: Cursor, Windsurf, Cline, etc
  5. And More: strip ANSI codes/control characters, .env file loading, define required secrets without checking them in, etc

Quick Start

  1. Install with uv:
uv tool install actions-mcp
  1. Create an actions_mcp.yaml file in your project root defining your tools. For example:
actions:
  - name: "all_tests"
    description: "Run all tests in the project"
    command: "uv run python -m pytest ./tests"
    
  - name: "check_format"
    description: "Check if the source code is formatted correctly"
    command: "uvx ruff format --check ."
    
  - name: "typecheck"
    description: "Typecheck the source code"
    command: "uv run pyright ."

  - name: "test_file"
    description: "Run tests in a specific file or directory"
    command: "python -m pytest $TEST_PATH"
    parameters:
      - name: "TEST_PATH"
        type: "project_file_path"
        description: "Path to test file or directory"
  1. Run the server:

From your project path:

uvx actions-mcp

See running ActionsMCP for more runtime options.

Configuration File Specification

The actions_mcp.yaml file defines the tools that will be exposed through the MCP server.

See this project's actions_mcp.yaml as an example.

Top-level Fields

  • server_name (optional): Name of the MCP server (default: "ActionsMCP")
  • server_description (optional): Description of the MCP server (default: "Project-specific development tools exposed via MCP")
  • actions (required): Array of action definitions

Action Fields

Each action in the actions array can have the following fields:

  • name (required): Unique identifier for the tool
  • description (required): Human-readable description of what the tool does
  • command (required): The CLI command to execute. May include dynamic parameters like $TEST_FILE_PATH.
  • parameters (optional): Definitions of each parameter used in the command.
  • run_path (optional): Relative path from project root where the command should be executed. Useful for mono-repos.

Parameter Fields

Each parameter in an action's parameters array can have the following fields:

  • name (required): Parameter name (used as environment variable name in commands)
  • type (required): One of the following parameter types:
    • project_file_path: A local path within the project, relative to project root. Validated to ensure it's within project boundaries and exists.
    • required_env_var: An environment variable that must be set before the server starts. Not specified by the calling model.
    • optional_env_var: An optional environment variable. Not specified by the calling model.
    • insecure_string: Any string from the model. No validation. Use with caution.
  • description (optional): Human-readable description of the parameter
  • default (optional): Default value for the parameter

Parameter Types Explained

project_file_path

This parameter type ensures security by validating that paths are within the project boundaries:

- name: "test_file"
  description: "Run tests in a specific file"
  command: "python -m pytest $TEST_FILE"
  parameters:
    - name: "TEST_FILE"
      type: "project_file_path"
      description: "Path to test file"
      default: "./tests"

The server will validate that TEST_FILE is within the project and exists.

required_env_var

These parameters must be set in the environment before starting the server. If they are not set, the server will fail on startup asking the user to set the variables.

- name: "deploy"
  description: "Deploy the application"
  command: "deploy-tool --key=$DEPLOY_KEY"
  parameters:
    - name: "DEPLOY_KEY"
      type: "required_env_var"
      description: "Deployment key for the service"

ActionMCP will load env vars from the environment, and any set in a .env file in your working directory.

optional_env_var

Similar to required_env_var but optional:

- name: "build"
  description: "Build the application"
  command: "build-tool"
  parameters:
    - name: "BUILD_FLAGS"
      type: "optional_env_var"
      description: "Additional build flags"

insecure_string

Allows any string input from the coding assistant without validation. Use with caution:

- name: "grep_code"
  description: "Search code for pattern"
  command: "grep -r $PATTERN src/"
  parameters:
    - name: "PATTERN"
      type: "insecure_string"
      description: "Pattern to search for"

Running ActionsMCP

We recommend running ActionsMCP with uvx:

# Install
uv tool install actions-mcp
# Run
uvx actions-mcp 

Optional command line arguments include:

  • --working-directory/-wd: Typically the path to your project root. Set if not running from project root.
  • The last argument is the path to the actions_mcp.yaml file, if not using the default ./actions_mcp.yaml

Running with Coding Assistants

Cursor

Install MCP Server

Or open this cursor deeplink.

Windsurf/VSCode/etc

Most other IDEs use a variant of mcp.json. Create an entry for ActionMCP.

Note: Be sure it's run from the root of your project, or manually pass the working directory on startup:

{
  "ActionsMCP": {
    "command": "uvx",
    "args": [
      "actions-mcp",
      "--working-directory",
      "."
    ]
  }
}

Security Features

Security Benefits

ActionsMCP implements several security measures to help improve security of giving agents access to terminal commands:

  1. Allow List of Commands: Your agents can only run the commands you give it access to in your actions_mcp.yaml, not arbitrary terminal commands.

  2. Path Parameter Validation All project_file_path parameters are validated to ensure they:

    • Are within the project directory
    • Actually exist in the project
  3. Environment Variable Controls:

    • required_env_var and optional_env_var parameters are managed by the developer, not the coding assistant. This prevents coding assistants from accessing sensitive variables.
  4. Safe Command Execution:

    • Uses Python subprocess.run with shell=False to prevent shell injection
    • Uses shlex.split to properly separate command arguments
    • Implements timeouts to prevent infinite running commands

Security Risks

There are some risks to using ActionsMCP:

  1. If your agent can edit your actions_mcp.yaml, it can add commands which it can then run via MCP

  2. If your agent can add code to your project and any of your actions will invoke arbitrary code (like a test runner), the agent can use this pattern to run arbitrary code

  3. ActionMCP may contain bugs or security issues

We don't promise it's perfect, but it's probably better than giving an agent unfettered terminal access. Running inside a container is always recommended for agents.

Origin Story

I built this for my own use building Kiln. It's primarily written by Qwen-Coder-405b.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选