Home / MCP / ReactMCP Server

ReactMCP Server

Provides web search capabilities via the Exa API integrated into an MCP server with basic and advanced search and Markdown results.

python
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "websearch": {
            "command": "python",
            "args": [
                "servers/web_search.py"
            ],
            "env": {
                "EXA_API_KEY": "YOUR_EXA_API_KEY"
            }
        }
    }
}

This MCP server adds real-time web search capabilities to your AI assistant framework by integrating the Exa API. It supports basic and advanced searches and returns results in Markdown, including titles, URLs, dates, and summaries, making it easy to incorporate live web information into conversations.

How to use

You run this server alongside your MCP client and invoke its search tools from your MCP workflow. Use the basic web search tool to look up general queries and the advanced search tool when you need filters such as specific domains, required terms, or date ranges. The server returns results formatted in Markdown so you can display them directly in your UI.

How to install

Prerequisites: Python 3.8 or newer, and dependencies listed for the project.

1. Create a project directory and navigate into it.

2. Create and activate a virtual environment.

3. Install dependencies from the requirements file.

Configuration and running

Configure your environment with the API key for Exa. Create a file named .env in your project root and add at least the following variables.

EXA_API_KEY=your_exa_api_key_here
OPENAI_API_KEY=...

The MCP configuration defines the available tools and how to run the server. An example configuration includes a tool named websearch that runs a Python script and requires the Exa API key.

{
  "websearch": {
    "script": "web_search.py",
    "encoding_error_handler": "ignore",
    "description": "Web search capability using Exa API that provides real-time internet search results. Supports both basic and advanced search with filtering options including domain restrictions, text inclusion requirements, and date filtering. Returns formatted results with titles, URLs, publication dates, and content summaries.",
    "required_env_vars": ["EXA_API_KEY"],
    "active": true
  },
  "settings": {
    "model": "gpt-4o",
    "system_prompt_path": "system_prompt.txt"
  }
}

Additional sections

System prompt behavior and tool usage are configured to guide responses with a friendly, helpful tone and to clearly delineate when live web information is used.

To run the web search server directly, you can execute the server script as shown in the usage flow.

Testing the tools

You can verify functionality by running the server and performing sample searches through your MCP client, which should return Markdown-formatted results for review.

Troubleshooting

Missing EXA_API_KEY: Ensure the .env file is present and contains a valid key. Dependency issues: Install required Python packages listed in the dependency manifest. API errors: Check your network connection and the Exa API status.

Notes

The server exposes two tools: search_web for basic searches and advanced_search_web for searches with domain, text, and date constraints.

Example MCP configuration snippet

{
  "websearch": {
    "script": "web_search.py",
    "encoding_error_handler": "ignore",
    "description": "Web search capability using Exa API that provides real-time internet search results. Supports both basic and advanced search with filtering options including domain restrictions, text inclusion requirements, and date filtering. Returns formatted results with titles, URLs, publication dates, and content summaries.",
    "required_env_vars": ["EXA_API_KEY"],
    "active": true
  },
  "settings": {
    "model": "gpt-4o",
    "system_prompt_path": "system_prompt.txt"
  }
}

Available tools

search_web

Basic web search tool that returns results based on a query.

advanced_search_web

Advanced search tool with filtering options for domains, required text, and date ranges.