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

@benvargas/pi-exa-mcp

v1.1.0

Published

Exa MCP tools for pi - Web search and code context via Exa's Model Context Protocol

Readme

@benvargas/pi-exa-mcp

Exa MCP tools for pi, the AI coding agent.

Provides real-time web search and code/documentation search via Exa's Model Context Protocol (MCP) over HTTP.

Features

  • Web search (web_search_exa) — Real-time web search for up-to-date information
  • Code context (get_code_context_exa) — Search code and documentation for API usage and examples
  • Configurable limits — Client-side truncation with configurable max bytes/lines
  • Multiple config sources — JSON config, environment variables, or CLI flags
  • MCP protocol — Full JSON-RPC 2.0 and SSE support for streaming responses

Installation

pi install npm:@benvargas/pi-exa-mcp

Or try without installing:

pi -e npm:@benvargas/pi-exa-mcp

Setup

No API key is required for basic usage. For higher rate limits, configure your Exa API key using one of these methods:

Option 1: Environment Variable

export EXA_API_KEY="your_exa_api_key"
pi

Option 2: JSON Config

Create ~/.pi/agent/extensions/exa-mcp.json:

{
  "url": "https://mcp.exa.ai/mcp",
  "apiKey": "your_exa_api_key",
  "tools": ["web_search_exa", "get_code_context_exa"],
  "timeoutMs": 30000,
  "maxBytes": 51200,
  "maxLines": 2000
}

Option 3: CLI Flags

pi --exa-mcp-api-key=your_exa_api_key

Usage

Once installed, the AI will automatically use these tools when appropriate:

"Search the web for the latest React features"
"Find code examples for Rust error handling"
"Look up the TypeScript 5.0 release notes"

Tools

web_search_exa

Real-time web search for up-to-date information.

| Parameter | Description | Default | |-----------|-------------|---------| | query | Search query (required) | — | | numResults | Number of results to return | — | | type | Search mode: auto, fast, deep | — | | livecrawl | Live crawl behavior: fallback, preferred | — | | contextMaxCharacters | Max characters in extracted content | — | | piMaxBytes | Client-side max bytes override | — | | piMaxLines | Client-side max lines override | — |

get_code_context_exa

Search code and documentation for API usage and examples.

| Parameter | Description | Default | |-----------|-------------|---------| | query | Code search query (required) | — | | tokensNum | Token budget for retrieved context (1000-50000) | — | | piMaxBytes | Client-side max bytes override | — | | piMaxLines | Client-side max lines override | — |

Configuration

Config File Locations

Config files are loaded in order (first match wins):

  1. Path from --exa-mcp-config flag
  2. Path from EXA_MCP_CONFIG environment variable
  3. ./.pi/extensions/exa-mcp.json (project-level)
  4. ~/.pi/agent/extensions/exa-mcp.json (global)

If none exist, the extension writes a default config to the global path with apiKey set to null.

Config File Format

{
  "url": "https://mcp.exa.ai/mcp",
  "tools": ["web_search_exa", "get_code_context_exa"],
  "apiKey": null,
  "timeoutMs": 30000,
  "protocolVersion": "2025-06-18",
  "maxBytes": 51200,
  "maxLines": 2000
}

Environment Variables

| Variable | Description | Default | |----------|-------------|---------| | EXA_MCP_URL | MCP endpoint URL | https://mcp.exa.ai/mcp | | EXA_MCP_TOOLS | Comma-separated tool list | — | | EXA_API_KEY / EXA_MCP_API_KEY | Exa API key | — | | EXA_MCP_TIMEOUT_MS | Request timeout (ms) | 30000 | | EXA_MCP_PROTOCOL_VERSION | MCP protocol version | 2025-06-18 | | EXA_MCP_MAX_BYTES | Max bytes to keep from output | 51200 | | EXA_MCP_MAX_LINES | Max lines to keep from output | 2000 | | EXA_MCP_CONFIG | Path to JSON config file | — |

CLI Flags

| Flag | Description | |------|-------------| | --exa-mcp-url | Override the Exa MCP endpoint | | --exa-mcp-tools | Comma-separated MCP tool list | | --exa-mcp-api-key | Exa API key | | --exa-mcp-timeout-ms | HTTP timeout (milliseconds) | | --exa-mcp-protocol | MCP protocol version | | --exa-mcp-config | Path to JSON config file | | --exa-mcp-max-bytes | Max bytes to keep from output | | --exa-mcp-max-lines | Max lines to keep from output |

Output Truncation

Tool output is automatically truncated to prevent context window overflow:

  • Default limits: 51200 bytes and 2000 lines
  • Client overrides: Models can request higher limits via piMaxBytes/piMaxLines (clamped to configured max)
  • Temp files: When truncated, full output is saved to a temp file with the path included in the response

Requirements

  • pi v0.51.0 or later
  • Optional: Exa API key for higher rate limits

Uninstall

pi remove npm:@benvargas/pi-exa-mcp

License

MIT