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

@mantisai/mcp

v0.1.0

Published

MCP server and client for Mantis trace analysis platform

Readme

@mantisai/mcp

TypeScript SDK for the Mantis Insight trace analysis platform. Use it as a programmatic client in your code or as an MCP server for AI agents.

Installation

npm install @mantisai/mcp
# or
pnpm add @mantisai/mcp

Authentication

Two authentication modes are supported:

| Mode | Scope | Env Vars | |------|-------|----------| | Personal Access Token (PAT) | Multi-project | MANTIS_API_TOKEN | | API Key Pair (BasicAuth) | Single project | MANTIS_SECRET_KEY + MANTIS_PUBLIC_KEY |

Create a PAT in Account Settings → Access Tokens, or find project-scoped keys in Project Settings → API Keys.

Programmatic Client

import { MantisClient } from '@mantisai/mcp';

// PAT mode (multi-project)
const client = new MantisClient({
  url: 'https://your-instance.example.com',
  token: 'pat_a1b2c3d4...',
});

// Discover projects
const { projects } = await client.listProjects();

// Get context (schema, workflow, query reference)
const context = client.getContext();

// Explore a project
const stats = await client.describeProject({ projectId: 'proj-abc' });

// Fetch traces (with pagination)
const trace = await client.getTrace({
  projectId: 'proj-abc',
  traceIds: ['trace-1', 'trace-2'],
  observationOffset: 0,
  observationLimit: 50,
});

// Run a single SQL query
const result = await client.executeQuery({
  projectId: 'proj-abc',
  sql: 'SELECT name, COUNT(*) as cnt FROM traces GROUP BY name LIMIT 10',
});

// Run batch queries in parallel
const batch = await client.executeQuery({
  projectId: 'proj-abc',
  queries: [
    { id: 'costs', sql: 'SELECT trace_id, SUM(total_cost) as cost FROM observations GROUP BY trace_id ORDER BY cost DESC LIMIT 5' },
    { id: 'counts', sql: 'SELECT name, COUNT(*) as cnt FROM traces GROUP BY name LIMIT 10' },
  ],
});

// Semantic search
const insights = await client.searchInsights({
  projectId: 'proj-abc',
  query: 'error handling failures',
});

MCP Server (for AI Agents)

Run as a stdio MCP server. MANTIS_URL defaults to https://insight.withmetis.ai if not set.

# PAT mode (multi-project) — uses default URL
MANTIS_API_TOKEN=pat_... npx @mantisai/mcp serve

# BasicAuth mode (single project) — uses default URL
MANTIS_SECRET_KEY=sk-lf-... MANTIS_PUBLIC_KEY=pk-lf-... npx @mantisai/mcp serve

# Custom instance
MANTIS_URL=http://localhost:3000 MANTIS_API_TOKEN=pat_... npx @mantisai/mcp serve

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "mantis": {
      "command": "npx",
      "args": ["@mantisai/mcp", "serve"],
      "env": {
        "MANTIS_API_TOKEN": "pat_a1b2c3d4..."
      }
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "mantis": {
      "command": "npx",
      "args": ["@mantisai/mcp", "serve"],
      "env": {
        "MANTIS_API_TOKEN": "pat_a1b2c3d4..."
      }
    }
  }
}

Available Tools

Local (no network):

  • get_context — Database schema, available tools, query patterns, and recommended workflow
  • list_projects — All projects accessible to the authenticated user (PAT mode only)

Proxied (requires project_id in PAT mode):

  • describe_project — Row counts, score configs, score aggregates, observation types, session counts, tags, time range
  • get_trace — Fetch up to 10 traces with observations and scores (paginated)
  • get_session — Fetch up to 5 sessions with trace summaries (paginated)
  • get_observations — Fetch up to 20 observations by ID with full input/output content
  • diff_traces — Side-by-side comparison of two traces
  • trace_stats — Cost and latency rollup grouped by trace name with p50/p95 latency
  • execute_query — Read-only ClickHouse SQL; pass sql for single or queries array for up to 10 in parallel
  • search_insights — Semantic vector search over score reasoning and comments

Environment Variables

| Variable | Required | Description | |----------|----------|-------------| | MANTIS_URL | No | Mantis instance URL. Defaults to https://insight.withmetis.ai | | MANTIS_API_TOKEN | PAT mode | Personal access token (pat_xxx) | | MANTIS_SECRET_KEY | BasicAuth mode | Secret key (sk-lf-xxx) | | MANTIS_PUBLIC_KEY | BasicAuth mode | Public key (pk-lf-xxx) |