ChatGPT MCP Bridge
Provides a bridge to the ChatGPT web interface, allowing MCP clients to send prompts and retrieve responses from an active ChatGPT session without needing an API key.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ChatGPT MCP Bridgeask ChatGPT to write a poem about MCP"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ChatGPT MCP Bridge
ChatGPT web arayüzünü yerel bir Model Context Protocol (MCP) sunucusuna bağlayan iki yönlü köprü aracı. OpenAI API anahtarına ihtiyaç duymadan, açık olan ChatGPT tarayıcı oturumunuzu Antigravity, Claude Desktop, Cursor gibi MCP destekli AI ajanları ve IDE'ler için bir araç (tool) haline getirir.
Türkçe Dokümantasyon
Mimari ve Çalışma Prensibi
Sistem üç temel bileşenin eşzamanlı haberleşmesiyle çalışır:
MCP İstemcisi (IDE / Ajan):
FastMCPprotokolü üzerinden yerel Python sürecine bağlanır ve standart JSON-RPC komutları iletir.Python Köprü Sunucusu (
bridge_server.py): Standart girdi/çıktı (stdio) üzerinden MCP komutlarını dinler vews://127.0.0.1:8765adresinde yerel bir WebSocket sunucusu çalıştırır.Chromium Tarayıcı Eklentisi (
chrome-extension): ChatGPT web sayfasına (chatgpt.com) bağlanır. Gelen mesajları ProseMirror giriş alanına enjekte ederek gönderir, streaming durumunu ve DOM üzerindeki asistan yanıtını milisaniye hassasiyetinde izler.
[ AI Ajanı / IDE ]
│ (stdio - MCP JSON-RPC)
▼
[ bridge_server.py ]
│ (WebSocket - ws://127.0.0.1:8765)
▼
[ Chrome Extension (Manifest V3) ]
│ (Content Script / DOM Injection)
▼
[ ChatGPT Web (chatgpt.com) ]Özellikler
API Anahtarı Gerektirmez: Kendi aktif tarayıcı oturumunuzu (Free, Plus veya Team) kullanır.
Gelişmiş DOM Takibi: Modern ChatGPT ProseMirror giriş alanları, Tailwind Typography (
.prose,.markdown) ve turn konteynerleri ile tam uyumludur.Akıllı Yanıt Kararlılığı: ChatGPT'nin yazma (streaming) sürecini takip eder; metin stabil hale gelmeden erken yanıt döndürmez.
Hata Ayıklama ve Dayanıklılık: Zaman aşımı (timeout) koruması, bağlantı kopmalarında otomatik yeniden bağlanma ve ayrıntılı yerel loglama içerir.
Gereksinimler
Python 3.10 veya üzeri
Chromium tabanlı modern bir tarayıcı (Google Chrome, Brave, Microsoft Edge vb.)
Aktif bir ChatGPT oturumu (
https://chatgpt.com)
Kurulum Adımları
1. Python Bağımlılıklarını Yükleyin
Bir sanal ortam (venv) oluşturun ve gerekli paketleri kurun:
# Depoyu klonlayın
git clone https://github.com/Cihanak1/chatgpt-mcp-bridge.git
cd chatgpt-mcp-bridge
# Sanal ortam oluşturun ve aktif edin
python -m venv venv
# Windows için:
venv\Scripts\activate
# Linux / macOS için:
source venv/bin/activate
# Paketleri yükleyin
pip install -r requirements.txt2. Tarayıcı Eklentisini Yükleyin
Tarayıcınızda uzantı yönetim sayfasını açın:
Chrome / Brave:
chrome://extensions/Edge:
edge://extensions/
Sağ üst köşedeki Geliştirici Modu (Developer Mode) seçeneğini aktif edin.
Paketlenmemiş öge yükle (Load unpacked) butonuna tıklayın.
Bu depodaki
chrome-extensionklasörünü seçin.Tarayıcınızda
https://chatgpt.comsekmesini açın. Sayfanın sağ alt köşesinde yeşil renkli "Antigravity Köprüsü Aktif" rozetini gördüğünüzde eklenti hazırdır.
3. MCP Konfigürasyonunu Ekleyin
MCP destekli uygulamanızın (Antigravity, Claude Desktop, Cursor vb.) mcp_config.json dosyasına sunucuyu tanımlayın:
{
"mcpServers": {
"chatgpt-mimar": {
"command": "C:\\path\\to\\venv\\Scripts\\python.exe",
"args": [
"C:\\path\\to\\chatgpt-mcp-bridge\\bridge_server.py"
]
}
}
}(Linux/macOS kullanıyorsanız python yolunu sanal ortamınızdaki ikili dosya ile güncelleyin.)
Kullanılabilir MCP Araçları
chatgpt_baglanti_durumu: ChatGPT tarayıcı sekmesinin eklentiye bağlı olup olmadığını kontrol eder (AKTIFveyaPASIF).chatgpt_mesaj_gonder: Verilen istemi (prompt) ChatGPT arayüzüne yazar ve gönderme butonunu tetikler.chatgpt_yaniti_oku: ChatGPT'nin yazmayı bitirip bitirmediğini denetler ve tamamlanan yanıtı geri döndürür.
Testlerin Çalıştırılması
Depo içerisinde birim, mesajlaşma ve uçtan uca tarayıcı testlerini içeren bir test paketi bulunmaktadır:
# DOM çıkarma mantığını test edin
node tests/test_t1_dom_extraction.js
# Mesajlaşma protokolünü test edin
node tests/test_t2_messaging.js
# WebSocket ve Future çözümleme testini çalıştırın
python tests/test_t3_t4_websocket_future.py
# MCP dönüş testini çalıştırın
python tests/test_t5_mcp_return.pyGüvenlik ve Gizlilik
Tüm WebSocket iletişimi yalnızca yerel makinede (
127.0.0.1) gerçekleşir.Kodlar herhangi bir üçüncü taraf sunucuya veya harici analitik servisine veri göndermez.
ChatGPT ile yapılan tüm etkileşim doğrudan kendi tarayıcınızın OpenAI ile olan mevcut güvenli HTTPS bağlantısı üzerinden akar.
Related MCP server: AgentBridge
English Documentation
Architecture and Working Principle
The system works through the synchronized interaction of three main components:
MCP Client (IDE / Agent): Connects to the local Python process via
FastMCPand sends standard JSON-RPC requests.Python Bridge Server (
bridge_server.py): Listens for MCP commands over stdio and operates a local WebSocket server atws://127.0.0.1:8765.Chromium Extension (
chrome-extension): Injected intochatgpt.com. It receives incoming prompts, inserts them into the ProseMirror editor, triggers the submit button, and monitors the streaming assistant response in real time.
[ AI Agent / IDE ]
│ (stdio - MCP JSON-RPC)
▼
[ bridge_server.py ]
│ (WebSocket - ws://127.0.0.1:8765)
▼
[ Chrome Extension (Manifest V3) ]
│ (Content Script / DOM Injection)
▼
[ ChatGPT Web (chatgpt.com) ]Features
No API Key Required: Operates directly through your active browser session (Free, Plus, or Team).
Modern DOM Selectors: Fully compatible with ProseMirror textareas, Tailwind Typography (
.prose,.markdown), and turn containers.Streaming & Stability Detection: Actively detects response generation and ensures responses are stable before extraction.
Fault Tolerance: Includes timeout protection, automatic reconnection on connection drops, and local file logging.
Prerequisites
Python 3.10+
A modern Chromium-based browser (Chrome, Brave, Edge)
An active session on
https://chatgpt.com
Step-by-Step Installation
1. Setup Python Environment
# Clone the repository
git clone https://github.com/Cihanak1/chatgpt-mcp-bridge.git
cd chatgpt-mcp-bridge
# Create and activate virtual environment
python -m venv venv
# On Windows:
venv\Scripts\activate
# On Linux / macOS:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt2. Load the Chrome Extension
Open your browser's extension page:
Chrome / Brave:
chrome://extensions/Edge:
edge://extensions/
Enable Developer Mode in the upper right corner.
Click Load unpacked.
Select the
chrome-extensiondirectory from this repository.Open
https://chatgpt.com. A green badge indicating "Antigravity Köprüsü Aktif" will appear at the bottom right.
3. Configure Your MCP Client
Add the following to your application's mcp_config.json (Antigravity, Claude Desktop, Cursor, etc.):
{
"mcpServers": {
"chatgpt-mimar": {
"command": "/path/to/venv/bin/python",
"args": [
"/path/to/chatgpt-mcp-bridge/bridge_server.py"
]
}
}
}Exposed MCP Tools
chatgpt_baglanti_durumu: Checks whether the ChatGPT tab is connected (AKTIForPASIF).chatgpt_mesaj_gonder: Enters the specified prompt into the ChatGPT UI and clicks the send button.chatgpt_yaniti_oku: Monitors streaming completion and retrieves the finalized response text.
Running Tests
Unit and integration tests are available in the tests/ directory:
# Run DOM extraction test
node tests/test_t1_dom_extraction.js
# Run messaging protocol test
node tests/test_t2_messaging.js
# Run WebSocket and future resolution test
python tests/test_t3_t4_websocket_future.py
# Run MCP tool return test
python tests/test_t5_mcp_return.pySecurity & Privacy
All WebSocket traffic remains exclusively on localhost (
127.0.0.1).No data is sent to third-party endpoints or telemetry servers.
Interactions with ChatGPT use your browser's existing authenticated HTTPS session with OpenAI.
License
MIT License. See LICENSE for details.
This server cannot be deployed
Maintenance
Related MCP Connectors
- QuallaaOAuthcom.quallaa
Talk to your public-facing AI from any MCP client — Claude, ChatGPT, Cursor, Cline, Windsurf.
MCP connector that lets ChatGPT list, search, and run your Apple Shortcuts via a local Mac agent
Let Claude or ChatGPT search, read and send your WhatsApp messages over MCP. OAuth sign-in.
Browser MCP for logged-in tasks. Uses your Chrome — credentials stay local. Zero-token replay.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables ChatGPT web to use local tools like file reading, command execution, and patch application through an MCP server over OpenAI Secure MCP Tunnel.62MIT
- AlicenseNot gradedqualityBmaintenanceEnables local coding agents to send prompts to a user-authorized ChatGPT webpage through a browser extension and retrieve the final answer via MCP.1Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables MCP clients to ask questions and continue conversations with DeepSeek's web interface, with Expert mode and DeepThink reasoning enabled, without needing an official API key.1-
- AlicenseNot gradedqualityBmaintenanceEnables continuing a local coding task from your own web ChatGPT account by exposing project-scoped read and apply tools over MCP, with no inference API dependency.MIT