Repository hosting for the MCP server code, accessed through cloning for installation.
Supported as a web retriever option for the quick_search tool, allowing search queries through Google's search engine.
Integrates with OpenAI's API for powering the research functionality, requiring an API key for operation.
🔍 GPT Researcher MCP Server
Why GPT Researcher MCP?
While LLM apps can access web search tools with MCP, GPT Researcher MCP delivers deep research results. Standard search tools return raw results requiring manual filtering, often containing irrelevant sources and wasting context window space.
GPT Researcher autonomously explores and validates numerous sources, focusing only on relevant, trusted and up-to-date information. Though slightly slower than standard search (~30 seconds wait), it delivers:
- ✨ Higher quality information
- 📊 Optimized context usage
- 🔎 Comprehensive results
- 🧠 Better reasoning for LLMs
💻 Claude Desktop Demo
https://github.com/user-attachments/assets/ef97eea5-a409-42b9-8f6d-b82ab16c52a8
🚀 Quick Start with Claude Desktop
Want to use this with Claude Desktop right away? Here's the fastest path:
- Install dependencies:
- Set up your Claude Desktop config at
~/Library/Application Support/Claude/claude_desktop_config.json
: - Restart Claude Desktop and start researching! 🎉
For detailed setup instructions, see the full Claude Desktop Integration section below.
Resources
research_resource
: Get web resources related to a given task via research.
Primary Tools
deep_research
: Performs deep web research on a topic, finding the most reliable and relevant informationquick_search
: Performs a fast web search optimized for speed over quality, returning search results with snippets. Supports any GPTR supported web retriever such as Tavily, Bing, Google, etc... Learn more herewrite_report
: Generate a report based on research resultsget_research_sources
: Get the sources used in the researchget_research_context
: Get the full context of the research
Prompts
research_query
: Create a research query prompt
Prerequisites
Before running the MCP server, make sure you have:
- Python 3.11 or higher installed
- Important: GPT Researcher >=0.12.16 requires Python 3.11+
- API keys for the services you plan to use:
You can also connect any other web search engines or MCP using GPTR supported retrievers. Check out the docs here
⚙️ Installation
- Clone the GPT Researcher repository:
- Install the gptr-mcp dependencies:
- Set up your environment variables:
- Copy the
.env.example
file to create a new file named.env
:
- Edit the
.env
file and add your API keys and configure other settings:
- Copy the
You can also add any other env variable for your GPT Researcher configuration.
🚀 Running the MCP Server
You can run the MCP server in several ways:
Method 1: Directly using Python
Method 2: Using the MCP CLI (if installed)
Method 3: Using Docker (recommended for production)
Quick Start
The simplest way to run with Docker:
For n8n Integration
If you need to connect to an existing n8n network:
Note: The Docker image uses Python 3.11 to meet the requirements of gpt-researcher >=0.12.16. If you encounter errors during the build, ensure you're using the latest Dockerfile from this repository.
Once the server is running, you'll see output indicating that the server is ready to accept connections. You can verify it's working by:
- SSE Endpoint: Access the Server-Sent Events endpoint at http://localhost:8000/sse to get a session ID
- MCP Communication: Use the session ID to send MCP messages to http://localhost:8000/messages/?session_id=YOUR_SESSION_ID
- Testing: Run the test script with
python test_mcp_server.py
Important for Docker/n8n Integration:
- The server binds to
0.0.0.0:8000
to work with Docker containers - Uses SSE transport for web-based MCP communication
- Session management requires getting a session ID from
/sse
endpoint first - Each client connection needs a unique session ID for proper communication
🚦 Transport Modes & Best Practices
The GPT Researcher MCP server supports multiple transport protocols and automatically chooses the best one for your environment:
Transport Types
Transport | Use Case | When to Use |
---|---|---|
STDIO | Claude Desktop, Local MCP clients | Default for local development |
SSE | Docker, Web clients, n8n integration | Auto-enabled in Docker |
Streamable HTTP | Modern web deployments | Advanced web deployments |
Automatic Detection
The server automatically detects your environment:
Environment Variables
Variable | Description | Default | Example |
---|---|---|---|
MCP_TRANSPORT | Force specific transport | stdio | sse , streamable-http |
DOCKER_CONTAINER | Force Docker mode | Auto-detected | true |
Configuration Examples
For Claude Desktop (Local)
For Docker/Web Deployment
For n8n MCP Integration
Transport Endpoints
When using SSE or HTTP transports:
- Health Check:
GET /health
- SSE Endpoint:
GET /sse
(get session ID) - MCP Messages:
POST /messages/?session_id=YOUR_SESSION_ID
Best Practices
- Local Development: Use default STDIO for Claude Desktop
- Production: Use Docker with automatic SSE detection
- Testing: Use health endpoints to verify connectivity
- n8n Integration: Always use container networking with Docker
- Web Deployment: Consider Streamable HTTP for modern clients
Integrating with Claude
You can integrate your MCP server with Claude using:
Claude Desktop Integration - For using with Claude desktop application on Mac
For detailed instructions, follow the link above.
💻 Claude Desktop Integration
To integrate your locally running MCP server with Claude for Mac, you'll need to:
- Make sure the MCP server is installed and running
- Configure Claude Desktop:
- Locate or create the configuration file at
~/Library/Application Support/Claude/claude_desktop_config.json
- Add your local GPT Researcher MCP server to the configuration with environment variables
- Restart Claude to apply the configuration
- Locate or create the configuration file at
⚠️ Important: Environment Variables Required
Claude Desktop launches your MCP server as a separate subprocess, so you must explicitly pass your API keys in the configuration. The server cannot access your shell's environment variables or .env
file automatically.
Configuration Example
Security Note
🔒 Your Claude Desktop config contains sensitive API keys. Protect it:
Never commit this file to version control.
Alternative: Environment Variable Script
For better security, create a wrapper script:
run_gptr_mcp.sh:
Then use it in Claude Desktop:
For complete step-by-step instructions, see the Claude Desktop Integration guide.
📝 Example Usage with Claude
🔧 Troubleshooting
If you encounter issues while running the MCP server:
General Issues
- API Keys: Make sure your API keys are correctly set in the
.env
file - Python Version: Check that you're using Python 3.11 or higher (required by gpt-researcher >=0.14.0)
- Dependencies: Ensure all dependencies are installed correctly:
pip install -r requirements.txt
- Server Logs: Check the server logs for error messages
Docker Issues
- Container not accessible:
- Verify the container is running:
docker ps | grep gptr-mcp
- Check container logs:
docker logs gptr-mcp
- Confirm the server is binding to 0.0.0.0:8000 (logs should show this)
- Verify the container is running:
- n8n Integration Issues:
- Ensure both containers are on the same Docker network
- Use the container name
gptr-mcp
as the hostname in n8n - Set the MCP server URL to:
http://gptr-mcp:8000/sse
- Session ID Issues:
- The server uses SSE transport which requires session management
- First, get a session ID by connecting to
/sse
endpoint - Use the session ID in subsequent MCP requests:
/messages/?session_id=YOUR_ID
- Each client needs its own session ID
n8n MCP Integration Steps
- Get Session ID:
- Initialize MCP:
- Call Tools:
Testing the Server
Run the included test script to verify functionality:
This will test:
- SSE connection and session ID retrieval
- MCP initialization
- Tool discovery and execution
Claude Desktop Issues
If your MCP server isn't working with Claude Desktop:
- Server not appearing in Claude:
- Check your
claude_desktop_config.json
syntax is valid JSON - Ensure you're using absolute paths (not relative)
- Verify the path to
server.py
is correct - Restart Claude Desktop completely
- Check your
- "OPENAI_API_KEY not found" error:
- Make sure you added API keys to the
env
section in your config - Don't forget both
OPENAI_API_KEY
andTAVILY_API_KEY
- API keys should be the actual keys, not placeholders
- Make sure you added API keys to the
- Tools not showing up:
- Look for the 🔧 tools icon in Claude Desktop
- Check that Claude Desktop config file is in the right location:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
%APPDATA%\Claude\claude_desktop_config.json
- macOS:
- Python/Permission issues:
- Make sure Python is accessible from the command line:
python --version
- Try using full Python path:
"command": "/usr/bin/python3"
or"command": "python3"
- Check file permissions on your server.py file
- Make sure Python is accessible from the command line:
- Still not working?
- Test the server manually:
python server.py
(should show STDIO transport message) - Check Claude Desktop logs (if available)
- Try the alternative script method from the integration section above
- Test the server manually:
👣 Next Steps
- Explore the MCP protocol documentation to better understand how to integrate with Claude
- Learn about GPT Researcher's core features to enhance your research capabilities
- Check out the Advanced Usage guide for more configuration options
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
📞 Support / Contact
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Enhances LLM applications with deep autonomous web research capabilities, delivering higher quality information than standard search tools by exploring and validating numerous trusted sources.
Related MCP Servers
- AsecurityAlicenseAqualityIntegrates Tavily's search API with LLMs to provide advanced web search capabilities, including intelligent result summaries, domain filtering for quality control, and configurable search parameters.Last updated -36869JavaScriptMIT License
- -securityAlicense-qualityEnables integration with DuckDuckGo search capabilities for LLMs, supporting comprehensive web search, regional filtering, result types, and safe browsing with caching and customizable search parameters.Last updated -173TypeScriptMIT License
- -securityAlicense-qualityProvides AI-powered web search capabilities using Tavily's search API, enabling LLMs to perform sophisticated web searches, get direct answers to questions, and search recent news articles.Last updated -68PythonMIT License
- AsecurityAlicenseAqualityEnables LLMs to autonomously retrieve and explore web content by fetching pages and recursively following links to a specified depth, particularly useful for learning about topics from documentation.Last updated -17TypeScriptMIT License