---
title: "MCP with ChatGPT Deep Research Compatibility"
description: "Run a ChatGPT Deep Research-compatible Model Context Protocol (MCP) server on Vercel with Next.js."
url: "https://vercel.com/templates/next.js/openai-deep-research-compatible-mcp-with-next-js"
links:
  repository: "https://github.com/vercel-labs/deep-research-server"
  demo: "https://github.com/vercel-labs/express-mcp"
  deploy: "https://vercel.com/new/clone?demo-title=MCP+with+ChatGPT+Deep+Research+Compatibility&demo-description=Run+a+ChatGPT+Deep+Research-compatible+Model+Context+Protocol+%28MCP%29+server+on+Vercel+with+Next.js.&demo-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fexpress-mcp&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F73N0dZEENNBHEK030NFGlR%2F643235f2fbd7c082c7333bb315fab891%2FMCP__6_.jpg&project-name=MCP+with+ChatGPT+Deep+Research+Compatibility&repository-name=openai-deep-research-compatible-mcp-with-next-js&repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fdeep-research-server&from=templates&skippable-integrations=1&root-directories=List+of+directory+paths+for+the+directories+to+clone+into+projects&project-names=Comma+separated+list+of+project+names%2Cto+match+the+root-directories"
---

# MCP with ChatGPT Deep Research Compatibility

Run a ChatGPT Deep Research-compatible Model Context Protocol (MCP) server on Vercel with Next.js.

# Sample MCP Server for ChatGPT Deep Research

This is a sample Model Context Protocol (MCP) server designed to work with ChatGPT's Deep Research feature. It provides semantic search through OpenAI's Vector Store API and document retrieval capabilities, demonstrating how to build custom MCP servers that can extend ChatGPT with company-specific knowledge and tools.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fdeep-research-server)

## Features

- **Search Tool**: Semantic search using OpenAI Vector Store API
- **Fetch Tool**: Complete document retrieval by ID with full content and metadata
- **Sample Data**: Includes 5 sample documents covering various technical topics
- **MCP Compliance**: Follows [OpenAI's MCP specification](https://platform.openai.com/docs/mcp#test-and-connect-your-mcp-server) for deep research integration

## Usage

This sample app uses the [mcp-handler](https://www.npmjs.com/package/mcp-handler) that allows you to drop in an MCP server on a group of routes in any Next.js project.

Update `app/mcp/route.ts` with your tools, prompts, and resources following the [MCP TypeScript SDK documentation](https://github.com/modelcontextprotocol/typescript-sdk/tree/main?tab=readme-ov-file#server).

## Getting Started

1. **Install dependencies**:
   ```bash
   pnpm i
   ```

2. **Run the development server**:
   ```bash
   pnpm dev
   ```

## Connecting to ChatGPT Deep Research

1. **Access ChatGPT Settings**: Go to [ChatGPT settings](https://chatgpt.com/#settings) 
2. **Navigate to Connectors**: Click on the "Connectors" tab
3. **Add MCP Server**: Add your server URL: `http://your-domain/mcp`
4. **Test Connection**: The server should appear as available for deep research

## Notes for running on Vercel

- Make sure you have [Fluid compute](https://vercel.com/docs/functions/fluid-compute) enabled for efficient execution
- [Deploy the ChatGPT Deep Research Template](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fvercel-labs%2Fdeep-research-server)

## Sample Client

`script/test-client.mjs` contains a sample client to try invocations.

```sh
node scripts/test-client.mjs https://mcp-for-next-js.vercel.app
```

## Related Templates

### [Chatbot](https://vercel.com/templates/next.js/chatbot)

A full-featured, hackable Next.js AI chatbot built by Vercel

### [Express.js on Vercel](https://vercel.com/templates/other/express-js-on-vercel)

Simple Express.js + Vercel example that serves html content, JSON data and simulates an API route.

### [MCP with Next.js](https://vercel.com/templates/next.js/model-context-protocol-mcp-with-next-js)

Run an Model Context Protocol (MCP) server on Vercel with Next.js.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
