Token导航 LogoToken导航TokenDH.com
Re Act MCP logo
搜索检索stdio官方级别未说明来源级核验

Re Act MCP

MCP Server

ReActMCP Web Search 是一个集成到AI助手框架中的MCP服务器,提供基本和高级网络搜索功能,返回实时、Markdown格式的搜索结果。

工具数

0

提示词数

0

GitHub Stars

143

资源数

0
搜索PythonClaude实时数据Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

mshojaei77

提供方

mshojaei77

最后核验

2026/5/17 20:58

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python -m venv venv

详细介绍

ReActMCP网络搜索

ReActMCP Web Search是一个MCP(模型上下文协议)服务器,它将Web搜索功能集成到您的人工智能助手框架中。它利用Exa API执行基本和高级Web搜索,返回实时、标记格式的结果,包括标题、URL、发布日期和内容摘要。

该存储库是更广泛的ReActMCP项目的一部分,该项目连接了各种MCP工具和服务器,为您的AI助手提供了广泛的功能。

______________________________________________________________________

目录

- 环境变量 - MCP配置 - 系统提示

- 运行Web搜索服务器 - 测试工具

______________________________________________________________________

特性

  • 基本网络搜索:使用Exa API执行简单搜索。
  • 高级网络搜索:使用其他过滤选项,如域限制、文本包含要求和日期过滤器。
  • Markdown输出:在Markdown中格式化搜索结果,以便轻松合并标题、URL和摘要。
  • MCP集成:轻松将此工具添加到您的MCP服务器生态系统中,以获得多工具AI帮助。

______________________________________________________________________

需求

  • Python 3.8+
  • python dotenv
  • exa_py (查看客户端API)
  • MCP框架可能需要的其他依赖关系

______________________________________________________________________

安装

  1. 克隆存储库
   git clone https://github.com/mshojaei77/ReActMCP.git
   cd ReActMCP
  1. 创建虚拟环境(可选但推荐)
   python -m venv venv
   source venv/bin/activate  # On Windows use: venv\Scripts\activate
  1. 再进行
   pip install -r requirements.txt

______________________________________________________________________

配置

环境变量

创建一个 .env 项目根目录中的文件,至少包含以下变量:

EXA_API_KEY=your_exa_api_key_here
OPENAI_API_KEY=...

此密钥是Exa API执行web搜索所必需的。

MCP配置

MCP配置文件 mcp_config.json 定义MCP服务器可用的设置和工具。提供了一个示例配置:

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

您可以通过修改默认结果数量或添加新的MCP工具等参数来个性化或扩展此配置。

系统提示

system_prompt.txt 该文件配置了AI助手的行为和语调。它引导人们做出友好、吸引人、信息丰富的回应,并包含表情符号。提供了一个示例提示:

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.

请随意调整系统提示,以符合您所需的助手行为。

______________________________________________________________________

用法

运行Web搜索服务器

MCP服务器在 servers 目录。要运行服务器,只需执行它:

python servers/web_search.py

此命令将启动MCP服务器,该服务器将监听请求并公开以下工具:

  • 搜索web:执行基本的网络搜索。
  • advanced_search_web:使用过滤选项执行高级网络搜索。

测试工具

在...之内 web_search.py,测试功能 test_search() 提供(目前已注释掉)以演示搜索功能的基本用法。您可以通过取消注释测试执行块并使用Python的asyncio运行器来运行此测试:

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

这将打印示例查询的搜索结果,并帮助您验证该工具是否按预期运行。

______________________________________________________________________

Claude桌面配置:

通过在配置中添加以下内容,配置Claude Desktop以使用此服务器:

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

故障排除

  • 缺少EXA_API_KEY: 确保 .env 文件已使用有效的Exa API密钥正确设置。
  • 依赖性问题: 验证是否安装了所有必要的Python包(检查您的 requirements.txt 文件)。如有需要,请重新安装软件包。
  • API错误: 如果您在网络搜索过程中遇到错误,请检查您的网络连接并验证Exa API状态。

______________________________________________________________________

许可证

该项目根据MIT许可证获得许可。请参阅 许可证 文件以获取详细信息。

______________________________________________________________________

贡献

欢迎投稿!如果您有建议、错误修复或改进,请打开问题或提交拉取请求。

快乐编码,享受使用ReActMCP Web Search构建个性化、多工具AI助手的乐趣! 🚀😊

明星历史

目录标签

目录标签

搜索PythonClaude实时数据网络搜索本地部署AI助手Markdown格式化

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

部署方式(deploymentType,部署类型)

remote-capable

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiononeremote-capable

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP