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

MCP CLI Rs

MCP Server

一个用于与模型上下文协议(MCP)服务器交互的跨平台命令行工具,支持发现、检查和执行工具,无需运行时依赖。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
命令行工具Rust跨平台

安装说明

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

作者 / 组织

gtrak

提供方

gtrak

最后核验

2026/5/17 20:22

快速接入

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

详细介绍

MCP-CLI

![Rust](https://www.rust-lang.org/) ![License](LICENSE)

Rust中的MCP CLI客户端——无运行时依赖的跨平台MCP服务器交互

一个CLI,用于使用惰性后台守护进程从模型上下文协议(MCP)服务器中发现、检查和执行工具。适用于Linux、macOS和 视窗 (通过命名管道)。

Vibe套件免责声明

这只是一个纯粹的实验。我不打算严重依赖它。使用原件https://github.com/philschmid/mcp-cli.

______________________________________________________________________

快速开始

# Install from source
git clone https://github.com/gtrak/mcp-cli-rs.git
cd mcp-cli-rs
cargo build --release

# Create config at ~/.config/mcp/mcp_servers.toml
cat > ~/.config/mcp/mcp_servers.toml               # Server details (transport, tools count)
mcp info         # Tool schema (parameters, description)

# Examples
mcp info filesystem
mcp info filesystem read_file
mcp info fetch fetch_url

call --执行工具

# With JSON argument
mcp call   ''
mcp call  ''

# Examples
mcp call filesystem read_file '{"path": "/etc/hosts"}'
mcp call filesystem/read_file '{"path": "/etc/hosts"}'

# With arguments from stdin
echo '{"url": "https://example.com"}' | mcp call fetch fetch_url

# Flag-style arguments (auto-converted to JSON)
mcp call fetch fetch_url --url https://example.com
mcp call filesystem read_file --path /etc/hosts --limit 100

search --按图案查找工具

mcp search "*file*"      # Find tools with "file" in the name
mcp search "read*"       # Glob pattern matching

daemon --连接缓存

mcp daemon               # Start daemon (runs in foreground)
mcp daemon --ttl 300     # Start with custom 5-minute TTL

mcp shutdown             # Stop running daemon

守护进程模式:

  • --no-daemon:直接模式,无缓存(速度较慢但更简单)
  • --auto-daemon:如果需要,生成守护进程(默认,推荐)
  • --require-daemon:如果守护进程未运行,则失败

______________________________________________________________________

发展

设置

git clone https://github.com/gary/mcp-cli-rs.git
cd mcp-cli-rs

构建

cargo build              # Debug build
cargo build --release    # Optimized release build

测试

# Run library tests
cargo test --lib

# Run integration tests
cargo test --test '*'

# Run all tests
cargo test

项目结构

src/
├── cli/              # CLI parsing and command dispatch
├── client/           # MCP client implementations (stdio, HTTP)
├── config/           # Configuration loading and types
├── daemon/           # Daemon lifecycle and management
├── error/            # Error types and handling
├── format/           # Output formatting (text, JSON)
├── ipc/              # Inter-process communication (sockets/pipes)
├── server/           # MCP server protocol handling
├── shutdown/         # Graceful shutdown handling
└── transport/        # Transport abstractions

______________________________________________________________________

故障排除

“守护进程未运行”

启动守护进程:

mcp daemon
# Or use direct mode:
mcp --no-daemon list

“找不到配置文件”

创建配置文件:

mkdir -p ~/.config/mcp
cat > ~/.config/mcp/mcp_servers.toml `
- 验证服务器是否正在运行: `mcp info `

### “连接被拒绝”或“没有这样的文件或目录”

- 验证MCP服务器包是否已安装(例如。, `npx @modelcontextprotocol/server-filesystem`)
- 检查配置中的命令路径
- 对于HTTP服务器,请验证URL是否可访问: `curl http://localhost:3000/mcp`

### Windows特定

在Windows上,命名管道要求守护进程正在运行:

Start daemon first

mcp daemon

Then use in another terminal

mcp list


### 获取调试输出

Enable debug logging

RUST_LOG=debug mcp list

Check daemon logs

cat ~/.cache/mcp-cli/daemon.log


______________________________________________________________________

## 许可证

MIT许可证-请参阅 [许可证](LICENSE) 了解详情。

______________________________________________________________________

## 另见

- [模型上下文协议](https://modelcontextprotocol.io/) --MCP规范
- [原始MCP CLI](https://github.com/f/modelcontextprotocol) --基于Bun的实现激发了这次重写

目录标签

目录标签

命令行工具Rust跨平台本地部署服务器交互模型上下文协议无依赖

接入字段

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

未说明

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

none

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

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

0

权限和风险

未说明none部署方式未说明

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

安装前确认

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

仍需确认:installCommand

来源信息

继续浏览同类 MCP