MCP代理服务

一个支持OAuth认证的MCP客户端与远程服务器连接代理工具。

  • by subduction-dev
  • Go
  • 本地部署
  • 更新于
在 GitHub 查看 subduction-dev/go-mcp-proxy

使用说明

go-mcp代理

用于将MCP客户端连接到支持OAuth身份验证的远程MCP服务器的代理。

特性

  • 代理本地客户端和远程服务器之间的MCP(模型上下文协议)请求
  • 支持PKCE的OAuth 2.0身份验证
  • 动态客户端注册
  • 自动令牌存储和刷新

安装

brew tap subduction-dev/tap
brew install --cask subduction-dev/homebrew-tap/go-mcp-proxy

用法

go-mcp-proxy <server-url> [flags]

旗帜

标志 默认值 描述
--client-id 可选OAuth客户端ID
--client-secret 可选OAuth客户端密码
--auth-port 8080 用于监听身份验证回调的端口
--scopes openid,profile,email 从授权服务器请求的范围
--data-path ~/.go-mcp-proxy 存储令牌和客户端信息的路径

Claude桌面配置

将以下内容添加到您的Claude Desktop配置文件中:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "continent-dev": {
      "command": "go-mcp-proxy",
      "args": [
        "https://whatever.com/mcp",
        "--scopes",
        "openid,profile,email,offline_access"
      ]
    }
  }
}

运作原理

  1. 代理连接到远程MCP服务器
  2. 如果需要身份验证,它将打开一个用于OAuth登录的浏览器
  3. 成功身份验证后,令牌将存储在本地
  4. 代理在客户端和服务器之间转发MCP工具调用