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

@grafema/mcp

v0.3.24

Published

MCP server for Grafema code analysis toolkit

Readme

@grafema/mcp

MCP server for Grafema code analysis toolkit

Warning: This package is in beta stage and the API may change between minor versions.

Installation

npm install @grafema/mcp

Overview

Model Context Protocol (MCP) server that exposes Grafema's code analysis capabilities to AI assistants like Claude. Enables AI agents to query code graphs, trace data flow, and check invariants — without reading source code.

Quick Start

Claude Code configuration

Add to your project's .mcp.json:

{
  "mcpServers": {
    "grafema": {
      "command": "npx",
      "args": ["@grafema/mcp", "--project", "."]
    }
  }
}

The RFDB graph database server is auto-started on first query. No manual setup needed.

Claude Desktop configuration

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "grafema": {
      "command": "npx",
      "args": ["@grafema/mcp", "--project", "/path/to/project"]
    }
  }
}

Available Tools (24)

Graph Queries

| Tool | Description | |------|-------------| | query_graph | Execute Datalog queries on the code graph | | find_nodes | Find nodes by type, name, or file | | find_calls | Find all calls to a function or method | | get_stats | Get graph statistics (node/edge counts by type) | | get_schema | Get available node and edge types |

Navigation

| Tool | Description | |------|-------------| | get_function_details | Comprehensive function details (calls, calledBy, parameters) | | get_file_overview | Structured overview of all entities in a file | | get_context | Deep context for a node (source code + graph neighborhood) | | find_guards | Find conditional guards protecting a node | | read_project_structure | Directory structure of the project |

Data Flow

| Tool | Description | |------|-------------| | trace_alias | Trace alias chains to the original source | | trace_dataflow | Trace data flow from/to a variable or expression |

Analysis

| Tool | Description | |------|-------------| | analyze_project | Run full or incremental analysis | | get_analysis_status | Current analysis status and progress | | get_coverage | Analysis coverage for a path | | discover_services | Discover services without full analysis |

Guarantees

| Tool | Description | |------|-------------| | check_invariant | Check a code invariant via Datalog rule | | create_guarantee | Create a Datalog-based or contract-based guarantee | | list_guarantees | List all defined guarantees | | check_guarantees | Run all or specific guarantees | | delete_guarantee | Delete a guarantee by name |

Utilities

| Tool | Description | |------|-------------| | get_documentation | Documentation about Grafema usage | | report_issue | Report a bug to GitHub (requires GITHUB_TOKEN) | | write_config | Write or update .grafema/config.yaml |

Example Queries

// Find all database queries
query_graph("node(X, 'db:query')")

// Trace where user input flows
trace_dataflow({ from: "req.body", file: "api/users.js" })

// Check for eval usage
check_invariant("violation(X) :- node(X, 'CALL'), attr(X, 'name', 'eval')")

Configuration

GitHub Token (for bug reporting)

{
  "mcpServers": {
    "grafema": {
      "command": "npx",
      "args": ["@grafema/mcp", "--project", "."],
      "env": {
        "GITHUB_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

License

Apache-2.0