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

@ziwansi/mcp-firewall

v0.1.4

Published

MCP Firewall CLI — Security & Observability proxy for MCP (Model Context Protocol)

Readme

🛡️ MCP Firewall

Security & Observability proxy for MCP (Model Context Protocol)

MCP Firewall sits between your AI client and MCP servers, providing defense-in-depth security with 11 protection layers and 108 injection detection patterns — before any tool call reaches your filesystem or database.

Installation

npm install -g @ziwansi/mcp-firewall

Requires Node.js >= 18.

Quick Start

# 1. Generate a safe read-only config
mcp-firewall init --preset readonly

# 2. Review and customize
#    Edit mcp-firewall.yaml to set your upstream MCP servers

# 3. Validate the config
mcp-firewall validate mcp-firewall.yaml

# 4. Start the firewall
mcp-firewall run mcp-firewall.yaml

# 5. (Optional) Open the live dashboard in another terminal
mcp-firewall dashboard

How It Works

AI Client ──→ MCP Firewall ──→ MCP Server (filesystem, database, etc.)
                │
                ├─ 1. Method Allowlist      Only known MCP methods pass
                ├─ 2. Authentication        API key / JWT validation
                ├─ 3. RBAC                  Role-based tool permissions
                ├─ 4. Rate Limiting         Sliding-window throttling
                ├─ 5. Parameter Validation  Path traversal, injection detection
                └─ 6. Content Filter        Sensitive data masking & blocking

Commands

| Command | Description | |---|---| | mcp-firewall run <config> | Start the firewall proxy | | mcp-firewall init [--preset readonly\|full] | Generate a config file | | mcp-firewall validate <config> | Validate a config file | | mcp-firewall dashboard | Start the web monitoring UI | | mcp-firewall status | Show firewall health status | | mcp-firewall logs | Tail the audit log |

Configuration

The firewall is configured via a YAML file. Generate one with mcp-firewall init.

Presets

  • readonly — Allows reading files, blocks all writes/deletes. Safe for sharing filesystem access.
  • full — Allows all operations with all security layers enabled. Good starting point for customization.

Security Layers

Each layer can be enabled/disabled independently:

policies:
  methodAllowlist:
    enabled: true
    allowedMethods: [initialize, ping, tools/list, tools/call, ...]
    blockUnknown: true

  auth:
    enabled: true
    # API key or JWT validation

  rbac:
    enabled: true
    defaultDeny: true
    rules:
      - name: "allow-reads"
        principals: [{ type: "client-id", pattern: "*" }]
        targets: [{ method: "tools/call", toolName: "read_file" }]
        permission: allow

  rateLimiting:
    enabled: true
    rules:
      - windowMs: 60000
        maxRequests: 100

  parameterValidation:
    enabled: true
    # Automatically detects: path traversal, null bytes,
    # SQL injection, command injection (14 patterns)

  contentFilter:
    enabled: true
    rules:
      - pattern: "(\\.env|\\.git-credentials|secrets)"
        action: block

  sensitiveData:
    enabled: true
    detectors:
      - type: api-key         # AWS, GitHub, OpenAI keys
      - type: credit-card     # Visa, Mastercard, Amex
      - type: jwt             # JSON Web Tokens
      - type: email           # Email addresses
      - type: phone           # Phone numbers
      - type: ssn             # US Social Security Numbers
      - type: private-key     # RSA/EC private keys
      - type: connection-string # MongoDB, PostgreSQL, Redis URLs

Dashboard

mcp-firewall dashboard --port 9021

Opens a real-time monitoring UI at http://localhost:9021 with:

  • Live request streaming via SSE
  • Block/allow/warn statistics
  • Security layer status indicators
  • Configurable log filtering

Cross-Platform

Works on Windows, macOS, and Linux. All code uses Node.js built-in modules with no platform-specific dependencies.

Upstream MCP Servers

Configure any MCP server as an upstream:

upstreams:
  - name: filesystem
    transport: stdio
    command: npx
    args:
      - "-y"
      - "@modelcontextprotocol/server-filesystem"
      - "/path/to/allowed/directory"

  - name: postgres
    transport: stdio
    command: npx
    args:
      - "-y"
      - "@modelcontextprotocol/server-postgres"
      - "postgresql://localhost/mydb"

License

MIT © ziwansi