MCP server for executing shell, Python, and Node.js commands locally
Project description
timeverse-command-mcp
跨平台执行 shell / Python / Node 命令的 MCP (Model Context Protocol) Server
它能做什么?
让任意支持 MCP 的 AI 客户端(Timeverse Studio、Claude Desktop、Cursor、Continue 等)通过三个工具直接操作你的本地机器:
| 工具 | 作用 | 适用平台 |
|---|---|---|
bash |
执行 shell 命令 | macOS / Linux / Windows |
python |
执行 Python 代码片段 | 全平台 |
node |
执行 JavaScript 代码片段 | 全平台 |
典型用法(让 Claude 帮你做):
"用 bash 看一下 /tmp 目录下最大的 5 个文件"
"用 python 算一下 1+2+...+100"
"用 node 把这个 JSON 解析后告诉我 user.name"
安装
方式 1:pip(推荐)
pip install timeverse-command-mcp
安装完成后会得到一个 timeverse-command-mcp 命令。
方式 2:源码安装(开发用)
git clone https://github.com/elimyliu/timeverse-command-mcp.git
cd timeverse-command-mcp
pip install -e ".[dev]"
接入 Claude Desktop
编辑 Claude Desktop 配置文件(位置见下表):
| 操作系统 | 配置路径 |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
加入以下内容:
{
"mcpServers": {
"timeverse-command": {
"command": "timeverse-command-mcp",
"args": [],
"env": {}
}
}
}
重启 Claude Desktop,工具列表中会出现 bash / python / node 三个工具。
详细配置说明、Cursor / Continue / Cline 等其他客户端的接入方式,请参考 docs/USAGE.md。
Python API
除了作为 MCP Server,本包也可以作为 Python 库使用:
import asyncio
from timeverse_command import AsyncCommandSession
async def main():
session = AsyncCommandSession(
tool_call_id="demo-1",
command="echo hello && echo world",
tool_name="bash",
)
async for chunk in session.run():
if chunk["stream"] == "stdout":
print(f"[out] {chunk['delta']}")
elif chunk["stream"] == "exit":
print(f"[exit] code={chunk['exit_code']} status={chunk['status']}")
asyncio.run(main())
输出:
[out] hello
[out] world
[exit] code=0 status=success
更多 API(取消、全局执行器等)见 docs/USAGE.md。
开发
# 克隆
git clone https://github.com/elimyliu/timeverse-command-mcp.git
cd timeverse-command-mcp
# 安装依赖(含 dev 工具)
pip install -e ".[dev]"
# 运行测试
pytest
# 代码风格
ruff check src/
ruff format src/
# 类型检查
mypy src/
协议
- MCP 传输: stdio(标准)
- 不依赖任何私有扩展,可在所有支持 MCP stdio 的客户端中使用
- 增强能力(流式 / 取消 / 危险确认)由 TimeVerse Studio 客户端专属提供,其他客户端以"基础能力"运行
许可证
MIT © TimeVerse Studio
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file timeverse_command_mcp-0.1.0.tar.gz.
File metadata
- Download URL: timeverse_command_mcp-0.1.0.tar.gz
- Upload date:
- Size: 10.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a9fe498e0711ba9f151284b7d3e750aea9e62ebc101bba7c7dd8a39a4ebf3ce8
|
|
| MD5 |
11c70f7ee1d35c4abc3d33d923a38c17
|
|
| BLAKE2b-256 |
17f14bc97179c6e1eb8226271dc341a5ed14ad46ee974ac68fe05a56a81275e6
|
Provenance
The following attestation bundles were made for timeverse_command_mcp-0.1.0.tar.gz:
Publisher:
release.yml on elimyliu/timeverse-command-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
timeverse_command_mcp-0.1.0.tar.gz -
Subject digest:
a9fe498e0711ba9f151284b7d3e750aea9e62ebc101bba7c7dd8a39a4ebf3ce8 - Sigstore transparency entry: 1925900610
- Sigstore integration time:
-
Permalink:
elimyliu/timeverse-command-mcp@00229dadc68765a7722fb823d2ee2f9494d9c82a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/elimyliu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@00229dadc68765a7722fb823d2ee2f9494d9c82a -
Trigger Event:
push
-
Statement type:
File details
Details for the file timeverse_command_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: timeverse_command_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15c35737a36533d0573a3b4f06b4305243870695582d8170aefa05e93e84aec7
|
|
| MD5 |
c24439a45dcbf7f82237eca381ee9d22
|
|
| BLAKE2b-256 |
07954b86d8c730a46009f4cbf43165bc8451e56cba249cb867a6a5b24a000790
|
Provenance
The following attestation bundles were made for timeverse_command_mcp-0.1.0-py3-none-any.whl:
Publisher:
release.yml on elimyliu/timeverse-command-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
timeverse_command_mcp-0.1.0-py3-none-any.whl -
Subject digest:
15c35737a36533d0573a3b4f06b4305243870695582d8170aefa05e93e84aec7 - Sigstore transparency entry: 1925900820
- Sigstore integration time:
-
Permalink:
elimyliu/timeverse-command-mcp@00229dadc68765a7722fb823d2ee2f9494d9c82a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/elimyliu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@00229dadc68765a7722fb823d2ee2f9494d9c82a -
Trigger Event:
push
-
Statement type: