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

serpstat-url-analysis

v0.1.0

Published

A comprehensive Model Context Protocol server for Serpstat URL Analysis API

Downloads

8

Readme

Serpstat URL Analysis MCP Server

A comprehensive Model Context Protocol (MCP) server for interacting with the Serpstat URL Analysis API. This server provides 4 powerful tools for analyzing URL performance, competitors, keywords, and identifying SEO opportunities.

Features

🔍 URL Traffic Analysis

  • getSummaryTraffic: Get traffic and keyword statistics for website pages matching specific URL patterns
  • Analyze specific sections of websites (e.g., mobile pages, product categories)
  • Understand traffic distribution and keyword coverage

🥊 URL Competitor Analysis

  • getUrlCompetitors: Identify competing URLs for any target URL
  • Discover who you're competing against in search results
  • Analyze competitor strategies and performance

📈 URL Keyword Rankings

  • getUrlKeywords: Get comprehensive keyword data for specific URLs
  • Access ranking positions, search volume, CPC, and difficulty metrics
  • Understand keyword intent and search performance

🔎 Missing Keyword Analysis

  • getUrlMissingKeywords: Identify keywords competitors rank for but your URL doesn't
  • Essential for SEO gap analysis and content strategy optimization
  • Discover new content opportunities

Installation

Prerequisites

  • Node.js 18 or higher
  • Valid Serpstat API key
  • Model Context Protocol compatible client

Setup

# Navigate to the project directory
cd serpstat-url-analysis

# Install dependencies
npm install

# Build the project
npm run build

# Set your API key
export SERPSTAT_API_KEY="your-serpstat-api-key"

Usage

MCP Configuration

Add the server to your MCP settings:

{
  "mcpServers": {
    "serpstat-url-analysis": {
      "command": "node",
      "args": ["/path/to/serpstat-url-analysis/build/index.js"],
      "env": {
        "SERPSTAT_API_KEY": "your-serpstat-api-key"
      }
    }
  }
}

Available Tools

1. getSummaryTraffic

Get traffic and keyword statistics for URL patterns.

Parameters:

  • se (required): Search engine code (e.g., "g_us")
  • domain (required): Domain to analyze
  • urlContains (required): URL pattern to match
  • output_data (optional): "traffic" or "keywords" (default: both)

Example:

const result = await getSummaryTraffic({
  se: "g_us",
  domain: "example.com",
  urlContains: "/blog/",
  output_data: "traffic"
});

2. getUrlCompetitors

Get URL competitors for analysis.

Parameters:

  • se (required): Search engine code
  • url (required): Target URL to analyze
  • sort (optional): Sort results by field
  • page (optional): Page number (default: 1)
  • size (optional): Results per page (default: 100, max: 1000)

Example:

const result = await getUrlCompetitors({
  se: "g_us",
  url: "https://example.com/product-page",
  sort: { cnt: "desc" },
  size: 50
});

3. getUrlKeywords

Get keywords that specific URLs rank for.

Parameters:

  • se (required): Search engine code
  • url (required): URL to analyze
  • withIntents (optional): Include keyword intent data
  • filters (optional): Advanced filtering options
  • sort (optional): Sort results
  • page (optional): Page number
  • size (optional): Results per page

Example:

const result = await getUrlKeywords({
  se: "g_us",
  url: "https://example.com/blog/post",
  withIntents: true,
  filters: {
    cost_from: 1,
    cost_to: 1000
  },
  sort: { position: "asc" }
});

4. getUrlMissingKeywords

Identify keyword gaps between you and competitors.

Parameters:

  • se (required): Search engine code
  • url (required): URL to analyze
  • filters (optional): Filter by cost, difficulty, etc.
  • sort (optional): Sort results
  • page (optional): Page number
  • size (optional): Results per page

Example:

const result = await getUrlMissingKeywords({
  se: "g_us",
  url: "https://example.com",
  filters: {
    cost_from: 0.5,
    concurrency_from: 50
  },
  sort: { weight: "desc" }
});

API Credits & Limits

Credit Costs

  • getSummaryTraffic: 1000 credits per parameter (traffic, keywords, or both)
  • getUrlCompetitors: 1 credit per result returned
  • getUrlKeywords: 1 credit per result returned
  • getUrlMissingKeywords: 1 credit per result returned

Limits

  • Maximum 60,000 results per query for competitor and keyword tools
  • Maximum 1,000 results per page
  • Pagination support for large datasets

Search Engines

Supported search engines include:

  • Google: g_us (United States), g_uk (United Kingdom), g_de (Germany), and 200+ other Google variants
  • Bing: bing_us (United States)

Development

Build Commands

# Build with TypeScript (includes type checking)
npm run build:ts

# Build with esbuild (faster, for development)
npm run build

# Watch for changes
npm run dev

# Type checking only
npm run watch

Project Structure

src/
├── index.ts              # Entry point
├── server.ts             # Main MCP server implementation
├── utils/
│   └── validation.ts     # Zod validation schemas
└── constants.ts          # API methods and constants

Testing

# Run the inspector tool for testing
npm run inspector

# Test server startup
node build/index.js

Response Format

All tools return structured JSON data following this pattern:

{
  "id": "request-id",
  "result": {
    "data": [
      {
        // Tool-specific data fields
      }
    ],
    "summary_info": {
      "page": 1,
      "total": 100,
      "left_lines": 999999
    }
  }
}

Error Handling

The server provides comprehensive error handling:

  • Input validation with detailed error messages
  • API error responses with status codes
  • Network timeout and retry logic
  • Credit limit warnings

Examples

Analyze Blog Section Traffic

// Get traffic statistics for all blog pages
const blogStats = await getSummaryTraffic({
  se: "g_us",
  domain: "techblog.com",
  urlContains: "/blog/"
});

Find Product Page Competitors

// Identify competitors for a specific product page
const competitors = await getUrlCompetitors({
  se: "g_us", 
  url: "https://ecommerce.com/product/awesome-widget",
  size: 20
});

Discover Content Gaps

// Find keywords competitors rank for but you don't
const missingKeywords = await getUrlMissingKeywords({
  se: "g_us",
  url: "https://yoursite.com",
  filters: {
    cost_from: 1.0,
    concurrency_from: 75
  }
});

Requirements

  • Node.js 18+
  • Valid Serpstat API key
  • MCP-compatible client (Claude, etc.)

Support

For API documentation, visit the Serpstat API Documentation.

For issues related to this MCP server, please check the project repository.


Author: Benjamin Oldenburg
Date: 2025-09-03
Version: 0.1.0