WiseTech Image MCP Server

WiseTech Image MCP Server

Enables image upscaling, face enhancement, and background removal via public image URLs, returning base64 PNG results.

Category
访问服务器

README

WiseTech Image MCP Server

An MCP (Model Context Protocol) server that exposes all three WiseTech AI image tools to any MCP-compatible client (Claude, ChatGPT, Grok, etc.):

Tool What it does API endpoint
upscale_image Upscales an image to higher resolution {main_api}/upscale_web_v2
enhance_face Enhances faces in an image {main_api}/faceenhance_web
remove_background Removes the background from an image {bg_api}/uploadImageV2 → /processImageBackgroundRemove → /getStatus → /downloadImage

All three accept a public image URL and return the processed image as base64 PNG.

Verified working — all three APIs tested end-to-end on 2026-06-20.


Quick start (local testing)

npm install
npm run dev

Server starts on http://localhost:3000/mcp. No .env needed for local testing — it auto-resolves the API URLs.


Environment variables

All config lives in .env (never committed to git). Copy .env.example to .env and fill in:

Variable Required Description
MCP_AUTH_KEY Yes for production Your secret key. Clients send Authorization: Bearer <key>. Generate with openssl rand -hex 32.
WISETECH_MAIN_DNS No DNS resolver URL for main API (default: https://sd.rad-wi.com)
WISETECH_BG_DNS No DNS resolver URL for bg remover API (default: https://ibgc.rad-wi.com/)
WISETECH_MAIN_FALLBACK No Fallback main API IP if DNS fails
WISETECH_BG_FALLBACK No Fallback bg API IP if DNS fails
WISETECH_MAIN_API_URL No Pin a specific main API host (skips DNS)
WISETECH_BG_API_URL No Pin a specific bg API host (skips DNS)
WISETECH_API_KEY No API key if WiseTech adds one (currently not needed)
WISETECH_AUTH_HEADER No Header name for the API key (e.g. x-api-key)
PORT No HTTP port (default: 3000, use 8443 for VPS HTTPS)
HTTPS_CERT_DIR No Path to Let's Encrypt cert dir. When set, server uses HTTPS directly (no nginx needed). Example: /etc/letsencrypt/live/mcp.yourdomain.com

DNS auto-refresh

The WiseTech API IPs rotate daily. This server replicates the WordPress plugin's DNS-resolution: on startup (and every 6 hours) it fetches the current URL from the DNS endpoints. No manual IP updates needed.


Deploy on Heroku

Step 1: Install Heroku CLI and login

npm install -g heroku
heroku login

Step 2: Create a Heroku app

cd wisetech-image-mcp
heroku create wisetech-image-mcp

Step 3: Set environment variables

# Generate a strong auth key
heroku config:set MCP_AUTH_KEY=$(openssl rand -hex 32)

# API URLs (auto-resolved from DNS, but set fallbacks)
heroku config:set WISETECH_MAIN_DNS=https://sd.rad-wi.com
heroku config:set WISETECH_BG_DNS=https://ibgc.rad-wi.com/
heroku config:set WISETECH_MAIN_FALLBACK=http://34.232.100.156:5454
heroku config:set WISETECH_BG_FALLBACK=http://35.190.164.209:5454

Step 4: Deploy

git add .
git commit -m "Initial deploy"
git push heroku main

Heroku automatically:

  • Runs npm install
  • Runs npm run build (via the build script in package.json)
  • Starts the app using the Procfile: web: node dist/index.js
  • Assigns a port via the PORT env var (handled automatically)

Step 5: Verify it's running

heroku open
# Or test the MCP endpoint:
curl -X POST https://wisetech-image-mcp.herokuapp.com/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer YOUR_MCP_AUTH_KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

You should see all three tools in the response.

Step 6: Connect to AI tools

Your MCP URL is: https://wisetech-image-mcp.herokuapp.com/mcp

Use this URL + your MCP_AUTH_KEY in Claude / ChatGPT / Grok (see below).

Heroku notes

  • Free tier sleeps after 30 min of inactivity. First request after sleep takes ~10s to wake up. Use heroku ps:scale web=1 and consider upgrading to Eco/Hobby for always-on.
  • Port: Heroku sets PORT automatically — don't set it yourself.
  • Timeout: Heroku has a 30s request timeout on free tier. Image processing can take up to 180s. If you hit timeouts, upgrade to Hobby tier or use a VPS instead.

Deploy on a VPS (recommended for production)

VPS is better than Heroku for this because image processing can take up to 3 minutes (Heroku free tier times out at 30s).

This guide is written for your specific VPS (Ubuntu 24.04, IP 167.88.43.163).

Your VPS current state

Service Port Status
Docker (n8n) 3000 ⚠️ Taken — don't use
OpenVPN 80 ⚠️ Taken — don't use
nginx 443, 8080 ⚠️ Taken (n8n.conf)
Redis 6379 In use
SSH 22 In use
8443 free ✅ We'll use this

Strategy: Use port 8443 with HTTPS directly from Node (no nginx needed). This avoids touching any existing services — no conflicts with n8n, OpenVPN, or nginx.

Step 1: Install pm2 (process manager)

pm2 is not installed on your VPS yet. SSH into your VPS and install it:

ssh root@167.88.43.163
npm install -g pm2

Step 2: Clone the repo

If the repo is public:

cd /opt
git clone https://github.com/Motasaith/MCP_Upscale_Face-Enhancer_Remove-BG.git wisetech-mcp
cd wisetech-mcp
npm install
npm run build

If the repo is private, generate a Personal Access Token first:

  1. Go to https://github.com/settings/tokens → "Generate new token (classic)" → check repo → generate
  2. Copy the token, then on the VPS:
cd /opt
git clone https://Motasaith:YOUR_TOKEN@github.com/Motasaith/MCP_Upscale_Face-Enhancer_Remove-BG.git wisetech-mcp
cd wisetech-mcp
npm install
npm run build

Note: The repo is safe to make public — all secrets are in .env (gitignored), SECURITY.md is gitignored, and the PHP reference folder is gitignored. The code on GitHub contains no API URLs or keys.

Step 3: Create the .env file

nano /opt/wisetech-mcp/.env
MCP_AUTH_KEY=GENERATE_A_STRONG_KEY_HERE
WISETECH_MAIN_DNS=https://sd.rad-wi.com
WISETECH_BG_DNS=https://ibgc.rad-wi.com/
WISETECH_MAIN_FALLBACK=http://34.232.100.156:5454
WISETECH_BG_FALLBACK=http://35.190.164.209:5454
WISETECH_API_KEY=
WISETECH_AUTH_HEADER=
PORT=8443
HTTPS_CERT_DIR=/etc/letsencrypt/live/mcp.yourdomain.com

Generate a strong auth key:

openssl rand -hex 32

Lock down the file:

chmod 600 /opt/wisetech-mcp/.env
chown root:root /opt/wisetech-mcp/.env

Step 4: Point a subdomain at this VPS

In your DNS dashboard (wherever you manage your domain — Cloudflare, Namecheap, etc.), add an A record:

A   mcp.yourdomain.com   →   167.88.43.163

Wait a few minutes for DNS to propagate. Verify:

dig mcp.yourdomain.com +short
# should return 167.88.43.163

Step 5: Get the SSL certificate (DNS challenge — no port 80 needed)

This method avoids touching port 80 (which OpenVPN uses). It uses a DNS TXT record instead.

apt install -y certbot
certbot certonly --manual --preferred-challenges dns -d mcp.yourdomain.com

Certbot will print something like:

Please deploy a DNS TXT record under:
_acme-challenge.mcp.yourdomain.com
with this value:
abc123def456...

Go to your DNS dashboard, add that TXT record, wait ~2 minutes, then press Enter in the terminal.

Certbot saves the cert to /etc/letsencrypt/live/mcp.yourdomain.com/.

Note: This cert expires in 90 days. Since it's a manual DNS challenge, you'll need to repeat this step before it expires. If your domain is on Cloudflare, you can automate it later with certbot-dns-cloudflare.

Step 6: Start the server with pm2

cd /opt/wisetech-mcp
pm2 start dist/index.js --name wisetech-mcp
pm2 save
pm2 startup    # follow the instructions it prints to make it survive reboots

Check it's running:

pm2 status
pm2 logs wisetech-mcp --lines 10

You should see:

WiseTech Image MCP server listening on :8443 (HTTPS, POST /mcp)
Tools: upscale_image, enhance_face, remove_background
[DNS] APIs resolved successfully.

Step 7: Open the port (if firewall is active)

ufw status

If it says "active":

ufw allow 8443/tcp

If it says "inactive", skip this step.

Step 8: Test from outside

curl -i -X POST https://mcp.yourdomain.com:8443/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "Authorization: Bearer YOUR_MCP_AUTH_KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

You should see all three tools in the response.

Step 9: Connect to AI tools

Your MCP URL is: https://mcp.yourdomain.com:8443/mcp

Use this in Claude / ChatGPT / Grok (see the "Connecting to AI tools" section above).

Useful pm2 commands

pm2 status                    # see if it's running
pm2 logs wisetech-mcp         # live logs (Ctrl+C to exit)
pm2 restart wisetech-mcp      # restart after code changes
pm2 stop wisetech-mcp         # stop
pm2 delete wisetech-mcp       # remove from pm2

Certificate renewal (every 90 days)

Since we used a manual DNS challenge, auto-renewal won't work unattended. Before the cert expires:

certbot certonly --manual --preferred-challenges dns -d mcp.yourdomain.com
pm2 restart wisetech-mcp

If your domain is on Cloudflare, you can automate this:

apt install -y python3-certbot-dns-cloudflare
# Configure with your Cloudflare API token, then:
certbot certonly --dns-cloudflare --dns-cloudflare-credentials /root/.cloudflare.ini -d mcp.yourdomain.com
# Then add a cron job for auto-renewal

Connecting to AI tools

Claude Desktop

Edit this file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "wisetech-image": {
      "url": "https://your-domain.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_MCP_AUTH_KEY"
      }
    }
  }
}

Restart Claude Desktop. You'll see three tools available:

  • upscale_image
  • enhance_face
  • remove_background

ChatGPT / Grok / other MCP clients

Go to their custom tools / MCP settings and add:

  • URL: https://your-domain.com/mcp
  • Header: Authorization: Bearer YOUR_MCP_AUTH_KEY

Local testing (no deployment needed)

npm run dev

Point your AI client at http://localhost:3000/mcp (no auth key needed for local).


How it works

Upscale & Face Enhance (synchronous)

User → AI tool → MCP server → downloads image from URL → base64-encodes →
  POST {main_api}/upscale_web_v2   (or /faceenhance_web)
  body: {"image": "<base64>"}
  → response: {"image": "<base64 result>"}
→ returns base64 PNG to the AI tool → AI tool shows it to the user

Background Remover (asynchronous, handled automatically)

User → AI tool → MCP server → downloads image →
  1. POST  {bg_api}/uploadImageV2            (multipart "file")
  2. GET   {bg_api}/processImageBackgroundRemove?imageName=...
  3. Poll  {bg_api}/getStatus?imageName=...   (every 3s until status=1)
  4. GET   {bg_api}/downloadImage?imageName=...png
→ returns base64 PNG to the AI tool

The entire async flow is hidden from the AI tool — it just gets the final image back.


Supported formats

Tool Formats
Upscale JPG, JPEG, PNG, GIF, JFIF, WEBP, BMP, ICO, SVG, AVIF
Face Enhance JPG, JPEG, PNG, GIF, JFIF, WEBP, BMP, ICO, SVG, AVIF
Background Remove JPG, JPEG, PNG, WEBP, JFIF, BMP

Max file size: 10 MB (enforced server-side, matching the WP plugin).


Project structure

wisetech-image-mcp/
├── index.ts          # MCP server — all 3 tools (supports HTTP + HTTPS)
├── package.json      # Dependencies + scripts
├── tsconfig.json     # TypeScript config
├── Procfile          # Heroku deployment config
├── .env              # Your secrets (NEVER commit to git)
├── .env.example      # Template for .env
├── .gitignore        # Blocks .env, SECURITY.md, node_modules from git
├── SECURITY.md       # Security & deployment details (kept private)
├── README.md         # This file
└── Extra_Just_For_API_Info/   # Original PHP plugin reference (gitignored)

Notes

  • The server uses Streamable HTTP transport (not stdio), so it works with remote/web-based MCP clients like ChatGPT and Grok, not just Claude Desktop.
  • Background removal output is always PNG (the API converts the input filename to .png).
  • All API URLs are in .env, not in the code — someone reading the source sees nothing.
  • See SECURITY.md for detailed security information and hardening steps.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选