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 🙏

© 2025 – Pkg Stats / Ryan Hefner

search-mcp

v0.1.0

Published

Universal MCP server providing Brave Search tools (web, local, rich)

Downloads

14

Readme

Search MCP

The Universal MCP Server exposes tools for your workflows and is designed for prompt-first usage in MCP-compatible clients.

Installation

Prerequisites

  • Node.js 18+
  • Set SEARCH_MCP_... in your environment

Get an API key

  • If your tools require an external API, obtain a key from the provider’s docs/console.
  • Otherwise, you can skip this step.

Build locally

cd /path/to/search-mcp
npm i
npm run build

Setup: Claude Code (CLI)

Use this one-liner (replace with your real values):

claude mcp add Search MCP -s user -e SEARCH_MCP_API_KEY="sk-your-real-key" -- npx search-mcp

To remove:

claude mcp remove Search MCP

Setup: Cursor

Create .cursor/mcp.json in your client (do not commit it here):

{
  "mcpServers": {
    "search-mcp": {
      "command": "npx",
      "args": ["search-mcp"],
      "env": { "SEARCH_MCP_API_KEY": "sk-your-real-key" },
      "autoStart": true
    }
  }
}

Other Clients and Agents

Install via URI or CLI:

code --add-mcp '{"name":"search-mcp","command":"npx","args":["search-mcp"],"env":{"SEARCH_MCP_API_KEY":"sk-your-real-key"}}'

Follow the MCP install guide and reuse the standard config above.

  • Command: npx
  • Args: ["search-mcp"]
  • Env: SEARCH_MCP_API_KEY=sk-your-real-key
  • Type: STDIO
  • Command: npx
  • Args: search-mcp
  • Enabled: true

Example ~/.config/opencode/opencode.json:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "search-mcp": {
      "type": "local",
      "command": ["npx", "search-mcp"],
      "enabled": true
    }
  }
}

Add a new MCP and paste the standard JSON config.

See docs and reuse the standard config above.

Setup: Codex (TOML)

Example (Serena):

[mcp_servers.serena]
command = "uvx"
args = ["--from", "git+https://github.com/oraios/serena", "serena", "start-mcp-server", "--context", "codex"]

This server (minimal):

[mcp_servers.search-mcp]
command = "npx"
args = ["search-mcp"]
# Optional:
# SEARCH_MCP_API_KEY = "sk-your-real-key"
# MCP_NAME = "search-mcp"

Configuration (Env)

  • SEARCH_MCP_API_KEY: Your API key (if applicable)
  • MCP_NAME: Server name override (default: search-mcp)

Available Tools

  • web_search
    • inputs: object { query: string (required), count?: number, offset?: number, safeSearch?: 'off'|'moderate'|'strict', country?: string, freshness?: 'pd'|'pw'|'pm'|'py', enableRichCallback?: boolean }
    • outputs: object (Brave Web Search API JSON)
  • local_pois
    • inputs: object { ids: string[] (1-20) }
    • outputs: object (Local POI API JSON)
  • local_descriptions
    • inputs: object { ids: string[] (1-20) }
    • outputs: object (Local descriptions API JSON)
  • rich_fetch
    • inputs: object { callback_key: string }
    • outputs: object (Rich results JSON)

Example invocation (MCP tool call)

{
  "tool": "web_search",
  "inputs": {
    "query": "weather in munich",
    "enableRichCallback": true
  }
}

Troubleshooting

  • 401 auth errors: check SEARCH_MCP_API_KEY
  • Ensure Node 18+
  • Local runs: npx search-mcp after npm run build
  • Inspect publish artifacts: npm pack --dry-run

References

  • MCP SDK: https://modelcontextprotocol.io/docs/sdks
  • Architecture: https://modelcontextprotocol.io/docs/learn/architecture
  • Server Concepts: https://modelcontextprotocol.io/docs/learn/server-concepts
  • Specification: https://modelcontextprotocol.io/specification/2025-06-18/server/index
  • Brave Search API: https://api.search.brave.com/app/documentation

Name Consistency & Troubleshooting

  • Always use CANONICAL_ID (search-mcp) for identifiers and keys.
  • Use CANONICAL_DISPLAY (Search MCP) only for UI labels.
  • Do not mix legacy keys after registration.

Consistency Matrix:

  • npm package name → search-mcp
  • Binary name → search-mcp
  • MCP server name (SDK metadata) → search-mcp
  • Env default MCP_NAME → search-mcp
  • Client registry key → search-mcp
  • UI label → Search MCP

Conflict Cleanup:

  • Remove any stale keys (e.g., old display names) and re-add with search-mcp only.
  • Cursor: configure in the UI; this project intentionally omits .cursor/mcp.json.