Faust-Donf

ChatGPT MCP Server Template

Community Faust-Donf
Updated

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/sdk with 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

  1. Go to Settings > Custom Tools / MCP Servers in ChatGPT.
  2. Under MCP Server URL, enter your Pinggy URL appended with /sse:https://<hash>.run.pinggy-free.link/sse
  3. Under Authentication, select OAuth.
  4. 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 RegistrationReason: 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.

MCP Server ยท Populars

MCP Server ยท New

    bobmatnyc

    MCP Vector Search

    CLI-first semantic code search with MCP integration. Modern, fast, and intelligent code search powered by ChromaDB and AST parsing.

    Community bobmatnyc
    ptbsare

    MCP Proxy Server

    This server acts as a central hub for Model Context Protocol (MCP) resource servers.

    Community ptbsare
    docling-project

    Docling MCP: making docling agentic

    Making docling agentic through MCP

    Community docling-project
    SouravRoy-ETL

    duckle

    Local-first ETL/ELT studio: a drag-and-drop visual pipeline designer that compiles to SQL and runs on DuckDB. Tiny desktop app, no servers, git-friendly workspaces.

    Community SouravRoy-ETL
    ksylvan

    Fabric MCP Server

    Fabric MCP Server: Seamlessly integrate Fabric AI capabilities into MCP-enabled tools like IDEs and chat interfaces.

    Community ksylvan