Skip to main content

Uno MCP Stdio Client - Local stdio proxy for Uno MCP Gateway with OAuth authentication

Project description

Uno MCP Stdio

PyPI version Python 3.11+ License: MIT

Local stdio proxy for Uno MCP Gateway - 为不支持 OAuth 认证的 MCP 客户端提供本地代理。

🎯 解决什么问题

许多 MCP 客户端(如 Manus、Cherry Studio)不支持 OAuth 2.0 认证,无法直接连接需要认证的 MCP 服务器。

uno-mcp-stdio 作为本地代理:

  1. 使用 stdio 模式与 MCP 客户端通信(所有客户端都支持)
  2. 在本地安全存储 OAuth token
  3. 代理请求到远程 Uno Gateway,自动附加认证信息
┌─────────────────┐     stdio      ┌─────────────────┐     HTTPS      ┌─────────────────┐
│   MCP Client    │ ◄────────────► │  uno-mcp-stdio  │ ◄────────────► │  Uno Gateway    │
│  (不支持OAuth)   │                │   (本地代理)     │   + Bearer     │   (远程服务)     │
└─────────────────┘                └─────────────────┘                └─────────────────┘

🚀 快速开始

安装

# 使用 uvx 直接运行(推荐)
uvx uno-mcp-stdio

# 或使用 pip 安装
pip install uno-mcp-stdio
uno-mcp-stdio

首次运行

首次运行时需要 OAuth 认证:

$ uvx uno-mcp-stdio
🔐 需要登录认证
📋 请在浏览器中打开以下链接完成认证:
   https://mcpmarket.cn/oauth/authorize?...

⏳ 等待认证完成...
✅ 认证成功!Token 已保存
🚀 Uno MCP Stdio 已就绪

配置 MCP 客户端

在 MCP 客户端中配置 stdio server:

Manus / Cherry Studio 配置示例:

{
  "mcpServers": {
    "uno": {
      "command": "uvx",
      "args": ["uno-mcp-stdio"]
    }
  }
}

如果使用 pip 安装:

{
  "mcpServers": {
    "uno": {
      "command": "uno-mcp-stdio"
    }
  }
}

⚙️ 配置

环境变量

变量 说明 默认值
UNO_GATEWAY_URL Uno Gateway 地址 https://uno.mcpmarket.cn/mcp
UNO_CREDENTIALS_PATH Token 存储路径 ~/.uno-mcp/credentials.json
UNO_DEBUG 调试模式 false

Token 存储

认证后的 token 存储在 ~/.uno-mcp/credentials.json

{
  "access_token": "xxx",
  "refresh_token": "xxx",
  "expires_at": 1736345678,
  "token_type": "Bearer"
}

清除认证

# 删除 token 文件重新认证
rm ~/.uno-mcp/credentials.json

🔐 认证流程

1. 启动 uno-mcp-stdio
   │
   ▼
2. 检查 ~/.uno-mcp/credentials.json
   │
   ├─ 有效 token → 直接代理请求
   │
   └─ 无/过期 token → 启动认证流程
      │
      ▼
3. 启动临时 HTTP 服务器 (localhost:随机端口)
   │
   ▼
4. 生成 OAuth URL,显示给用户
   │
   ▼
5. 用户在浏览器完成授权
   │
   ▼
6. MCPMarket 回调到本地服务器
   │
   ▼
7. 交换 token,存储到文件
   │
   ▼
8. 关闭临时服务器,开始代理

🛠️ 开发

# 克隆项目
git clone https://github.com/xray918/uno-mcp-stdio.git
cd uno-mcp-stdio

# 安装依赖
uv sync

# 运行
uv run uno-mcp-stdio

# 调试模式
UNO_DEBUG=true uv run uno-mcp-stdio

📄 License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uno_mcp_stdio-0.1.4.tar.gz (69.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

uno_mcp_stdio-0.1.4-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file uno_mcp_stdio-0.1.4.tar.gz.

File metadata

  • Download URL: uno_mcp_stdio-0.1.4.tar.gz
  • Upload date:
  • Size: 69.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.15

File hashes

Hashes for uno_mcp_stdio-0.1.4.tar.gz
Algorithm Hash digest
SHA256 cd8b9300aab05d13efbd3d4644a057257f5b123288ab7f0f37f06427f5263ee2
MD5 bb40a1fbc010fb5e837e37c726bdabbb
BLAKE2b-256 1fc3cd4e5c4ec9bda407f08b27aa1933cde0cfc07326f9a68e865caca8ba8858

See more details on using hashes here.

File details

Details for the file uno_mcp_stdio-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for uno_mcp_stdio-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 0c694ed47773e7838120288443fb214031e5abfb3e349ddbdecdb50f802e22c1
MD5 534c6bdfc39eb1246a3d0f5ce1882bd9
BLAKE2b-256 9d95f8b65a7e7347acb4b4ab17ccecd4a40d3dd50db218dbaa63e8525bac71d5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page