Who this is for
Developers who use Qwen Code, the terminal coding agent from Alibaba's Qwen (通义千问) team, and want it to fetch proxy URLs and account details.
Qwen Code started as a fork of Gemini CLI, so the setup looks much like the Gemini CLI guide.
What you need
- An IPMusk account with a verified email address.
- An IPMusk API key. Create it in Settings → API keys (/app/settings/api-keys). For typical use tick read and connect. Add support only if the assistant should open tickets, and order only if it should create orders that end in a payment link.
- The key in an environment variable named IPMUSK_API_KEY, for example export IPMUSK_API_KEY="ipm_live_YOUR_KEY" in your shell profile. The examples below read it from there.
- Qwen Code installed.
- IPMusk applies the same source-country rules to the API and MCP as to the website, so connect from a region where ipmusk.com is available.
Set it up
Add the server to ~/.qwen/settings.json, or to .qwen/settings.json in a project.
- Or run: qwen mcp add --transport http ipmusk https://ipmusk.com/mcp (add --scope user for every project), then add the headers block to the file it wrote.
- Use httpUrl, not url. url is for the older SSE transport.
- Restart Qwen Code after editing the file.
{
"mcpServers": {
"ipmusk": {
"httpUrl": "https://ipmusk.com/mcp",
"headers": {
"Authorization": "Bearer ${IPMUSK_API_KEY}"
},
"timeout": 30000
}
}
}Sign in with OAuth instead
Leave out headers. When Qwen Code connects, it opens the IPMusk sign-in page in your browser and receives the result at http://localhost:7777/oauth/callback.
If Qwen Code runs on a remote machine, your browser cannot reach that address. Add the server with --oauth-redirect-uri set to an address your browser can reach.
{
"mcpServers": {
"ipmusk": {
"httpUrl": "https://ipmusk.com/mcp"
}
}
}Check it works
Restart Qwen Code and run /mcp. ipmusk should be listed as connected with its tools.
Ask the assistant: Which IPMusk account am I connected as? It should call get_account and answer with your email address.
Try these prompts
- How much IPMusk residential traffic do I have left?
- Get a sticky US proxy URL for 10 minutes and use it in this script.
- List my IPMusk Static ISP proxies and when they expire.
If it fails
- 401 authentication_required: the key is missing, wrong, revoked or expired. Check that IPMUSK_API_KEY is set where the client starts. echo ${#IPMUSK_API_KEY} prints its length without showing the key.
- The server is disconnected: check the JSON is valid and that you used httpUrl.
- OAuth sign-in never finishes: another program is using port 7777, or Qwen Code runs on another machine. Free the port or set --oauth-redirect-uri.
- 403 forbidden on one tool: the key lacks that tool's scope, or your email is not verified. Scopes cannot be added to a key, so create a new key with the scope and swap it in.
- 429 rate_limited: too many calls in one minute (read 60, connect 20, support 30, order 10). Wait a minute and try again.
Remove access
- Revoke the key in Settings → API keys (/app/settings/api-keys). It stops working at once.
- Then delete the ipmusk entry from settings.json and restart Qwen Code.
- If you signed in with OAuth, disconnect Qwen Code in Settings → API keys → Connected AI apps.