ChatGPT Desktop Commander MCP

ChatGPT Desktop Commander MCP

A Python MCP server that allows ChatGPT to execute commands on your local PC via a secure Cloudflare tunnel.

Category
Visit Server

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

  1. Copy the https://...trycloudflare.com URL from the tunnel output
  2. Go to ChatGPT → Settings → Apps → Create New Connector
  3. Paste the URL directly (no /mcp needed)
  4. Authentication: No Auth
  5. 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

  1. server.py runs a FastMCP server with Streamable HTTP transport on port 8000
  2. cloudflared.exe creates a secure HTTPS tunnel to your local server
  3. ChatGPT connects via the tunnel URL and calls the run_command tool
  4. 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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured