$git clone https://github.com/assafelovic/gptr-mcp</div>
| 1 | <div align="center" id="top"> |
| 2 | |
| 3 | <img src="https://github.com/assafelovic/gpt-researcher/assets/13554167/20af8286-b386-44a5-9a83-3be1365139c3" alt="Logo" width="80"> |
| 4 | |
| 5 | # 🔍 GPT Researcher MCP Server |
| 6 | |
| 7 | [](https://gptr.dev) |
| 8 | [](https://docs.gptr.dev/docs/gpt-researcher/mcp-server/getting-started) |
| 9 | [](https://discord.gg/QgZXvJAccX) |
| 10 | |
| 11 | </div> |
| 12 | |
| 13 | ## Why GPT Researcher MCP? |
| 14 | |
| 15 | 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. |
| 16 | |
| 17 | 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: |
| 18 | |
| 19 | - ✨ Higher quality information |
| 20 | - 📊 Optimized context usage |
| 21 | - 🔎 Comprehensive results |
| 22 | - 🧠 Better reasoning for LLMs |
| 23 | |
| 24 | ## 💻 Claude Desktop Demo |
| 25 | https://github.com/user-attachments/assets/ef97eea5-a409-42b9-8f6d-b82ab16c52a8 |
| 26 | |
| 27 | ## 🚀 Quick Start with Claude Desktop |
| 28 | |
| 29 | **Want to use this with Claude Desktop right away?** Here's the fastest path: |
| 30 | |
| 31 | 1. **Install dependencies:** |
| 32 | ```bash |
| 33 | git clone https://github.com/assafelovic/gptr-mcp.git |
| 34 | pip install -r requirements.txt |
| 35 | ``` |
| 36 | |
| 37 | 2. **Set up your Claude Desktop config** at `~/Library/Application Support/Claude/claude_desktop_config.json`: |
| 38 | ```json |
| 39 | { |
| 40 | "mcpServers": { |
| 41 | "gptr-mcp": { |
| 42 | "command": "python", |
| 43 | "args": ["/absolute/path/to/gpt-researcher/gptr-mcp/server.py"], |
| 44 | "env": { |
| 45 | "OPENAI_API_KEY": "your-openai-key-here", |
| 46 | "TAVILY_API_KEY": "your-tavily-key-here" |
| 47 | } |
| 48 | } |
| 49 | } |
| 50 | } |
| 51 | ``` |
| 52 | |
| 53 | 3. **Restart Claude Desktop** and start researching! 🎉 |
| 54 | |
| 55 | For detailed setup instructions, see the [full Claude Desktop Integration section](#-claude-desktop-integration) below. |
| 56 | |
| 57 | ### Resources |
| 58 | - `research_resource`: Get web resources related to a given task via research. |
| 59 | |
| 60 | ### Primary Tools |
| 61 | |
| 62 | - `deep_research`: Performs deep web research on a topic, finding the most reliable and relevant information |
| 63 | - `quick_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 [here](https://docs.gptr.dev/docs/gpt-researcher/search-engines) |
| 64 | - `write_report`: Generate a report based on research results |
| 65 | - `get_research_sources`: Get the sources used in the research |
| 66 | - `get_research_context`: Get the full context of the research |
| 67 | |
| 68 | ### Prompts |
| 69 | |
| 70 | - `research_query`: Create a research query prompt |
| 71 | |
| 72 | ## Prerequisites |
| 73 | |
| 74 | Before running the MCP server, make sure you have: |
| 75 | |
| 76 | 1. Python 3.11 or higher installed |
| 77 | - **Important**: GPT Researcher >=0.12.16 requires Python 3.11+ |
| 78 | 2. API keys for the services you plan to use: |
| 79 | - [OpenAI API key](https://platform.openai.com/api-keys) |
| 80 | - [Tavily API key](https://app.tavily.com) |
| 81 | |
| 82 | You can also connect any other web search engines or MCP using GPTR supported retrievers. Check out the [docs here](https://docs.gptr.dev/docs/gpt-researcher/search-engines) |
| 83 | |
| 84 | ## ⚙️ Installation |
| 85 | |
| 86 | 1. Clone the GPT Researcher repository: |
| 87 | ```bash |
| 88 | git clone https://github.com/assafelovic/gpt-researcher.git |
| 89 | cd gpt-researcher |
| 90 | ``` |
| 91 | |
| 92 | 2. Install the gptr-mcp dependencies: |
| 93 | ```bash |
| 94 | cd gptr-mcp |
| 95 | pip install -r requirements.txt |
| 96 | ``` |
| 97 | |
| 98 | 3. Set up your environment variables: |
| 99 | - Copy the `.env.example` file to create a new file named `.env`: |
| 100 | ```bash |
| 101 | cp .env.example .env |
| 102 | ``` |
| 103 | - Edit the `.env` file and add your API keys and config |