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

Mcp2cli Rs

MCP Server

mcp2cli是一个通用的命令行界面适配工具,能够将MCP服务器、OpenAPI规范和GraphQL API转换为交互式命令行工具。

工具数

0

提示词数

0

GitHub Stars

0

资源数

0
命令行工具Rust开发工具

安装说明

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

作者 / 组织

christopher-kapic

提供方

christopher-kapic

最后核验

2026/5/17 20:20

快速接入

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

详细介绍

mcp2cli

通用CLI适配器 主控程序 服务器、OpenAPI规范和GraphQL API转换为交互式命令行工具。

受...启发 mcp2cli(Python) --这是一个具有扩展协议支持的全新Rust重写。

安装

预编译二进制文件(推荐)

curl -fsSL https://raw.githubusercontent.com/christopher-kapic/mcp2cli-rs/master/scripts/install.sh | bash

这将安装最新版本到 /usr/local/bin。随时再次运行以进行更新。

要安装特定版本或安装到自定义目录,请执行以下操作:

# Specific version
curl -fsSL https://raw.githubusercontent.com/christopher-kapic/mcp2cli-rs/master/scripts/install.sh | bash -s v0.2.0

# Custom directory
curl -fsSL https://raw.githubusercontent.com/christopher-kapic/mcp2cli-rs/master/scripts/install.sh | INSTALL_DIR=~/.local/bin bash

来源

cargo install --git https://github.com/christopher-kapic/mcp2cli-rs.git

快速开始

主控程序

# HTTP / SSE server
mcp2cli --mcp http://localhost:3000 --list
mcp2cli --mcp http://localhost:3000 get-user --id 42

# Stdio server
mcp2cli --mcp-stdio "npx -y @modelcontextprotocol/server-filesystem /" --list

开放API

mcp2cli --spec https://petstore3.swagger.io/api/v3/openapi.json --list
mcp2cli --spec ./openapi.yaml findPetsByStatus --status available --pretty

图查询语言

mcp2cli --graphql https://countries.trevorblades.com --list
mcp2cli --graphql https://countries.trevorblades.com country --code US --pretty

特性

  • 三个协议 --MCP(HTTP、SSE、stdio)、OpenAPI和GraphQL通过一个二进制文件
  • 认证 --静态标头(--auth-header)或OAuth 2.0(PKCE和客户端凭据流)
  • 会话 --用于长期MCP连接的持久后台守护进程
  • 烘焙 --将CLI配置保存和调用为命名配置文件,可作为shell命令安装
  • 输出 --漂亮的印刷,原始的, --jq 过滤器, --toon 格式化, --head 限制数组
  • 缓存 --具有可配置TTL的基于文件的响应缓存
  • 过滤--search 全球地; --include / --exclude 地球模式和 --methods 在烘焙配置中

认证

# Static header
mcp2cli --spec api.yaml --auth-header "Authorization:Bearer $TOKEN" list-items

# OAuth 2.0 PKCE (opens browser)
mcp2cli --spec api.yaml --oauth https://auth.example.com --oauth-client-id my-app list-items

# OAuth 2.0 client credentials
mcp2cli --spec api.yaml --oauth https://auth.example.com \
  --oauth-client-id my-app --oauth-client-secret $SECRET list-items

会话

在调用之间保持MCP连接活动:

mcp2cli --mcp http://localhost:3000 --session-start my-session
mcp2cli --session my-session get-user --id 42
mcp2cli --session my-session --session-stop my-session
mcp2cli --session-list

烘焙(保存的配置)

# Save a configuration
mcp2cli bake create petstore --spec https://petstore3.swagger.io/api/v3/openapi.json --pretty

# Use it
mcp2cli @petstore --list
mcp2cli @petstore findPetsByStatus --status available

# Install as a standalone shell command
mcp2cli bake install petstore
petstore findPetsByStatus --status available

输出格式化

mcp2cli --spec api.yaml list-items --pretty          # Pretty-print JSON
mcp2cli --spec api.yaml list-items --jq '.[0].name'  # jq filter
mcp2cli --spec api.yaml list-items --head 5           # First 5 items
mcp2cli --spec api.yaml list-items --raw              # Raw text

需求

  • 锈蚀1.80+

许可证

麻省理工学院

目录标签

目录标签

命令行工具Rust开发工具CLI工具本地部署API适配器命令行界面交互式工具

接入字段

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

未说明

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

oauth

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

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

0

权限和风险

未说明oauth部署方式未说明

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

安装前确认

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

仍需确认:installCommand

来源信息

继续浏览同类 MCP