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

@se-studio/site-mcp

v0.3.67

Published

Public, read-only, stateless MCP for SE Studio marketing sites (search, markdown, site-info)

Readme

@se-studio/site-mcp

Public, read-only, stateless MCP for SE Studio marketing sites.

Agents use tools instead of scraping HTML:

| Tool | Purpose | |------|---------| | search_site | Hybrid search (injected; typically @se-studio/search) | | get_markdown | Fetch /{path}.md export | | get_site_info | Fetch /site-info.md |

This is not cms-edit. No OAuth, no draft writes. Runs on the marketing origin.

Install

pnpm add @se-studio/site-mcp

Endpoint path

The Next.js route file path is the mount point (e.g. app/api/mcp/route.ts → /api/mcp).
createSiteMcpHandler does not take a path — routing is owned by App Router.

Trailing slash: SE Studio sites use trailingSlash: true. Advertise /api/mcp without a trailing slash (server card, catalog, agent card). Also set skipTrailingSlashRedirect: true — Next’s built-in slash 308 runs before middleware and ignores rewrites. Then in middleware call apiPathNeedingTrailingSlash + NextResponse.rewrite for bare /api/*, and 308 HTML paths to the slashed form yourself if you still want page trailing slashes.

Use endpointPath only on buildMcpServerCard so the well-known card advertises the same URL agents should call:

| Site shape | Example endpointPath (server card) | |------------|--------------------------------------| | Standard SE Studio | /api/mcp | | Top-level | /mcp | | Point.me-style API prefix | /marketing-api/mcp |

When under /api/, update robots with allowExtra from @se-studio/core-ui:

createRobotsTxtResponse({
  isProduction,
  baseUrl,
  allowExtra: ['/api/mcp', '/api/search'],
});

Some crawlers treat Allow loosely; discovery is primarily via Link: rel="mcp-server-card" and the well-known card.

Usage

// app/api/mcp/route.ts
import { createSiteMcpHandler } from '@se-studio/site-mcp';
import { baseUrl } from '@/lib/server-config';

const handler = createSiteMcpHandler({
  identity: {
    name: 'se-studio',
    title: 'Something Else',
    websiteUrl: baseUrl,
  },
  tools: {
    getMarkdown: {},
    getSiteInfo: {},
    // search: { search: async ({ query, limit, type }) => { … } },
  },
});

export const GET = handler;
export const POST = handler;
export const DELETE = handler;

Server card

// app/.well-known/mcp/server-card.json/route.ts
import { buildMcpServerCard } from '@se-studio/site-mcp';
import { baseUrl } from '@/lib/server-config';

export function GET() {
  const card = buildMcpServerCard({
    identity: {
      name: 'se-studio',
      title: 'Something Else',
      websiteUrl: baseUrl,
    },
    endpointPath: '/api/mcp', // must match the App Router mount
    tools: { getMarkdown: {}, getSiteInfo: {} },
  });
  return Response.json(card, {
    headers: {
      'Cache-Control': 'public, s-maxage=3600, stale-while-revalidate',
    },
  });
}

Discovery Link header

appendAgentDiscoveryLinkHeaders(response.headers, pathname, { mcpServerCard: true });

Path mapping

Markdown paths use @se-studio/core-ui/agent-ready (htmlPathToMarkdownPath) — the same Band A helper as middleware content negotiation — so rules do not drift.

Safety defaults

  • Fetch timeout: 10s (override fetchTimeoutMs)
  • Max body: 512 KiB (override maxBodyBytes)
  • Encoded path traversal rejected
  • Tool failures set MCP isError: true

LLM reference

See docs/llms.md.