Skip to content

Proxy MCP Server: Give Claude Code, Codex and Cursor a Proxy

An AI coding tool can call a proxy MCP server instead of you pasting proxy details into the chat. This guide explains what that is, how local and remote servers differ, how to install one in three tools and how to send the server's own traffic through a proxy.

Two different things called a proxy MCP server

A proxy MCP server is an MCP server that manages IP proxies for an AI assistant. The assistant calls a named tool, for example one that returns a proxy URL for a country or opens a page through a proxy, and the username, password and API key stay in the server's configuration instead of in the chat.

The name is easy to mix up with mcp-proxy, an open-source tool whose repository describes it as "A bridge between Streamable HTTP and stdio MCP transports". It moves MCP messages between two transports so that a client that speaks only one can reach a server that speaks the other. It has no connection to IP addresses, countries or exit nodes. In this guide, "proxy MCP server" always means the first kind.

Local and remote MCP servers

The MCP documentation separates servers by where they run. A local server uses the stdio transport: the client starts it as a process on your own machine and talks to it over standard input and output, with no network overhead. A remote server uses the Streamable HTTP transport: it runs at a URL, and that transport supports bearer tokens, API keys and custom headers for authentication.

That decides where the key goes. For a local server, the client passes the key to the process as an environment variable. For a remote server, the key is normally sent as an HTTP header on each request. Either way, the point of a proxy MCP server is that the key never has to appear in a prompt.

What to check before you install one

Read the tool list first. A proxy MCP server runs with your credentials and can call paid infrastructure, so look at every tool name and description.

Check whether any tool can buy something or spend your wallet. If one can, decide whether you want that, and prefer servers where purchasing is absent.

Check where the key lives. It belongs in an environment variable or a client configuration file that you do not commit to version control, never in a prompt, because prompts end up in conversation history.

proxy302-mcp, the official MCP server

proxy302-mcp is the official Proxy302 MCP server, open source on GitHub and maintained by the Proxy302 team. Account and billing questions go to Proxy302 support; bugs in the server go to its GitHub issues.

It is free and open source (MIT), installed from GitHub with npx, runs on your own machine over stdio and needs Node.js 20+ and a Proxy302 API key in the PROXY302_API_KEY environment variable. Its tools cover account usage and wallet balance, countries and regions, products and plans, a ready rotating residential proxy URL for a country, your own proxies, and fetching a URL through the proxy (plain HTTP, no JavaScript rendering).

It cannot buy anything or spend your wallet. Its only write is creating a free dynamic proxy credential, which is off by default, and traffic is billed only when used. The Proxy302 API itself is documented in the developer docs.

Install proxy302-mcp in Claude Code, Codex CLI and Cursor

proxy302-mcp is a local stdio server started with npx, so all three tools below start it as a process and pass it PROXY302_API_KEY. Replace <key id>:<secret> with your own API key. The key goes in the environment variable, never in a prompt.

Claude Code. The server name comes before -e, and -- separates Claude Code's options from the server command. -s user makes it available in all projects; leave it out for the current project only.

Claude Code: install command

claude mcp add proxy302 -s user -e PROXY302_API_KEY="<key id>:<secret>" -- npx -y github:proxy302/proxy302-mcp

Example only: replace <key id>:<secret> with your own key.

Install in Codex CLI

Codex CLI. Use the command, or write the same server into ~/.codex/config.toml.

Codex CLI: install command

codex mcp add proxy302 --env PROXY302_API_KEY="<key id>:<secret>" -- npx -y github:proxy302/proxy302-mcp

Example only: replace <key id>:<secret> with your own key.

Codex CLI: config.toml form

[mcp_servers.proxy302]
command = "npx"
args = ["-y", "github:proxy302/proxy302-mcp"]
env = { PROXY302_API_KEY = "<key id>:<secret>" }

The same server written into ~/.codex/config.toml.

Install in Cursor

Cursor. Add the server to ~/.cursor/mcp.json for all projects, or to .cursor/mcp.json inside one project.

Cursor: mcp.json

{
  "mcpServers": {
    "proxy302": {
      "command": "npx",
      "args": [
        "-y",
        "github:proxy302/proxy302-mcp"
      ],
      "env": {
        "PROXY302_API_KEY": "<key id>:<secret>"
      }
    }
  }
}

Example only: replace <key id>:<secret> with your own key.

Remote MCP endpoint

A remote MCP endpoint is also available at https://proxy302.com/v1/mcp, so nothing has to be installed. The client connects over Streamable HTTP and sends your Proxy302 API key in the Authorization header as Bearer <key id>:<secret>. Its 9 tools cover account balance and usage, country and region lists, products and prices, a rotating residential proxy for a country, your proxies with the exit address of each static IP, changing an IP, an IP purity check and a cost estimate checked against your wallet balance. None of them spends money; purchases stay in the console.

For the Claude and ChatGPT web apps there is a second address, https://mcp.proxy302.com/mcp, with a sign-in page. In Claude, open Settings → Connectors → Add custom connector; in ChatGPT, turn on developer mode and add a connector. Enter the address, and when the Proxy302 authorization page opens, paste the key from the API keys page of the console as <key id>:<secret> and approve. Deleting that key in the console ends the connection. Clients that send headers, such as Claude Code, Cursor and Dify, can use either address with the Authorization header.

Claude Code: remote endpoint

claude mcp add --transport http proxy302 https://proxy302.com/v1/mcp --header "Authorization: Bearer <key id>:<secret>"

The --transport http and --header options are from the Claude Code MCP documentation. Cursor, VS Code, Codex and Gemini CLI take the same URL and Authorization header in their own MCP configuration.

Routing the MCP server's own traffic through a proxy

Giving a tool a proxy and sending an MCP server's own outbound requests through a proxy are two separate jobs. Most MCP servers are Node.js or Python programs that the client starts, and they receive the environment the client gives them, so that is where proxy variables go.

Node.js reads proxy variables only if you opt in. Set NODE_USE_ENV_PROXY=1 (Node v24.0.0 and v22.21.0 or later) or start Node with --use-env-proxy (v24.5.0 and v22.21.0 or later), and it reads HTTP_PROXY, HTTPS_PROXY and NO_PROXY. It accepts HTTP or HTTPS proxy URLs only, not SOCKS. Node 20 has no built-in support, so a server running on Node 20 does not pick these variables up.

Python is simpler. httpx and requests read the proxy environment variables by default. requests needs the requests[socks] extra if the proxy URL is SOCKS.

A client passes these variables to the server in its env block, next to the API key. The example is for a server that makes ordinary web requests:

env block with proxy variables for an MCP server

{
  "mcpServers": {
    "some-other-server": {
      "command": "npx",
      "args": ["-y", "your-mcp-server-package"],
      "env": {
        "NODE_USE_ENV_PROXY": "1",
        "HTTPS_PROXY": "http://USERNAME:PASSWORD@HOST:PORT",
        "HTTP_PROXY": "http://USERNAME:PASSWORD@HOST:PORT",
        "NO_PROXY": "localhost,127.0.0.1"
      }
    }
  }
}

Example only: replace HOST, PORT, USERNAME and PASSWORD with your own values. Use an HTTP proxy URL.

The same variables on a command line

The same variables work on a command line:

Node.js: opting in on the command line

NODE_USE_ENV_PROXY=1 HTTPS_PROXY=http://USERNAME:PASSWORD@HOST:PORT node server.js

Example only: replace the placeholders with your own values.

Test the two hops separately

The assistant's own connection and the server's outbound requests are two hops, so test them separately. Compare the exit country and ISP that a lookup shows with the region you asked for.

Measured exits: Proxy302 rotating residential, eight countries

Measured exits: Proxy302 rotating residential, eight countries
ItemNetwork (ISP)ASNResponse, ms
United StatesAT&T Enterprises, LLCAS70181807
United KingdomPlusnetAS68712563
GermanyVodafone GmbHAS32091058
JapanBTV CO.,LTD.AS181351548
SingaporeStarhub LtdAS55430629
RussiaPJSC VimpelcomAS84022031
BrazilTELEFÔNICA BRASIL S.AAS265996263
IndonesiaPT. Telekomunikasi SelularAS236931752

This is Proxy302's hourly connectivity check, not a proxy302-mcp measurement: one request to Amazon per country through a rotating residential exit, on 3 November 2026 at 18:18 UTC. One sample per country, not an average; later checks will differ. Only the first three octets of an IP are public.

Which proxy type suits which tool call

Rotating residential suits reading public pages from many places, such as price pages, search results or documentation that differs by country. Traffic is bought by the gigabyte and each generated proxy draws on it; pick the country when you generate it.

A static ISP IP suits anything tied to one account: you lease the IP for 1 to 90 days and it stays the same during the lease. Datacenter IPs suit plain API calls where the network type does not matter.

A proxy changes only the network address a service sees. What an account may do, and whether it stays open, is decided by the platform.

How to do it with Proxy302

Rotating residential fits most proxy MCP work: the server asks for a proxy URL for a country and the traffic it uses is billed from your wallet. The product page describes the lines and countries.

How to do it with Proxy302: steps

  1. Step 1

    Create an API key in the Proxy302 console (the page is /api-keys). It has two parts, a key id and a secret, written as <key id>:<secret>.

  2. Step 2

    Run the install command for your tool from the section above, with your key in the environment variable.

  3. Step 3

    Restart the tool if it asks you to, then ask the assistant to list the server's tools and to get a proxy URL for the country you need.

  4. Step 4

    Check the exit with https://ipinfo.io/json through the proxy. The country field should match the country you chose. The guide to checking a proxy covers the other checkers.

  5. Step 5

    From mainland China, open the Helper from the Connect page, click 「一键加速」 (One-click boost) and keep it open while you use the proxy.

Prices and limits

proxy302-mcp is free. Rotating residential traffic costs from US$1.50 per GB on the Budget line and US$5 per GB on the Premium line, and larger packages are cheaper per GB. A static ISP IP costs US$0.50 for one day and US$7.99 for 30 days, the same in every country; availability changes daily and is shown on the order page. There is no free trial, and the smallest purchase is 1 GB of rotating residential traffic or one IP for one day. A proxy does not lift a restriction, undo a ban or raise a limit.

Proxy302 at a glance

Proxy302 at a glance
ItemPriceProtocolsLocationsFits agent work like
Rotating residentialFrom US$1.50 per GB (Budget line); US$5 per GB (Premium line); lower per GB in larger packagesHTTP, SOCKS5195+ countries and regions; state and city on lines that support itBrowsing and research agents, data collection
Static ISP, per IPUS$0.50 for 1 day, US$7.99 for 30 days, the same in every countryHTTP or SOCKS5, chosen per IP30 countries on the order form; stock changes dailyOne fixed IP for each account an agent signs in to
ISP for AI subscriptionsPer 30 days: Claude 15 PTC, GPT / Grok 10 PTC, Gemini 8 PTC; the first order in each tier is 50% offHTTP or SOCKS5Claude: US, UK, DE, ES, JP, SG. GPT / Grok and Gemini: US, UK, FR, ES, IT, JP, KR, SGCoding tools and agents signed in to ChatGPT, Claude, Gemini or Grok
Datacenter, per IPUS$0.25 for 1 day, US$3.99 for 30 daysHTTP or SOCKS5, chosen per IP8 countriesAPI calls and tool traffic where the IP type does not matter
proxy302-mcpFree, open source (MIT)MCP over stdio, started with npxUses the products aboveLets Claude Code, Codex, Cursor and other MCP clients get a proxy and fetch pages through it

Prices are in PTC, paid from the wallet; 1 PTC = US$1. There is no free trial: the smallest purchase is 1 GB of rotating residential traffic or one IP for one day. Checked on 4 November 2026.

FAQ

What is a proxy MCP server?

An MCP server that exposes proxy-related tools, such as getting a proxy URL for a country or fetching a page through a proxy, so an AI assistant can use a proxy by calling a tool while the credentials stay in the server's configuration.

Is mcp-proxy the same thing?

No. mcp-proxy is an open-source bridge between stdio and Streamable HTTP MCP transports. It moves MCP messages and has nothing to do with IP proxies.

Where should the API key go?

In an environment variable that the client passes to a local server, or in a client config file you do not commit. A remote server normally takes it as an HTTP header. It should not appear in a prompt.

Can I use it in Claude.ai or ChatGPT?

Yes. Add https://mcp.proxy302.com/mcp as a custom connector (in Claude: Settings → Connectors → Add custom connector; in ChatGPT: a connector in developer mode). The Proxy302 authorization page asks for your API key as <key id>:<secret>; deleting the key in the console ends the connection. The same 9 tools are available, and none of them spends money.

Does my MCP server use the proxy automatically?

No. The assistant's connection and the server's own requests are separate. Pass proxy variables in the server's env block; Node.js needs NODE_USE_ENV_PROXY=1 (v24.0.0 and v22.21.0 or later), Python httpx and requests read them by default.

Can proxy302-mcp spend my wallet?

No. It cannot buy anything or spend the wallet. Its only write is creating a free dynamic proxy credential, which is off by default; traffic is billed only when used.

Reference links

13
  1. MCP documentation: Architecture overview

    Official documentation · Confirmed on:

    Read on 4 November 2026: local MCP servers use the STDIO transport on the same machine with no network overhead; remote servers use Streamable HTTP, which supports bearer tokens, API keys and custom headers.

  2. mcp-proxy (sparfenyuk) README

    Official documentation · Confirmed on:

    Read on 4 November 2026: the repository describes itself as "A bridge between Streamable HTTP and stdio MCP transports".

  3. Claude Code docs: Connect Claude Code to tools via MCP

    Official documentation · Confirmed on:

    Checked on 4 November 2026: claude mcp add syntax with -e / --env and -- before the server command, scopes local, project and user.

  4. Codex docs: Model Context Protocol

    Official documentation · Confirmed on:

    Checked on 4 November 2026: codex mcp add <name> --env VAR=VALUE -- <command>; stdio servers in ~/.codex/config.toml with command, args and env.

  5. Cursor docs: Model Context Protocol

    Official documentation · Confirmed on:

    Checked on 4 November 2026: mcp.json at ~/.cursor/mcp.json (all projects) or .cursor/mcp.json (one project); stdio entries use command, args and env.

  6. Node.js docs: command-line options and built-in proxy support

    Official documentation · Confirmed on:

    Checked on 4 November 2026 (also doc/api/http.md): NODE_USE_ENV_PROXY=1 (v24.0.0, v22.21.0) and --use-env-proxy (v24.5.0, v22.21.0) make Node read HTTP_PROXY, HTTPS_PROXY and NO_PROXY; proxy URLs use HTTP or HTTPS; Node 20 has no built-in proxy support.

  7. Requests documentation: Advanced usage, proxies

    Official documentation · Confirmed on:

    Checked on 4 November 2026: requests relies on the http_proxy, https_proxy, no_proxy and all_proxy environment variables (uppercase also works); SOCKS needs requests[socks].

  8. HTTPX documentation: Environment variables

    Official documentation · Confirmed on:

    Checked on 4 November 2026: HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY are used by default; trust_env=False turns them off.

  9. proxy302-mcp README (official Proxy302 MCP server)

    Product observation · Confirmed on:

    README of the official Proxy302 MCP server: install commands, environment variables, the seven tools, the read-only, spend-free scope and the hosted endpoint https://proxy302.com/v1/mcp.

  10. Proxy302 hourly connectivity check

    Product observation · Confirmed on:

    Public JSON of the probe at proxy302.com/live/connectivity/amazon.json (file probe-amazon-20261104.json), generated 3 November 2026, 18:18 UTC: one request to Amazon per country through a rotating residential exit; exit ISP, ASN and response time. It is not a measurement of proxy302-mcp.

  11. Proxy302 product facts and price list

    Product observation · Confirmed on:

    Product facts file of the site (values checked against the console, the backend and the price table on 18-19 October 2026): products, prices in US$ (1 PTC = US$1), lease terms, protocols and ports, countries, quantity limits, no free trial.

  12. Proxy302 ISP for AI subscriptions: public catalog

    Product observation · Confirmed on:

    Public JSON at proxy302.com/v1/proxy/ai-isp/catalog, read 4 November 2026: three tiers (Claude, GPT / Grok, Gemini), price per 30 days in PTC, 50% off the first order in a tier, cities by country.

  13. Proxy302 remote MCP endpoint

    Product observation · Confirmed on:

    An MCP initialize request without a key to https://proxy302.com/v1/mcp on 4 November 2026 returned HTTP 401 asking for Authorization: Bearer <key id>:<secret>. Transport (Streamable HTTP) and the tool list as stated by the Proxy302 API team on 4 November 2026. A request without a key to https://mcp.proxy302.com/mcp on 4 November 2026 returned HTTP 401 with a WWW-Authenticate header pointing to its OAuth protected-resource metadata, and its authorization-server metadata lists authorize, token and registration endpoints. The connector sign-in (paste <key id>:<secret> on the Proxy302 authorization page; deleting the key ends the connection) as described by the Proxy302 API team on 4 November 2026.

Ready to try it?

Create an account, top up once, then pick rotating residential, static ISP or datacenter IPs and have one running in your browser within minutes.