Skip to main content
Glama
OptimaiNetwork

OptimAI Search MCP

Official

@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


Related MCP server: qsearch

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_search creates a search and returns immediately with an ID. Use optimai_get_search to check progress and retrieve the completed answer.

  • Blocking convenience flow: optimai_search creates a search then polls GET /:id every 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.ts has a TODO: streamSearch() stub. Upgrading to SSE only requires implementing that method and adding a new optimai_search_stream tool — the blocking tool is unaffected.

  • Auth: API key is read from env at startup. Never logged or exposed in tool responses.

Available Tools

5 tools
optimai_list_searchesA

List recent searches made with this API key. Supports filtering by status, date range, and pagination.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNoNumber of results to return (1–100, default 10)
offsetNoPagination offset (default 0)
statusNoFilter by search status
created_afterNoISO 8601 datetime — only return searches created after this
created_beforeNoISO 8601 datetime — only return searches created before this

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full transparency burden. It clearly indicates a read-only listing operation ('List recent searches made with this API key') but does not disclose additional behavioral details such as ordering of results, whether full search objects or summaries are returned, or any API-specific constraints beyond the API key scoping.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is exactly two sentences, front-loads the core action ('List recent searches'), and uses no unnecessary words. It efficiently conveys the essential operation and the key supported filtering options.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description covers the core purpose, resource scope, and filtering/pagination capabilities. However, without an output schema, it does not specify the return format or ordering, and it does not explicitly distinguish itself from optimai_get_search beyond the plural vs. singular contrast. Still, for a straightforward list endpoint, the information is sufficient for selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All five parameters are documented with descriptions in the input schema, achieving 100% coverage, so the baseline is 3. The description's summary of 'filtering by status, date range, and pagination' adds no new semantic detail beyond what the schema already provides for each parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'List' with the resource 'recent searches' and scopes it to 'this API key', making the operation unambiguous. It also mentions filtering by status, date range, and pagination, which clearly distinguishes this from sibling tools like optimai_search, optimai_get_search, optimai_cancel_search, and optimai_start_search.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description establishes a clear context for use: listing recent searches for the current API key. While it does not explicitly name alternatives (e.g., 'use optimai_get_search for a single search'), the plural 'searches' and the mention of pagination and filtering implicitly differentiate it from the single-search retrieval tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.1
    • First observedoptimai_cancel_search
    • First observedoptimai_get_search
    • First observedoptimai_list_searches
    • First observedoptimai_search
    • First observedoptimai_start_search

TDQS

A4.1/5.0
Disambiguation2/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivityInactive
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/OptimaiNetwork/optimai-search-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server