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

@playscope/mcp

v0.2.9

Published

Read-only MCP server exposing PlayScope session data to AI agents (Claude, GPT, etc.).

Readme

@playscope/mcp

Read-only MCP server that exposes PlayScope session data to AI agents. The server itself is provider-agnostic — it stores no AI API keys and does no LLM calls. Spec: MCP Server Specification.

Status — 0.2.0. Foundation, ten read-only tools (PSDK-35/52/36), and RFC 8628 Device Authorization Grant + persistent credentials so a developer can playscope-mcp login once and never paste a token by hand again.

Transports

| Mode | Use | Auth | | --- | --- | --- | | stdio | Claude Code, Claude Desktop, any local MCP client | PLAYSCOPE_MCP_TOKEN env var | | sse | Cloud SaaS — mcp.playscope.dev behind nginx + TLS | Authorization: Bearer <ps_mcp_…> header on the inbound MCP connection |

Run locally — stdio

nvm use                # node 22
npx -y @playscope/mcp login            # opens the dashboard, RFC 8628 device flow

Then ~/.claude/mcp.json (no secrets in this file — the CLI keeps tokens at ~/.config/playscope/credentials.json, file mode 0600):

{
  "mcpServers": {
    "playscope": {
      "command": "npx",
      "args": ["-y", "@playscope/mcp"]
    }
  }
}

When the access token expires (24h) the server refreshes it silently with the 30-day refresh token. Revoke from Settings → MCP tokens or with playscope-mcp logout.

Other commands:

playscope-mcp whoami        # show stored-credentials state
playscope-mcp logout        # remove credentials
playscope-mcp login --force # re-authenticate (overwrites)

Run in Docker — SSE

docker run --rm -p 3100:3100 \
  -e PLAYSCOPE_API_BASE_URL=https://api.playscope.dev \
  -e MCP_TRANSPORT=sse \
  ghcr.io/flamehand/playscope-mcp:latest

Behind nginx, terminate TLS on mcp.playscope.dev and proxy /sse and /messages to 127.0.0.1:3100. Health probes: GET /health/live, GET /health/ready.

Layout

src/
  index.ts          entrypoint — picks transport, wires logging
  config.ts         env parsing
  logging.ts        JSON-to-stdout/stderr structured logger
  limits.ts         per-tool query caps (Spec §4)
  conventions.ts    response-shape conventions + error mapping (Spec §10)
  server.ts         McpServer factory + ToolContext type
  transports/
    stdio.ts        StdioServerTransport
    sse.ts          Express + SSEServerTransport
  backend/
    client.ts       fetch wrapper for the PlayScope backend
    auth.ts         StaticAuth (stdio) / SlotAuth (SSE)

Phase 8c — adding a tool

Each tool is a thin file under src/tools/<tool>.ts. The skeleton:

import { z } from "zod";
import { wrapTool } from "../conventions.js";
import type { ToolContext } from "../server.js";

export const inputSchema = z.object({ project_id: z.string().uuid(), /* ... */ });

export function register(server: McpServer, ctx: ToolContext): void {
  server.registerTool(
    "get_session",
    { description: "Get full metadata for a session.", inputSchema },
    async (rawInput) => {
      const input = inputSchema.parse(rawInput);
      return toMcpContent(
        await wrapTool("get_session", input, ctx.logger, async (i) => {
          const auth = ctx.auth.resolveAuth();
          return ctx.backend.get(`/v1/projects/${i.project_id}/sessions/${i.session_id}`, auth);
        }),
      );
    },
  );
}

registerTools(server, ctx) is called from createServer once the ten tools exist.

Tests

npm test

Vitest unit tests cover the convention/limit helpers and the backend client's error mapping. Integration tests against a real backend live under test/integration/ and require PLAYSCOPE_TEST_* env vars.