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

mcp-websearch-server

v1.3.1

Published

MCP Server for web search (SearchAPI.io) and advanced web scraping

Readme

MCP WebSearch Server

MCP Server for web search and advanced web scraping. Uses SearchAPI.io for Google Search and AI Mode.

Quick Start

Option 1: Stdio (npx)

{
  "mcpServers": {
    "websearch": {
      "command": "npx",
      "args": ["-y", "mcp-websearch-server"],
      "env": {
        "SEARCHAPI_KEY": "your-api-key-here"
      }
    }
  }
}

Option 2: HTTP Server (Streamable HTTP)

Run as HTTP server:

MCP_TRANSPORT=http PORT=3000 npx mcp-websearch-server

Then configure MCP client with API key in URL or header:

Option A: API key in URL query parameter

{
  "mcpServers": {
    "websearch": {
      "url": "http://localhost:3000/mcp?apikey=YOUR_KEY",
      "transport": "streamable-http"
    }
  }
}

Option B: API key in header

{
  "mcpServers": {
    "websearch": {
      "url": "http://localhost:3000/mcp",
      "transport": "streamable-http",
      "headers": {
        "X-API-Key": "YOUR_KEY"
      }
    }
  }
}

Option C: Server-side default key

MCP_TRANSPORT=http SEARCHAPI_KEY=default-key PORT=3000 npx mcp-websearch-server

The server implements MCP Streamable HTTP transport (spec 2025-03-26) with:

  • Session management with Mcp-Session-Id headers
  • SSE streaming for server-initiated messages
  • Resumability support with Last-Event-ID
  • Per-user API key support via query param or header

Get your API key at searchapi.io

Tools

| Tool | Description | |------|-------------| | web_search | Google Search with pagination, time filter, site filter | | ai_search | Google AI Mode - get AI-generated answers with sources | | web_scrape | Advanced scraper with multiple extract modes (text/markdown/structured) | | get_links | Extract links from a webpage with optional filter | | scrape_multiple | Scrape up to 5 URLs at once |

Parameters

web_search

  • query - Search query
  • num_results - Number of results (1-20, default 10)
  • page - Page number for pagination (1-10)
  • time_period - Filter: last_hour, last_day, last_week, last_month, last_year
  • site - Limit to specific site (e.g., "github.com")

ai_search

  • query - Question or topic
  • image_url - Optional image URL for visual questions
  • location - Location for local queries

web_scrape

  • url - URL to scrape
  • selector - CSS selector (optional)
  • extract_mode - text, markdown, or structured
  • include_links - Include links in output
  • max_length - Max content length (1000-50000)

get_links

  • url - URL to extract links from
  • filter - Text filter for URLs/anchors

scrape_multiple

  • urls - Array of URLs (max 5)
  • max_per_page - Max content per page (500-5000)

Deployment

PM2 (Production)

  1. Edit ecosystem.config.js and set your SEARCHAPI_KEY
  2. Run: npm run pm2:start
  3. Check logs: npm run pm2:logs

Or manually:

MCP_TRANSPORT=http PORT=3000 SEARCHAPI_KEY=your-key pm2 start index.js --name mcp-websearch

Docker

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm ci --production
COPY . .
ENV MCP_TRANSPORT=http PORT=3000
EXPOSE 3000
CMD ["node", "index.js"]

Roadmap

  • [ ] Add Serper.dev provider support
  • [ ] Add SerpAPI provider support
  • [ ] Provider auto-fallback

License

MIT