OptimAI Search MCP
OfficialEnables GitHub Copilot to perform web3-focused web searches via the OptimAI External Search API, providing tools to start, retrieve, list, and cancel searches.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OptimAI Search MCP search for latest DeFi trends on Ethereum"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@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 |
| Start a search and return the search ID immediately. Searches commonly take 60-90 seconds; call |
| Convenience search that waits briefly for results. If still running, returns the search ID for |
| Fetch current status/result of a past search by ID |
| List recent searches (filterable by status, date) |
| Cancel a running or pending search |
Related MCP server: mcp-web-search-server
Setup
Environment variables
Variable | Required | Description |
| ✅ | Your OptimAI External 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-mcpThen 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-mcpTests
npm testnpm 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:liveArchitecture 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.
Available Tools
5 toolsoptimai_cancel_searchA
Cancel a running or pending search by its ID. Completed, failed, or already-cancelled searches cannot be cancelled.
Inputs: id (required).
optimai_get_searchA
Retrieve the current status and result of a previously created search by its ID. Useful for checking on a search that was started earlier or is still in progress.
Inputs: id (required).
optimai_list_searchesA
List recent searches made with this API key. Supports filtering by status, date range, and pagination.
Inputs: limit, offset, status, created_after, +1 more.
optimai_searchA
Run a Web3-focused AI search on the OptimAI decentralised network. Waits briefly for results and returns a structured answer with citations when ready. If the search is still running, it returns the search ID so optimai_get_search can fetch it later. Use this when the user wants up-to-date information about crypto, DeFi, NFTs, blockchain projects, or any on-chain topic.
Inputs: query (required), timeout_seconds, poll_interval_ms.
optimai_start_searchA
Start a Web3-focused AI search on the OptimAI decentralised network and return immediately with a search ID. Use this because searches commonly take 60-90 seconds or the MCP host has short tool-call timeouts. Call optimai_get_search with the returned ID to check progress and fetch the final answer.
Inputs: query (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 5 tools
The tools optimai_search and optimai_start_search are nearly identical in purpose: both initiate a search and return a search ID if the search is not complete. The only difference is that optimai_search waits briefly for results, but in typical long-running searches, they behave the same. This overlap creates significant ambiguity for an agent deciding which tool to use.
The naming pattern is mostly consistent with the optimai_ prefix and verb_noun structure: get_search, list_searches, cancel_search, start_search. However, optimai_search is a bare verb and does not follow the verb_noun pattern, standing out as a deviation. This is a minor inconsistency but does not severely hinder readability.
Five tools is well-scoped for a search API, covering initiation, retrieval, listing, and cancellation without unnecessary bloat. Each tool serves a distinct lifecycle function, and the count feels appropriate for the domain.
The tool set provides complete lifecycle coverage for asynchronous searches: start a search (start_search, or the combined optimai_search), check status/results (get_search), list past searches (list_searches), and cancel in-progress ones (cancel_search). No important operations are missing, and the composite optimai_search covers the synchronous wait case.
Maintenance
Related MCP Connectors
Web search API and MCP server for developers building AI agents.
Scrape, crawl and search the web for AI agents via MCP.
Provides AI assistants with access to Seltz's powerful Web Search capabilities.
Free web search for AI agents. No API key required. Hosted MCP in active development.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to perform web searches with full content retrieval and multi-engine provenance, including trust scoring and local corpus persistence, via MCP integration.2 npm4Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables MCP clients to perform web searches and fetch web pages over HTTP, using Exa and Parallel AI as search providers without requiring API keys.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to perform web search, extraction, and research across multiple provider backends with persistent multi-key rotation and auditable routing. Supports MCP, CLI, and Agent Skill entry points.MIT
- AlicenseCqualityBmaintenanceEnables MCP clients to run web searches and optionally fetch webpages through Moonshot's open platform API, using a configured API key.281 npmMIT