ChatGPT Desktop Commander MCP
A Python MCP server that allows ChatGPT to execute commands on your local PC via a secure Cloudflare tunnel.
README
🖥️ ChatGPT Desktop Commander MCP
A Python MCP (Model Context Protocol) server that lets ChatGPT run commands on your local PC through a secure HTTPS tunnel.
🏗️ Architecture
ChatGPT ──► Cloudflare Tunnel (HTTPS) ──► Your PC (server.py) ──► Windows CMD
⚡ Quick Start
1. Clone & Install
git clone https://github.com/kathirm1323-ai/MCP.git
cd Chatgpt_Desktop_Commander_MCP
python -m venv venv
.\venv\Scripts\Activate.ps1
pip install -r requirements.txt
2. Download Cloudflare Tunnel
curl.exe -sL "https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-windows-amd64.exe" -o cloudflared.exe
3. Update Path in start_mcp.bat
Open start_mcp.bat and change the path on line 9 to your project folder:
set "MCP_DIR=C:\path\to\your\project"
4. Run
Double-click start_mcp.bat — it starts both the server and tunnel.
5. Connect to ChatGPT
- Copy the
https://...trycloudflare.comURL from the tunnel output - Go to ChatGPT → Settings → Apps → Create New Connector
- Paste the URL directly (no
/mcpneeded) - Authentication: No Auth
- Click Create
📁 Project Structure
| File | Description |
|---|---|
server.py |
MCP server with run_command tool |
start_mcp.bat |
One-click launcher (server + tunnel) |
requirements.txt |
Python dependencies |
HOW_IT_WORKS.md |
Detailed architecture & workflow docs |
test_server.py |
Test script for the server |
🔧 How It Works
server.pyruns a FastMCP server with Streamable HTTP transport on port 8000cloudflared.execreates a secure HTTPS tunnel to your local server- ChatGPT connects via the tunnel URL and calls the
run_commandtool - Commands execute on your PC and results are sent back to ChatGPT
🛠️ Adding More Tools
Open server.py and add new functions with @mcp.tool():
@mcp.tool()
def read_file(file_path: str) -> str:
"""Read the contents of a file."""
with open(file_path, 'r') as f:
return f.read()
@mcp.tool()
def list_directory(path: str) -> str:
"""List all files and folders in a directory."""
import os
return "\n".join(os.listdir(path))
⚠️ Important Notes
- The Cloudflare tunnel URL changes every restart (free tier). Update it in ChatGPT after each restart.
- For a permanent URL, sign up for ngrok (free static domain) or use a Cloudflare named tunnel.
- Commands run with a 30-second timeout for safety.
🔐 Security
This server runs commands on your PC — only connect it to ChatGPT accounts you control. The server is NOT authenticated by default.
📝 Errors We Solved
| Error | Cause | Fix |
|---|---|---|
Unsafe URL |
ChatGPT needs HTTPS | Used Cloudflare Tunnel |
Invalid Host header |
FastMCP blocks non-localhost hosts | Disabled DNS rebinding protection |
Request timeout |
SSE connections die through tunnel | Switched to Streamable HTTP |
Not Found |
ChatGPT hits root / not /mcp |
Changed endpoint to root path |
📄 License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.