Cover image
Try Now
2025-03-20

ReactMCP是一款反应性MCP服务器,它使AI助手能够以EXA API启动的实时,Markdown-Formatter-formatter-formatter-formatter-Markdown-formatter-formatter-formatter-markdown-formatter-markdown-Formatter-formated-formains的助手。

3 years

Works with Finder

3

Github Watches

18

Github Forks

129

Github Stars

ReActMCP Web Search

ReActMCP Web Search is an MCP (Model Context Protocol) server that integrates web search capabilities into your AI assistant framework. It leverages the Exa API to perform both basic and advanced web searches, returning real-time, markdown-formatted results including titles, URLs, publication dates, and content summaries.

This repository is part of the broader ReActMCP project that connects various MCP tools and servers to empower your AI assistant with a wide range of capabilities.


Table of Contents


Features

  • Basic Web Search: Perform simple searches using the Exa API.
  • Advanced Web Search: Use additional filtering options such as domain restrictions, text inclusion requirements, and date filters.
  • Markdown Output: Format search results in Markdown to easily incorporate titles, URLs, and summaries.
  • MCP Integration: Easily add this tool into your MCP server ecosystem for multi-tool AI assistance.

Requirements

  • Python 3.8+
  • python-dotenv
  • exa_py (Exa API client)
  • Other dependencies that may be required by your MCP framework

Installation

  1. Clone the Repository

    git clone https://github.com/mshojaei77/ReActMCP.git
    cd ReActMCP
    
  2. Create a Virtual Environment (Optional but recommended)

    python -m venv venv
    source venv/bin/activate  # On Windows use: venv\Scripts\activate
    
  3. Install Dependencies

    pip install -r requirements.txt
    

Configuration

Environment Variables

Create a .env file in the project root directory with at least the following variable:

EXA_API_KEY=your_exa_api_key_here
OPENAI_API_KEY=...

This key is required by the Exa API for performing web searches.

MCP Configuration

The MCP configuration file mcp_config.json defines the settings and tools available to your MCP server. An example configuration is provided:

{
  "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"
  }
}

You can personalize or extend this configuration by modifying parameters such as default number of results or adding new MCP tools.

System Prompt

The system_prompt.txt file configures the behavior and tone of your AI assistant. It guides responses to be friendly, engaging, and informative, with the inclusion of emojis. An example prompt is provided:

You are a helpful, knowledgeable AI assistant with web search capabilities. Your goal is to provide accurate, comprehensive, and up-to-date information to users.
Use lots of emojis and make your responses fun and engaging.

## Available Search Tools

- `search_web`: Basic web search that returns results based on a query
- `advanced_search_web`: Advanced search with filtering options for domains, required text, and date ranges

## Guidelines for Responding to Questions

1. For current information or facts that might have changed since your training data, use the appropriate search tool to find the most recent and relevant information.

2. Use `search_web` for general queries and `advanced_search_web` with appropriate filters for more specific needs.

3. Formulate precise search queries to maximize result relevance.

4. For recent information, use the `max_age_days` parameter in advanced search to limit results to recent publications.

5. When targeting specific sources, use the `include_domains` parameter to focus your search.

6. Cite sources by including URLs from search results.

7. For insufficient or contradictory results, acknowledge limitations and explain findings.

8. Break down complex topics into organized sections.

9. Provide balanced perspectives on controversial topics.

10. Be transparent about uncertainty rather than making up information.

11. Maintain a helpful, informative, and conversational tone.

## Response Quality Standards

Your responses should be well-structured, factually accurate, and tailored to the user's level of understanding on the topic. Use the web search capabilities as your primary tools for accessing current information before responding to time-sensitive or factual queries.

Feel free to adjust the system prompt to align with your desired assistant behavior.


Usage

Running the Web Search Server

The MCP servers is implemented in servers directory. To run a server, simply execute it :

python servers/web_search.py

This command will start the MCP server which listens for requests and exposes the following tools:

  • search_web: Perform basic web searches.
  • advanced_search_web: Perform advanced web searches with filtering options.

Testing the Tools

Within web_search.py, a test function test_search() is provided (currently commented out) to demonstrate basic usage of the search capabilities. You can run this test by uncommenting the test execution block and using Python's asyncio runner:

if __name__ == "__main__":
    import asyncio
    # Uncomment the following line to perform a test search
    # asyncio.run(test_search())
    mcp.run()

This will print search results for sample queries and help you verify that the tool is functioning as expected.


Claude Desktop Configuration:

Configure Claude Desktop to use this server by adding the following to your configuration:

{
  "mcpServers": {
    "websearch": {
         "command": "python",
         "args": ["path/to/servers/exa_web_search.py"]
       }
  }
}

Troubleshooting

  • Missing EXA_API_KEY: Ensure that the .env file is properly set up with your valid Exa API key.
  • Dependency Issues: Verify that all necessary Python packages are installed (check your requirements.txt file). Reinstall packages if needed.
  • API Errors: If you encounter errors during web searches, check your network connection and verify the Exa API status.

License

This project is licensed under the MIT License. See the LICENSE file for details.


Contributing

Contributions are welcome! If you have suggestions, bug fixes, or improvements, please open an issue or submit a pull request.

Happy coding and enjoy building your personalized, multi-tool AI assistant with ReActMCP Web Search! 🚀😊

Star History

Star History Chart

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • https://zenepic.net
  • Embark on a thrilling diplomatic quest across a galaxy on the brink of war. Navigate complex politics and alien cultures to forge peace and avert catastrophe in this immersive interstellar adventure.

  • https://reddgr.com
  • Delivers concise Python code and interprets non-English comments

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • av
  • 毫不费力地使用一个命令运行LLM后端,API,前端和服务。

  • 1Panel-dev
  • 🔥1Panel提供了直观的Web接口和MCP服务器,用于在Linux服务器上管理网站,文件,容器,数据库和LLMS。

  • GeyserMC
  • 与Minecraft客户端/服务器通信的库。

  • Mintplex-Labs
  • 带有内置抹布,AI代理,无代理构建器,MCP兼容性等的多合一桌面和Docker AI应用程序。

  • awslabs
  • AWS MCP服务器 - 将AWS最佳实践直接带入您的开发工作流程的专门MCP服务器

  • WangRongsheng
  • 🧑‍🚀 llm 资料总结(数据处理、模型训练、模型部署、 o1 模型、mcp 、小语言模型、视觉语言模型)|摘要世界上最好的LLM资源。

    Reviews

    3 (1)
    Avatar
    user_g1VKabao
    2025-04-17

    ReActMCP is an exceptional application for anyone looking to enhance their MCP experience. Created by mshojaei77, it offers seamless integration and user-friendly functionality. Highly recommend checking it out on GitHub: https://github.com/mshojaei77/ReActMCP. A must-try for MCP enthusiasts!