Exa Mcp Server Heroku

Exa Mcp Server Heroku

🚀 Exa MCP Server 🔍

Exa MCP Server 是一个模型上下文协议(MCP)服务器,它允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。通过这种设置,AI 模型能够以安全且可控的方式获取实时网络信息。

Deploy to Heroku

npm version smithery badge

🚀 快速开始

远程 Exa MCP 🌐

可以直接连接到 Exa 托管的 MCP 服务器(而不是在本地运行)。

远程 Exa MCP URL

https://mcp.exa.ai/mcp?exaApiKey=your-exa-api-key

请将 your-api-key-here 替换为你从 dashboard.exa.ai/api-keys 获取的实际 Exa API 密钥。

Claude 桌面端远程 MCP 配置

在你的 Claude 桌面端配置文件中添加以下内容:

{
"mcpServers": {
"exa": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.exa.ai/mcp?exaApiKey=your-exa-api-key"
]
}
}
}

NPM 安装

npm install -g exa-mcp-server

使用 Claude 代码

claude mcp add exa -e EXA_API_KEY=YOUR_API_KEY -- npx -y exa-mcp-server

使用 Smithery

要通过 Smithery 自动为 Claude 桌面端安装 Exa MCP 服务器,请执行以下命令:

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

📦 安装指南

配置 ⚙️

1. 配置 Claude 桌面端以识别 Exa MCP 服务器

你可以在 Claude 桌面端应用的设置中找到 claude_desktop_config.json 文件。具体操作如下: 打开 Claude 桌面端应用,从左上角菜单栏启用开发者模式。启用后,打开设置(同样从左上角菜单栏),导航到开发者选项,找到“编辑配置”按钮。点击该按钮将打开 claude_desktop_config.json 文件,你可以在其中进行必要的编辑。

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

  • macOS
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • Windows
code %APPDATA%\Claude\claude_desktop_config.json

2. 添加 Exa 服务器配置

{
"mcpServers": {
"exa": {
"command": "npx",
"args": ["-y", "exa-mcp-server"],
"env": {
"EXA_API_KEY": "your-api-key-here"
}
}
}
}

请将 your-api-key-here 替换为你从 dashboard.exa.ai/api-keys 获取的实际 Exa API 密钥。

3. 可用工具及工具选择

Exa MCP 服务器包含以下工具,你可以通过添加 --tools 参数来启用它们:

  • web_search_exa:执行实时网络搜索,提供优化结果和内容提取功能。
  • company_research:全面的公司研究工具,可爬取公司网站以收集有关企业的详细信息。
  • crawling:从特定 URL 提取内容,当你有确切的 URL 时,可用于阅读文章、PDF 或任何网页。
  • linkedin_search:使用 Exa AI 在 LinkedIn 上搜索公司和人员。只需在查询中包含公司名称、人员姓名或特定的 LinkedIn URL 即可。
  • deep_researcher_start:为复杂问题启动智能 AI 研究人员。AI 将搜索网络、阅读多个来源,并深入思考你的问题,以创建详细的研究报告。
  • deep_researcher_check:检查你的研究是否完成并获取结果。在启动研究任务后使用此工具,查看是否完成并获取全面的报告。

你可以通过在 Claude 桌面端配置中添加 --tools 参数来选择要启用的工具:

{
"mcpServers": {
"exa": {
"command": "npx",
"args": [
"-y",
"exa-mcp-server",
"--tools=web_search_exa,company_research,crawling,linkedin_search,deep_researcher_start,deep_researcher_check"
],
"env": {
"EXA_API_KEY": "your-api-key-here"
}
}
}
}

如果你想启用多个工具,请使用逗号分隔的列表。如果你未指定任何工具,将使用所有默认启用的工具。

4. 重启 Claude 桌面端

要使更改生效,请执行以下操作:

  1. 完全退出 Claude 桌面端(不仅仅是关闭窗口)。
  2. 再次启动 Claude 桌面端。
  3. 查找图标以验证 Exa 服务器是否已连接。

通过 NPX 使用

如果你更喜欢直接运行服务器,可以使用 npx:

# 默认启用所有工具运行
npx exa-mcp-server

# 仅启用特定工具
npx exa-mcp-server --tools=web_search_exa

# 启用多个工具
npx exa-mcp-server --tools=web_search_exa,company_research

# 列出所有可用工具
npx exa-mcp-server --list-tools

🔧 故障排除

常见问题

  1. 未找到服务器
    • 验证 npm 链接是否正确设置。
    • 检查 Claude 桌面端配置语法(JSON 文件)。
  2. API 密钥问题
    • 确认你的 EXA_API_KEY 有效。
    • 检查 EXA_API_KEY 是否在 Claude 桌面端配置中正确设置。
    • 验证 API 密钥周围没有空格或引号。
  3. 连接问题
    • 完全重启 Claude 桌面端。
    • 检查 Claude 桌面端日志。

🚀 部署到 Heroku

你可以使用 Heroku 按钮一键将此 MCP 服务器部署到 Heroku: Deploy to Heroku

手动 Heroku 部署

如果你更喜欢手动部署,请按以下步骤操作:

  1. 克隆此仓库:
git clone https://github.com/dsouza-anush/exa-mcp-server-heroku.git
cd exa-mcp-server-heroku
  1. 创建一个新的 Heroku 应用:
heroku create
  1. 将你的 Exa API 密钥设置为配置变量:
heroku config:set EXA_API_KEY=your-api-key-here
  1. 可选:指定要启用的工具:
heroku config:set ENABLED_TOOLS=web_search_exa,company_research_exa,crawling_exa
  1. 部署到 Heroku:
git push heroku main

🤖 与 Heroku Inference 和 Agents 一起使用

此 MCP 服务器与 Heroku Managed Inference 和 Agents 完全兼容。要使用它,请按以下步骤操作:

  1. 使用上述步骤将 MCP 服务器部署到 Heroku。
  2. 将 MCP 服务器附加到 Heroku Managed Inference 和 Agents 聊天模型:
# 将 APP_NAME 替换为你的 Heroku 应用名称
# 将 MODEL_NAME 替换为你想要的模型名称
heroku ai:models:create MODEL_NAME -a APP_NAME --as INFERENCE
  1. 你的 MCP 服务器将自动在 Heroku Inference 中注册,其工具将通过 /v1/agents/heroku 端点可用。

MCP 服务器配置

此服务器在 Heroku Inference 中使用以下 Procfile 配置:

web: npm run serve
mcp-search-exa: node ./stdio-server.js

mcp-search-exa 进程已在 Heroku Inference 中注册,遵循 Heroku 要求的命名约定(进程名称必须以 "mcp" 开头)。直接执行 Node.js 可确保为 MCP 协议正确处理标准输入输出。

app.json 中,webmcp-search-exa dynos 默认配置为扩展到 0,遵循 Heroku 对 MCP 服务器的建议。当你将此应用附加到 Heroku Inference 模型时,Heroku 将根据工具执行的需要自动扩展 MCP 进程。

与 Claude 桌面端一起使用

要将你在 Heroku 上部署的 MCP 服务器与 Claude 桌面端一起使用,请在你的 Claude 桌面端配置文件中添加以下内容:

{
"mcpServers": {
"exa_heroku": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://your-app-name.herokuapp.com/mcp"
],
"env": {
"EXA_API_KEY": "your-api-key-here"
}
}
}
}

请将 your-app-name 替换为你的 Heroku 应用名称,将 your-api-key-here 替换为你的 Exa API 密钥。

与 Claude 代码 CLI 一起使用

claude mcp add exa_heroku -e EXA_API_KEY=YOUR_API_KEY -- npx -y mcp-remote https://your-app-name.herokuapp.com/mcp

请将 your-app-name 替换为你的 Heroku 应用名称,将 YOUR_API_KEY 替换为你的 Exa API 密钥。

🔄 与上游保持同步

此仓库每天会自动从原始的 exa-mcp-server 仓库更新,同时保留所有特定于 Heroku 的自定义设置。更新通过 GitHub Actions 处理。

自动更新

GitHub Actions 工作流每天运行一次,执行以下操作:

  • 从原始的 exa-mcp-server 仓库获取最新更改。
  • 保留所有特定于 Heroku 的自定义设置(如 app.jsonProcfile 等)。
  • 提交并推送更新后的代码。

你也可以手动触发更新,方法如下:

  1. 转到 GitHub 仓库的“Actions”选项卡。
  2. 选择“Auto Update from Upstream”工作流。
  3. 点击“Run workflow”。

手动更新

如果你更喜欢手动更新,可以使用包含的更新脚本:

  1. 克隆你的分叉仓库:
git clone https://github.com/your-username/exa-mcp-server-heroku.git
cd exa-mcp-server-heroku
  1. 运行更新脚本:
./update-from-upstream.sh
  1. 审查更改,然后提交并推送到你的仓库:
git commit -am "Updated from upstream with Heroku customizations"
git push origin main
  1. 如果你已经部署到 Heroku,请更新你的 Heroku 应用:
git push heroku main

更新过程将保留所有特定于 Heroku 的自定义设置,包括:

  • Heroku 按钮配置(app.json
  • 进程定义(Procfile
  • 环境变量处理
  • 特定于 Heroku 的脚本
  • 部署说明

由 Exa 团队用心打造 ❤️

  • 0 关注
  • 0 收藏,8 浏览
  • system 提出于 2025-09-23 13:36

相似服务问题