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

@sanity-labs/agent-context-inspector

v0.0.6

Published

A dev tool for inspecting and testing Sanity Agent Contexts. It runs a small server and web UI where you can chat with your agent, see tool calls and token usage, and tweak system prompts and runtime options.

Readme

@sanity-labs/agent-context-inspector

A dev tool for inspecting and testing Sanity Agent Contexts. It runs a small server and web UI where you can chat with your agent, see tool calls and token usage, and tweak system prompts and runtime options.

Getting started

There are three ways to configure the inspector.

Option A: Browser UI (zero config)

Just run the dev server:

npx @sanity-labs/agent-context-inspector@latest dev

A setup form will appear in the browser where you enter your project ID, dataset, Sanity API token, and Anthropic API key. Settings are saved in your browser's local storage for subsequent visits.

Option B: CLI flags

Pass credentials directly on the command line:

npx @sanity-labs/agent-context-inspector@latest dev \
  --project-id :projectId \
  --dataset :dataset \
  --slug my-agent \       # optional — targets a specific Agent Context document
  --token sk-... \
  --anthropic-api-key sk-ant-...

Alternatively, pass a full MCP server URL with --url:

npx @sanity-labs/agent-context-inspector@latest dev \
  --url https://api.sanity.io/v2026-03-03/agent-context/:projectId/:dataset/my-agent \
  --token sk-... \
  --anthropic-api-key sk-ant-...

Option C: Config file

For teams or multi-context setups, install the package and create a context-inspector.config.ts:

npm install -D @sanity-labs/agent-context-inspector
import {defineConfig} from '@sanity-labs/agent-context-inspector'

export default defineConfig({
  contexts: [
    {
      name: 'my-agent',
      title: 'My Agent',
      url: 'https://api.sanity.io/v2026-03-03/agent-context/:projectId/:dataset',
      tokenEnv: 'MY_AGENT_TOKEN',
      systemPrompt: 'You are a helpful assistant.',
    },
    // Add more contexts here...
  ],
})

Add your keys to .env. The tokenEnv field in your config is the env var name the server reads the Sanity API token from:

ANTHROPIC_API_KEY=sk-ant-...
MY_AGENT_TOKEN=sk-...

Then start the dev server:

npx context-inspector dev

Prerequisites

All options require a Sanity API token (read access) and an Anthropic API key:

Precedence

When multiple sources are present: CLI flags > config file > browser UI.

Commands

The examples below use npx context-inspector which requires the package to be installed locally. If you haven't installed it, use npx @sanity-labs/agent-context-inspector instead.

dev

Start the development server with hot reloading:

npx context-inspector dev [options]

Opens at http://localhost:3100 by default.

build

Build for production deployment (requires a config file):

npx context-inspector build

Outputs a self-contained server to .output/.

preview

Preview the production build locally:

npx context-inspector preview [--port 3100]

CLI flags

All flags are optional. When --project-id, --dataset, and --token are provided together, the inspector connects without needing a config file.

| Flag | Description | Default | | --------------------------- | ----------------------------------------------- | --------------- | | --port <port> | Port to listen on | 3100 | | --project-id <id> | Sanity project ID | | | --dataset <name> | Sanity dataset name | | | --slug <slug> | Agent Context document slug | | | --token <token> | Sanity API read token | | | --anthropic-api-key <key> | Anthropic API key | | | --url <url> | Full MCP server URL (overrides project/dataset) | | | --api-version <version> | Sanity API version | v2026-03-03 | | --api-host <host> | Sanity API host | api.sanity.io | | --name <name> | Context display name | |

Config file reference

Each context entry accepts:

| Field | Required | Description | | -------------- | -------- | ------------------------------------------------------------------- | | name | yes | URL-safe identifier | | title | yes | Display name in the UI | | url | yes | MCP server URL | | tokenEnv | yes | Env var name holding the Sanity API token (e.g. 'MY_AGENT_TOKEN') | | systemPrompt | no | Default system prompt | | instructions | no | Default MCP instructions override | | groqFilter | no | Default GROQ filter override |

Optional fields can also be edited live in the sidebar during a session.

Resources