Exa MCP Server

Official
MIT License
1,858
510
  • Apple

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Exa MCP 服务器

模型上下文协议 (MCP) 服务器允许像 Claude 这样的 AI 助手使用 Exa AI Search API 进行网页搜索。此设置允许 AI 模型以安全可控的方式获取实时网页信息。

演示视频https://www.loom.com/share/ac676f29664e4c6cb33a2f0a63772038?sid=0e72619f-5bfc-415d-a705-63d326373f60

MCP 是什么?🤔

模型上下文协议 (MCP) 是一个允许 AI 应用(例如 Claude Desktop)连接到外部工具和数据源的系统。它为 AI 助手提供了一种清晰、安全的方式,使其能够使用本地服务和 API,同时保持用户的控制权。

这个服务器是做什么的?🚀

Exa MCP 服务器:

  • 使 AI 助手能够使用 Exa 强大的搜索 API 执行网络搜索
  • 提供结构化的搜索结果,包括标题、URL 和内容片段
  • 将最近的搜索缓存为参考资源
  • 优雅地处理速率限制和错误情况
  • 支持实时网页抓取新鲜内容

先决条件📋

在开始之前,请确保您已:

您可以通过运行以下命令来验证您的 Node.js 安装:

node --version # Should show v18.0.0 or higher

安装🛠️

NPM 安装

npm install -g exa-mcp-server

使用 Smithery

要通过Smithery自动为 Claude Desktop 安装 Exa MCP 服务器:

npx -y @smithery/cli install exa --client claude

手动安装

  1. 克隆存储库:
git clone https://github.com/exa-labs/exa-mcp-server.git cd exa-mcp-server
  1. 安装依赖项:
npm install
  1. 构建项目:
npm run build
  1. 创建全局链接(这使得服务器可以从任何地方执行):
npm link

配置⚙️

1. 配置 Claude Desktop 以识别 Exa MCP 服务器

您可以在 Claude Desktop 应用程序的设置中找到 claude_desktop_config.json:

打开 Claude 桌面应用程序并从左上角的菜单栏启用开发者模式。

启用后,打开“设置”(也可以从左上角的菜单栏中打开),然后导航到“开发者选项”,在那里你会找到“编辑配置”按钮。点击它将打开 claude_desktop_config.json 文件,允许你进行必要的编辑。

或者(如果您想从终端打开 claude_desktop_config.json)

对于 macOS:

  1. 打开您的 Claude Desktop 配置:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json

对于 Windows:

  1. 打开您的 Claude Desktop 配置:
code %APPDATA%\Claude\claude_desktop_config.json

2.添加Exa服务器配置:

{ "mcpServers": { "exa": { "command": "npx", "args": ["/path/to/exa-mcp-server/build/index.js"], "env": { "EXA_API_KEY": "your-api-key-here" } } } }

your-api-key-here替换为来自dashboard.exa.ai/api-keys的实际 Exa API 密钥。

3. 可用工具及工具选择

Exa MCP 服务器包括以下工具:

  • web_search :执行实时网络搜索,优化结果并提取内容。
  • research_paper_search :专注于学术论文和研究内容的专业搜索。
  • twitter_search :专用的 Twitter/X.com 搜索,可查找推文、个人资料和对话。
  • company_research :综合公司研究工具,抓取公司网站以收集有关业务的详细信息。
  • 爬行:从特定的 URL 中提取内容,当您拥有准确的 URL 时,这对于阅读文章、PDF 或任何网页很有用。
  • competitor_finder :通过搜索提供类似产品或服务的企业来识别公司的竞争对手。

您可以通过将--tools参数添加到 Claude Desktop 配置来选择要启用的工具:

指定要启用的工具:

{ "mcpServers": { "exa": { "command": "npx", "args": [ "/path/to/exa-mcp-server/build/index.js", "--tools=web_search,research_paper_search,twitter_search,company_research,crawling,competitor_finder" ], "env": { "EXA_API_KEY": "your-api-key-here" } } } }

要启用多个工具,请使用逗号分隔的列表:

{ "mcpServers": { "exa": { "command": "npx", "args": [ "/path/to/exa-mcp-server/build/index.js", "--tools=web_search,research_paper_search,twitter_search,company_research,crawling,competitor_finder" ], "env": { "EXA_API_KEY": "your-api-key-here" } } } }

如果您未指定任何工具,则将使用默认启用的所有工具。

4. 重启 Claude Desktop

要使更改生效:

  1. 完全退出 Claude Desktop(不只是关闭窗口)
  2. 重新启动 Claude Desktop
  3. 查找🔌图标以验证 Exa 服务器是否已连接

通过 NPX 使用

如果您希望直接运行服务器,则可以使用 npx:

# Run with all tools enabled by default npx exa-mcp-server # Enable specific tools only npx exa-mcp-server --tools=web_search # Enable multiple tools npx exa-mcp-server --tools=web_search,research_paper_search # List all available tools npx exa-mcp-server --list-tools

用法🎯

配置完成后,你可以让 Claude 执行网页搜索。以下是一些示例提示:

Can you search for recent developments in quantum computing?
Search for and summarize the latest news about artificial intelligence startups in new york.
Find and analyze recent research papers about climate change solutions.
Search Twitter for posts from @elonmusk about SpaceX.
Find tweets from @samaltman that were published in the last week about AI safety.
Research the company exa.ai and find information about their pricing and features.
Extract the content from this research paper: https://arxiv.org/pdf/1706.03762
Find competitors for a company that provides web search API services, excluding exa.ai from the results.

服务器将:

  1. 处理搜索请求
  2. 使用最佳设置查询 Exa API(包括实时抓取)
  3. 将格式化的结果返回给 Claude
  4. 缓存搜索以供将来参考

使用 MCP Inspector 进行测试

您可以使用 MCP Inspector 直接测试服务器:

npx @modelcontextprotocol/inspector node ./build/index.js

这将打开一个交互式界面,您可以在其中探索服务器的功能、执行搜索查询并查看缓存的搜索结果。

故障排除

常见问题

  1. 未找到服务器
    • 验证 npm 链接是否正确设置
    • 检查 Claude Desktop 配置语法
    • 确保 Node.js 已正确安装
  2. API 密钥问题
    • 确认您的 EXA_API_KEY 有效
    • 检查 Claude Desktop 配置中的 EXA_API_KEY 是否正确设置
    • 验证 API 密钥周围没有空格或引号
  3. 连接问题
    • 完全重启Claude Desktop
    • 检查 Claude Desktop 日志:GXP23

致谢🙏

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

Tools

模型上下文协议 (MCP) 服务器允许像 Claude 这样的 AI 助手使用 Exa AI Search API 进行网页搜索。此设置允许 AI 模型以安全可控的方式获取实时网页信息。

  1. What is MCP? 🤔
    1. What does this server do? 🚀
      1. Prerequisites 📋
        1. Installation 🛠️
          1. NPM Installation
          2. Using Smithery
          3. Manual Installation
        2. Configuration ⚙️
          1. 1. Configure Claude Desktop to recognize the Exa MCP server
          2. 2. Add the Exa server configuration:
          3. 3. Available Tools & Tool Selection
          4. 4. Restart Claude Desktop
        3. Using via NPX
          1. Usage 🎯
            1. Testing with MCP Inspector 🔍
              1. Troubleshooting 🔧
                1. Common Issues
              2. Acknowledgments 🙏
                ID: 8gfe5kbp5y