claude-custom-mcp
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
claude-custom-mcp
Give Claude tools that run on your own device. A self-hosted MCP server built for Claude: phone with Termux, Raspberry Pi or home server, no open ports.
Contents
Quick start · How it works · Configuration · Adding tools · Security · Troubleshooting · Contributing
Related MCP server: Remote MCP Server on Cloudflare
Quick start
1. Run the agent
pkg install nodejs cloudflared git
git clone https://github.com/vaeromon/claude-custom-mcp && cd claude-custom-mcp/termux
npm run setupInstall Node.js 20.12+ and cloudflared, then:
git clone https://github.com/vaeromon/claude-custom-mcp && cd claude-custom-mcp/termux
npm run setupsetup writes termux/.env and prints MCP_KEY and TERMUX_KEY. Keep both for step 2.
2. Deploy the Worker
Click to deploy your own copy:
Paste MCP_KEY and TERMUX_KEY when asked.
Fork this repo. In the Cloudflare dashboard: Workers & Pages > Create > Import a repository.
Field | Value |
Root directory |
|
Deploy command |
|
After the first deploy, add two Secrets under Settings > Variables and Secrets: MCP_KEY and TERMUX_KEY.
cd worker && npm install
npx wrangler login
npx wrangler secret put MCP_KEY
npx wrangler secret put TERMUX_KEY
npx wrangler deployYour URL is https://claude-custom-mcp.<your-subdomain>.workers.dev. Put it in termux/.env as WORKER_URL, or run npm run setup -- --url <url>.
3. Start the agent
cd termux && ./start.sh # or: npm startWait for Tunnel URL sent to Worker.
4. Connect Claude
Customize > Connectors > Add custom connector
URL:
https://<your-worker-url>/mcpAuthentication: OAuth, register the client automatically
On the page that opens, enter
MCP_KEYIn a chat, ask Claude to run
ping_termux
Claude's free plan allows one custom connector.
How it works
The agent runs a Cloudflare Quick Tunnel whose URL changes on every restart. It re-registers the current URL with the Worker every minute, so the Worker always knows where to send calls.
worker/ Cloudflare Worker
wrangler.jsonc settings (name, domain, vars)
src/index.js routing
src/core/ MCP, OAuth, register, store, termux client
src/tools/<name>/ tools that run on the Worker
scripts/gen-tools.js builds the tool list automatically
termux/ agent for your device
agent.js local server + tunnel + registration
setup.js key generator
tools/<name>/ tools that run on your device
docs/ guides and diagrams (img/generate.py rebuilds the SVGs)
test/ npm testConfiguration
Worker settings live in worker/wrangler.jsonc under vars. Keys are secrets and never go in that file.
Name | Where | Default | Meaning |
| Worker secret | required | Password on the login page. Also signs tokens. |
| Worker secret + | required | Shared secret between Worker and agent. |
| Worker var |
| Name on the login page and in MCP |
| Worker var | Claude callbacks | Comma-separated OAuth redirect URIs a client may use. |
| Worker var |
| Max wait for a Termux tool call. |
|
| required | Your Worker's URL. |
|
|
| Local agent port (127.0.0.1 only). |
Uncomment routes in wrangler.jsonc, set your domain, and set workers_dev to false. The domain must be on your Cloudflare account and must not already have a DNS record for that name.
cp worker/.dev.vars.example worker/.dev.vars # fill in both keys
npm run devAdding tools
Copy termux/tools/_template to termux/tools/my_tool, edit it, restart the agent. Tools that should run on the Worker itself go in worker/src/tools/. Full guide: docs/tools.md.
Security
Tools run code on your device on behalf of an AI, so read SECURITY.md before adding powerful ones.
Login uses OAuth with PKCE. Only the redirect URIs you allow can register.
Access tokens last 1 hour. Refresh tokens last 30 days and are single-use (rotated on every refresh).
To rotate keys:
npm run setup -- --renew, update both Worker secrets, restart the agent, reconnect the connector. ChangingMCP_KEYrevokes all tokens.
Troubleshooting
Quick Tunnels are meant for testing: no uptime guarantee, and the URL changes on every restart (handled automatically). For something permanent, use a named Cloudflare Tunnel and adapttermux/lib/tunnel.js.
Development
npm testSee CONTRIBUTING.md. Licensed under MIT.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Use your own Windows, Mac or Linux computer from ChatGPT, Claude, Cursor or Gemini CLI: run commands, read, write and search files, run long processes. Your computer only makes an outgoing connection (no open ports or VPN). Read-only mode, allowed folders, blocked commands and an action log keep you in control. Free plan available.
Connect AI assistants to your Mac and Linux computers with scoped access to local files and tools.
Remote streamable-HTTP MCP server running on a single Cloudflare Worker. Your assistant gets live Airbnb, Amazon, Booking.com, Google Flights, Maps and Reddit data, social search on X, Instagram and TikTok, the Meta Ad Library, and image/video generation without any keys. Connect your own accounts to let it send WhatsApp or Telegram messages, work an IMAP inbox, manage Meta Ads campaigns and publish to X and LinkedIn. OAuth 2.1 with PKCE; stored credentials are AES-256-GCM encrypted.
Let Claude, ChatGPT and other agents use your Android phone: see the screen, tap, type, open apps.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables deploying and connecting to MCP servers on Cloudflare Workers with OAuth login, allowing remote access to tools via MCP clients like Claude Desktop.-
- FlicenseNot gradedqualityNot gradedmaintenanceEnables running MCP tools remotely on Cloudflare Workers with OAuth authentication, allowing clients like Claude to call tools via SSE.-
- FlicenseNot gradedqualityNot gradedmaintenanceEnables running MCP tools remotely on Cloudflare Workers with OAuth login, allowing Claude Desktop and other clients to call server-side tools like math operations.-
- AlicenseNot gradedqualityCmaintenanceEnables a Claude Code cloud session to run shell commands inside a chroot jail on your own computer and to call the MCP servers already installed there, with every request authenticated and relayed over a Cloudflare quick tunnel so no router port is opened and no SSH key or tunnel is ever handed to the cloud VM.MIT