Skip to main content
Glama

webshare-mcp

把 Webshare 官方 API 包成 MCP 服务的零依赖实现。填入你自己的 API key,任何支持 MCP 的客户端(Claude、Cursor 等)都能直接管理你的 Webshare 账号,不用再开网页后台。

能做什么

  • 查账号、订阅与套餐(周期、自动续费、流量上限、替换与刷新额度)

  • 列代理与代理配置(国家、城市、ASN、有效性)

  • 看流量统计(总流量、请求数、成功与失败)

  • 换 IP(支持按地址、IP 段、国家、ASN 定向,默认预演不真换)

  • 刷新整个代理列表(需要套餐有按需刷新额度)

  • 管理 IP 白名单(免密使用代理的公网 IP)

  • 关闭自动续费

Related MCP server: wg-easy-mcp

快速开始

  1. 在 Webshare 后台生成 API key:Dashboard -> Settings -> API Keys。注意 API key 拥有账号的完整权限,请妥善保管,不要提交到任何仓库。

  2. 把 key 放进环境变量:

export WEBSHARE_API_KEY="你的 API key"
  1. 在你的 MCP 客户端里注册本服务。以 Claude Code 为例:

claude mcp add webshare -- python3 /path/to/webshare-mcp/server.py

其他客户端参照同样的 stdio 配置:命令 python3,参数为本仓库 server.py 的路径,环境变量带 WEBSHARE_API_KEY。

  1. 对你的 AI 说一句「列一下我的 Webshare 代理」即可验证。

环境变量

变量

必填

说明

WEBSHARE_API_KEY

是

你的 Webshare API key

WEBSHARE_API_BASE

否

API 基础地址,默认 https://proxy.webshare.io

WEBSHARE_AUTH_STYLE

否

默认 token(Authorization: Token <KEY>);raw 表示直接把 KEY 作为 Authorization 头的值,供凭证托管场景使用

安全默认值

  • 列代理与查配置时默认打码代理密码与下载 token,显式传 include_credentials=true 才返回原文。

  • 换 IP 默认只做 dry_run 预演,execute=true 才真正更换(消耗月替换额度且不可逆,旧 IP 无法找回)。

  • 刷新列表、删白名单、关自动续费都要求显式传 confirm=true。关自动续费时官方会同时移除已保存的支付方式,请知悉。

实现说明

  • 纯 Python 标准库实现 MCP 的 stdio 传输(行分隔 JSON-RPC),无需 pip 安装任何依赖,Python 3.10+ 即可运行。

  • 接口依据 Webshare 官方 API 文档(https://apidocs.webshare.io/):账号与订阅走 /api/v2,换 IP 走 /api/v3/proxy/replace/。

  • 本项目与 Webshare 官方无关,是社区实现;官方另有托管 MCP 与 CLI,可在官方文档的 CLI & SDKs 与 MCP Server 页面查看。

自检

python3 test_smoke.py

该脚本不访问网络,只验证服务能启动并正确响应 initialize 与 tools/list。

License

MIT

Available Tools

14 tools
webshare_add_ip_authorizationC

新增一条 IP 白名单。

Inputs: ip_address (required).

webshare_cancel_auto_renewalA

关闭自动续费。注意官方会同时移除已保存的支付方式,套餐可用到当前周期结束。必须传 confirm=true。

Inputs: confirm.

webshare_delete_ip_authorizationB

删除一条 IP 白名单。必须传 confirm=true。

Inputs: auth_id (required), confirm.

webshare_list_ip_authorizationsA

列出 IP 白名单(被授权可免密使用代理的公网 IP)。

Inputs: no named parameters.

webshare_list_proxiesB

列出代理(地址、端口、国家、城市、ASN、有效性)。默认打码密码,include_credentials=true 才返回原文。

Inputs: mode, page_size, include_credentials.

webshare_list_replacementsC

查看换 IP 记录与状态(含预演记录)。

Inputs: no named parameters.

webshare_planA

查看套餐详情:价格、流量上限、代理数量、每月替换与刷新额度、附加项开关。不传 plan_id 时用当前订阅的套餐。

Inputs: plan_id.

webshare_profileA

查看 Webshare 账号资料(id、邮箱、姓名、邮箱验证状态)。

Inputs: no named parameters.

webshare_proxy_configB

查看代理配置:国家与 ASN 分配、可替换的国家、ASN 与 IP 段池。默认打码凭证字段。

Inputs: include_credentials.

webshare_refresh_proxiesA

刷新整个代理列表(需要套餐有按需刷新额度)。必须传 confirm=true。

Inputs: confirm.

webshare_replace_proxyA

更换代理 IP。默认 dry_run 预演不真正更换,execute=true 才执行并消耗月替换额度(不可逆)。to_type 可选 ip_address、ip_range、country、asn;with_type 可选 country、asn、ip_range、any。

Inputs: to_type (required), to_values (required), count, execute, +2 more.

webshare_statsA

查看聚合流量统计:总流量、请求数、成功与失败数、已用国家。

Inputs: no named parameters.

webshare_subscriptionA

查看当前订阅:计费周期、是否自动续费、剩余额度积分、是否暂停或限速。

Inputs: no named parameters.

webshare_whatsmyipA

查询当前请求方的公网 IP(加白名单前确认用)。

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 14 tools

    Disambiguation4/5

    Tools map to distinct resources and actions (proxy listing vs. proxy config, replacement history vs. replace action), and destructive operations are clearly separated. Minor possible confusion remains between webshare_plan, webshare_subscription, and webshare_stats when an agent just wants quota or usage information.

    Naming Consistency5/5

    All tools share the webshare_ prefix and snake_case naming, with predictable action/resource segments such as list_proxies, add_ip_authorization, and cancel_auto_renewal. Read-only singleton resources use noun names, but the overall convention is consistent and readable.

    Tool Count5/5

    At 14 tools, the surface is well-scoped for a proxy-account management server. Each tool covers a meaningful operation, and no obvious redundant or filler tools are present.

    Completeness4/5

    Core lifecycle is covered: account/subscription/plan views, proxy listing/config/stats, replacement and refresh operations, IP authorization CRUD, current-IP lookup, and cancellation of auto-renewal. Minor gaps include no way to re-enable auto-renewal or update account/profile or payment settings.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Lets agents fetch web data and manage rotating proxies through the Floppydata API v2 directly from MCP clients.
      14
      19 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for administering wg-easy (WireGuard Easy) instances, enabling listing, creating, updating, enabling/disabling, and deleting WireGuard clients, fetching configs and QR codes, and inspecting server status via the wg-easy REST API.
      11
      82 npm
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      MCP server for managing a Marzban proxy/VPN panel — full user, subscription, node, host, and config lifecycle through 21 tools and 3 investigation prompts. Enforces env-only credentials, profile-gated tool visibility (readonly/standard/full), and a confirmation-token gate on every destructive call.
      15
      76 npm
      26
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables management of WHMCS installations via the WHMCS API, providing tools for clients, products, billing, support tickets, domains, orders, and system administration.
      62
      64 npm
      MIT