OptimAI Search MCP
Enables Web3-focused web searches via the OptimAI External Search API, providing tools to start, retrieve, list, and cancel searches from any MCP-compatible AI host.
README
@optimai-network/search-mcp
MCP (Model Context Protocol) server that wraps the OptimAI External Search API, enabling any MCP-compatible AI host to run Web3-focused web searches.
Tools
| Tool | Description |
|---|---|
optimai_start_search |
Start a search and return the search ID immediately. Searches commonly take 60-90 seconds; call optimai_get_search with the ID to fetch progress/results. |
optimai_search |
Convenience search that waits briefly for results. If still running, returns the search ID for optimai_get_search. |
optimai_get_search |
Fetch current status/result of a past search by ID |
optimai_list_searches |
List recent searches (filterable by status, date) |
optimai_cancel_search |
Cancel a running or pending search |
Setup
Environment variables
| Variable | Required | Description |
|---|---|---|
OPTIMAI_API_KEY |
✅ | Your OptimAI External API key (X-API-Key) |
Create or manage API keys at https://search.optimai.network/api-keys.
The API base URL is hardcoded to https://api-onchain.optimai.network.
MCP Integrations
Codex CLI
export OPTIMAI_API_KEY="sk-..."
codex mcp add optimai-search \
--env OPTIMAI_API_KEY="$OPTIMAI_API_KEY" \
-- npx -y @optimai-network/search-mcp
Then restart Codex and run /mcp to confirm optimai-search is enabled.
Claude Desktop, Cursor, and other stdio hosts
For a published npm install, add this to your MCP host configuration:
{
"mcpServers": {
"optimai-search": {
"command": "npx",
"args": ["-y", "@optimai-network/search-mcp"],
"env": {
"OPTIMAI_API_KEY": "sk-your-key-here"
}
}
}
}
Claude Desktop uses the same format in ~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows.
Cursor can use the same format in .cursor/mcp.json in your project or in the global Cursor MCP config.
GitHub Copilot CLI
You can add the server interactively with /mcp add, or edit ~/.copilot/mcp-config.json:
{
"mcpServers": {
"optimai-search": {
"type": "local",
"command": "npx",
"args": ["-y", "@optimai-network/search-mcp"],
"env": {
"OPTIMAI_API_KEY": "sk-your-key-here"
},
"tools": ["*"]
}
}
}
GitHub Copilot cloud agent
Add an environment secret or variable named COPILOT_MCP_OPTIMAI_API_KEY, then add this MCP configuration in the repository's Copilot cloud agent settings:
{
"mcpServers": {
"optimai-search": {
"type": "local",
"command": "npx",
"args": ["-y", "@optimai-network/search-mcp"],
"env": {
"OPTIMAI_API_KEY": "$COPILOT_MCP_OPTIMAI_API_KEY"
},
"tools": [
"optimai_start_search",
"optimai_get_search",
"optimai_list_searches"
]
}
}
}
Use tools: ["*"] if you want to expose every tool, including optimai_search and optimai_cancel_search.
Smoke Test (MCP Inspector)
OPTIMAI_API_KEY=sk-... npx @modelcontextprotocol/inspector npx -y @optimai-network/search-mcp
Tests
npm test
npm test only starts the MCP server and validates the tool schema. It does not call live OptimAI API tools.
To intentionally run a live backend smoke test:
OPTIMAI_API_KEY=sk-... npm run test:live
Architecture Notes
- Recommended reliable flow:
optimai_start_searchcreates a search and returns immediately with an ID. Useoptimai_get_searchto check progress and retrieve the completed answer. - Blocking convenience flow:
optimai_searchcreates a search then pollsGET /:idevery 2s until terminal status or local timeout. It defaults to 45s and is capped at 55s to stay below common MCP client request timeouts. - Future streaming:
src/client.tshas aTODO: streamSearch()stub. Upgrading to SSE only requires implementing that method and adding a newoptimai_search_streamtool — the blocking tool is unaffected. - Auth: API key is read from env at startup. Never logged or exposed in tool responses.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。