runcmd-mcp
版本: 0.1.4
runcmd-mcp 是一个Model Context Protocol (MCP) 服务,提供异步执行系统命令的功能。
功能特点
- 异步执行: 命令在后台线程中执行,不会阻塞主线程
- 状态查询: 可随时查询命令执行状态和结果
- 超时控制: 支持设置命令执行超时时间
- 资源管理: 自动管理命令执行状态
- MCP兼容: 与MCP协议兼容,可与其他MCP客户端集成
工具说明
run_command
异步执行系统命令,立即返回 token。命令将在后台执行,可通过 query_command_status 查询结果。
参数:
command(string, required): 要执行的命令字符串timeout(integer, optional, default: 30): 超时秒数 (1-3600)working_directory(string, optional): 工作目录(可选,默认为当前目录)
返回:
token(string): 任务 token (GUID 字符串)status(string): 任务状态 ("pending")message(string): 提交状态消息 ("submitted")
query_command_status
查询命令执行状态和结果。返回命令的当前状态、退出码、输出等信息。
参数:
token(string, required): 任务 token (GUID 字符串)
返回:
token(string): 任务 token (GUID 字符串)status(string): 任务状态 ("pending", "running", "completed", "not_found")exit_code(integer, optional): 命令退出码stdout(string, optional): 标准输出stderr(string, optional): 标准错误输出execution_time(number, optional): 执行时间(秒)timeout_occurred(boolean, optional): 是否发生超时
安装和使用
安装:
pip install runcmd-mcp
或者从源码安装:
pip install -e .
MCP 配置
在 MCP 客户端配置中添加:
{
"mcpServers": {
"runcmd-mcp": {
"command": "uvx",
"args": [
"runcmd-mcp"
]
}
}
}
启动MCP服务器:
runcmd-mcp
使用示例
- 调用
run_command提交命令并获取token - 使用
query_command_status查询命令执行状态和结果 - 命令在后台异步执行,不会阻塞主线程
Metadata
Release files for runcmd-mcp 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| runcmd_mcp-0.1.4.tar.gz | 6.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| runcmd_mcp-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.1 kB
Release files / runcmd_mcp-0.1.4.tar.gz
| Download URL | runcmd_mcp-0.1.4.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c6163d1147a26eab4a414c027ae1807ca56111bc745af6c9af9038edb03e3553
|
|
BLAKE2b-256 checksum How to use checksums |
10992b9b793a68c45b637b8437502750d37f13635fa9795ac54f982a3986b63e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Release files / runcmd_mcp-0.1.4-py3-none-any.whl
| Download URL | runcmd_mcp-0.1.4-py3-none-any.whl |
|---|---|
| Size | 7.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6f4e0291d0b5a707420b39b0cce5210a09079af6a38d8469cc1acf766241e5fc
|
|
BLAKE2b-256 checksum How to use checksums |
235f92ff2c92d45d565196c9208c513d88ae29d97b014ad5d1766cb83994287e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.9
|
Security for runcmd-mcp 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.