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

@topgunbuild/mcp-server

v0.10.0

Published

MCP Server for TopGun - enables AI assistants to interact with TopGun databases

Readme

@topgunbuild/mcp-server

MCP (Model Context Protocol) Server for TopGun - enables AI assistants like Claude Desktop and Cursor to interact with TopGun databases through natural language.

What is MCP?

MCP (Model Context Protocol) is Anthropic's open protocol for connecting AI assistants to external data sources. It allows AI tools to query, modify, and search your TopGun database using natural language.

Installation

npm install @topgunbuild/mcp-server
# or
pnpm add @topgunbuild/mcp-server

Quick Start

Claude Desktop

  1. Install the MCP server globally:
npm install -g @topgunbuild/mcp-server
  1. Configure Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):
{
  "mcpServers": {
    "topgun": {
      "command": "npx",
      "args": ["@topgunbuild/mcp-server"],
      "env": {
        "TOPGUN_URL": "ws://localhost:8080"
      }
    }
  }
}
  1. Restart Claude Desktop

  2. Try: "Show me all tasks in my TopGun database"

Cursor

Add to .cursor/config.json in your workspace:

{
  "mcp": {
    "servers": {
      "topgun": {
        "command": "npx",
        "args": ["@topgunbuild/mcp-server"],
        "env": {
          "TOPGUN_URL": "ws://localhost:8080"
        }
      }
    }
  }
}

Programmatic Usage

import { TopGunMCPServer } from '@topgunbuild/mcp-server';

const server = new TopGunMCPServer({
  topgunUrl: 'ws://localhost:8080',
  allowedMaps: ['tasks', 'users'],
  enableMutations: true,
  debug: true,
});

await server.start();

CLI Options

topgun-mcp [options]

Options:
  --url, -u <url>         TopGun server URL (default: ws://localhost:8080)
  --token, -t <token>     Authentication token
  --maps, -m <maps>       Comma-separated list of allowed maps
  --no-mutations          Disable mutation operations
  --no-subscriptions      Disable subscription operations
  --http                  Start HTTP transport instead of stdio
  --port, -p <port>       HTTP port (default: 3000)
  --debug, -d             Enable debug logging
  --help, -h              Show help
  --version, -v           Show version

Available Tools

topgun_list_maps

List all available maps.

topgun_query

Query data from a map with filters and sorting.

Example: "Show me all tasks with status 'done'"

topgun_mutate

Create, update, or delete data.

Example: "Create a task called 'Review PR #123'"

topgun_search

Perform hybrid search (BM25 full-text + exact matching).

Example: "Find tasks about authentication"

topgun_subscribe

Watch a map for real-time changes.

Example: "Watch for new high-priority tasks"

topgun_schema

Get schema information about a map.

Example: "What fields does the tasks map have?"

topgun_stats

Get statistics about TopGun connection and maps.

Example: "What's the status of my TopGun connection?"

topgun_explain

Explain how a query would be executed.

Example: "Explain query on tasks where status='done'"

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | topgunUrl | string | ws://localhost:8080 | TopGun server WebSocket URL | | authToken | string | - | Authentication token | | allowedMaps | string[] | - | Restrict to specific maps (all by default) | | enableMutations | boolean | true | Allow write operations | | enableSubscriptions | boolean | true | Allow subscriptions | | defaultLimit | number | 10 | Default query result limit | | maxLimit | number | 100 | Maximum query result limit | | subscriptionTimeoutSeconds | number | 60 | Subscription timeout | | debug | boolean | false | Enable debug logging |

HTTP Transport

For web-based MCP clients, you can start the server with HTTP transport:

topgun-mcp --http --port 3000

Endpoints:

  • GET /health - Health check
  • GET /mcp - Server info
  • GET /mcp/events - SSE connection
  • POST /mcp - Stateless tool calls

Environment Variables

| Variable | Description | |----------|-------------| | TOPGUN_URL | TopGun server URL | | TOPGUN_TOKEN | Authentication token | | TOPGUN_MAPS | Comma-separated allowed maps | | TOPGUN_MCP_PORT | HTTP port (with --http) | | TOPGUN_DEBUG | Enable debug (true/false) |

Security

  • Use allowedMaps to restrict access to specific maps
  • Use enableMutations: false for read-only access
  • Use authentication tokens in production
  • The MCP server runs locally - data never leaves your machine

License

BSL-1.1