Skip to main content
Glama
kathirm1323-ai

ChatGPT Desktop Commander MCP

🖥️ 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

Related MCP server: WordPress MCP Server

⚡ 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

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kathirm1323-ai/MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server