Update (2025/04/02):Wrote about MCP in Cline and Cursor under Proxy 2
🧠🥷How to use MCP in Cline and Cursor 3 (use under Proxy 2)

Intro

Hello! I'm a Ninja Web Developer. Hi-Yah!🥷
By the way, I couldn't figure out whether the Ninja of the cover image is in front of the desk or back of the desk.🤣 Never mind.
Last time, I wrote how to use MCP in Cline and Cursor, but couldn't use MCP under Proxy.
🧠🥷How to use MCP in Cline and Cursor
So this time I will write about how to use MCP under Proxy.
I hope this post will be a help to someone, because I wasted much time trying to use MCP under Proxy.🤮

What didn't work

1️⃣ Set environment variable of proxy in PC
2️⃣ Set env of proxy in mcp.json for Cursor and cline_mcp_settings.json for Cline.

Why I couldn't use MCP under Proxy?

I looked inside the code of MCP Slack server.
It was using fetch to communicate with slack.
I searched the relation of fetch and proxy, and found the answer in the article of Microsoft .🎉
https://learn.microsoft.com/en-us/microsoft-cloud/dev/dev-proxy/how-to/use-dev-proxy-with-nodejs
The answer is fetch cannot use env of proxy.

How to use MCP under Proxy

First, I tried global-agent, because it looked easier than others.
It didn't work in my case...🤮
Second, I tried https-proxy-agent.
It also didn't work in my case...🤮
Third, I tried Axios, and replaced all the fetch to Axios in the code.
I did it using the AI power of Cline and Cursor.
It worked!🎉
Please let me know, if there is a better way to use MCP under Proxy.

How to use MCP in Cline and Cursor under Proxy (Step by step)

I will explain using Slack MCP Server for example.
https://github.com/modelcontextprotocol/servers/tree/main/src/slack
I checked it works both in Cline and Cursor.
1️⃣ Download Slack MCP Server in PC.↓

npm install @modelcontextprotocol/server-slack

2️⃣ Install Axios.↓

npm install axios

3️⃣ Replace all the fetch to axios.↓
Not just replace the word fetch to axios, but rewrite the code for axios.
So, it will be easy if you ask AI to do it.
I will make a repository for this code later.
4️⃣ Set the mcp.json for Cursor and cline_mcp_settings.json for Cline.↓

{
  "mcpServers": {
    "slack-server": {
      "command": "cmd",
      "args": [
        "/c",
        "node",
        "C:/path to your folder/node_modules/@modelcontextprotocol/server-slack/dist/index.js"
      ],
      "env": {
        "SLACK_BOT_TOKEN": "xoxb-your-bot-token",
        "SLACK_TEAM_ID": "T01234567",
        "HTTP_PROXY": "your proxy",
        "HTTPS_PROXY": "your proxy"
      }
    }
  }
}

Changed npx to node.
5️⃣ Now you are ready to use MCP under Proxy.🎉

Outro

If you can use MCP under Proxy, the range of use of MCP will expand.
I heard that there are other interesting MPC server like Blender MCP and Unity MCP and others.
I would like to learn more about MCP and share it.
Thank you for reading.
Happy AI coding!🤖 Hi-Yah!🥷

Update (2025/03/22):Wrote about How to make MCP (Cline and Cursor)
🧠🥷How to make MCP (Cline and Cursor)

Update (2025/03/25):Wrote about Blender MCP
🧠🥷How to make cool Ninja (Blender MCP (Cline and Cursor))

Update (2025/03/29):Wrote about Unity MCP
🧠🥷How to make cool Ninja game (Unity MCP + Blender MCP (Cline and Cursor))

Update (2025/04/06):Wrote about MCP Security
🧠🥷MCP Security (choose safe MCP and check MCP safety)🛡️

Update (2025/04/12):Wrote about Vroid
🧠🥷How to make AI controled Avatar 1 (VRoid)

Update (2025/04/19):Wrote about Vroid MCP
🧠🥷How to make AI controled Avatar 2 (Vroid MCP + Cline and Cursor + Unity)