npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bfcmath/mcp-search

v0.1.0

Published

Temporary test publish of OptimAI MCP Search server

Readme

@optimai/mcp-search

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

1. Install dependencies & build

cd /home/bfc/optimai/optimai-search-mcp
npm install
npm run build

2. Environment variables

| Variable | Required | Description | |---|---|---| | OPTIMAI_API_KEY | ✅ | Your OptimAI External API key (X-API-Key) |

The API base URL is hardcoded to https://api-onchain.optimai.network.


Custom Host Config (Stdio)

Add to your MCP host configuration:

{
  "mcpServers": {
    "optimai-search": {
      "command": "node",
      "args": ["/home/bfc/optimai/optimai-search-mcp/dist/index.js"],
      "env": {
        "OPTIMAI_API_KEY": "sk-your-key-here"
      }
    }
  }
}

Claude Desktop

Same format — add the block above to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).

Cursor

Add to .cursor/mcp.json in your project or the global Cursor MCP config.


Smoke Test (MCP Inspector)

OPTIMAI_API_KEY=sk-... npx @modelcontextprotocol/inspector node dist/index.js

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.