ChatGPT MCP Server Template
A boilerplate for building local Node.js MCP servers that integrate with ChatGPT Web UI, featuring mock OAuth and secure tunneling for instant connection.
README
ChatGPT MCP Server Template
A boilerplate repository for building a local Node.js Model Context Protocol (MCP) Server that integrates seamlessly with the ChatGPT Web UI.
🌟 Features
- Express + MCP SDK: Utilizes the official
@modelcontextprotocol/sdkwith Server-Sent Events (SSE). - Mock OAuth with DCR: Automatically bypasses ChatGPT's strict remote MCP OAuth requirements by implementing a mock OAuth flow and Dynamic Client Registration (DCR). No need to manually enter Client IDs!
- Tunnel Ready: Includes npm scripts to instantly expose your local server securely over HTTPS via
Pinggy.
🚀 Getting Started
1. Install Dependencies
npm install
2. Run the Server
Start the local server in development mode:
npm run dev
3. Expose the Server to the Internet
In a separate terminal, run the following command to start a free, stable SSH tunnel via Pinggy:
npm run tunnel
You will receive an output containing a URL like: https://<hash>.run.pinggy-free.link.
4. Connect to ChatGPT
- Go to Settings > Custom Tools / MCP Servers in ChatGPT.
- Under MCP Server URL, enter your Pinggy URL appended with
/sse:https://<hash>.run.pinggy-free.link/sse - Under Authentication, select
OAuth. - Click Save. ChatGPT will auto-register and authenticate instantly!
🛠️ Adding Custom Tools
To add your own tools, database queries, or local API integrations, edit src/tools/example.ts.
⚠️ Security Warning
This template mocks the OAuth flow and implicitly grants access to any client that connects. Do not expose highly sensitive local operations without adding your own authorization checks in the tool handlers, or ensure you configure ChatGPT to "Ask before running" for mutating operations.
🐛 Troubleshooting
Why not use localtunnel?
If you try to substitute Pinggy with localtunnel (e.g. npx localtunnel --port 3000), ChatGPT will fail to connect with an error like:
The server doesn't support RFC 7591 Dynamic Client Registration
Reason: localtunnel injects a "Click to Continue" HTML warning page on the first visit. This intercepts the .well-known JSON endpoints required by ChatGPT for OAuth Discovery, breaking the authentication flow. Pinggy is used in this template because it streams traffic directly without injecting warning pages.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.