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

midnight-mcp

v0.2.3

Published

Model Context Protocol Server for Midnight Blockchain Development

Downloads

5,541

Readme

Midnight MCP Server

npm version npm downloads License TypeScript CI

MCP server that gives AI assistants access to Midnight blockchain—search contracts, analyze code, and explore documentation.

Requirements

  • Node.js 20+ (LTS recommended)

Check your version: node --version

If you use nvm, Claude Desktop may not see your nvm-managed Node. Use this config instead:

{
  "mcpServers": {
    "midnight": {
      "command": "/bin/sh",
      "args": [
        "-c",
        "source ~/.nvm/nvm.sh && nvm use 20 >/dev/null 2>&1 && npx -y midnight-mcp@latest"
      ]
    }
  }
}

Quick Start

Claude Desktop

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "midnight": {
      "command": "npx",
      "args": ["-y", "midnight-mcp@latest"]
    }
  }
}

Config file locations:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

Cursor

One-click install:

Install MCP Server

Or manually add to .cursor/mcp.json:

{
  "mcpServers": {
    "midnight": {
      "command": "npx",
      "args": ["-y", "midnight-mcp@latest"]
    }
  }
}

VS Code Copilot

Add to .vscode/mcp.json or use Command Palette: MCP: Add Server → "command (stdio)" → npx -y midnight-mcp@latest

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "midnight": {
      "command": "npx",
      "args": ["-y", "midnight-mcp@latest"]
    }
  }
}

No API keys required. Restart your editor after adding the config.

Why @latest? Unlike cached npx packages that never auto-update, @latest ensures you get new features and fixes on each restart. If upgrading from an older config without @latest, also clear your npx cache: rm -rf ~/.npm/_npx


What's Included

27 Tools

| Category | Tools | Description | | ----------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | | Search | search-compact, search-typescript, search-docs | Semantic search across Midnight codebase | | Analysis | analyze-contract, explain-circuit, extract-contract-structure | Static analysis with 15+ checks (P0-P2 severity) | | Repository | get-file, list-examples, get-latest-updates | Access files and examples | | Versioning | get-version-info, check-breaking-changes, get-migration-guide, get-file-at-version, compare-syntax, get-latest-syntax | Version tracking and migration | | AI Generation | generate-contract, review-contract, document-contract | AI-powered code generation (requires sampling) | | Compound | upgrade-check, get-repo-context | Multi-step operations (saves 50-70% tokens) | | Health | health-check, get-status, check-version | Server status and version checking | | Discovery | list-tool-categories, list-category-tools, suggest-tool | Explore available tools and get recommendations |

All tools are prefixed with midnight- (e.g., midnight-search-compact).

MCP Capabilities

| Capability | Feature | | --------------- | ----------------------------------------------- | | Tools | 27 tools with listChanged notifications | | Resources | 9 embedded resources with subscription support | | Prompts | 5 workflow prompts | | Logging | Client-controllable log level | | Completions | Autocomplete for prompt arguments | | Progress | Real-time progress for compound tools | | Sampling | AI-powered generation (when client supports it) |

9 Embedded Resources

Quick references available offline:

  • Compact syntax guide (v0.16-0.18)
  • SDK API reference
  • OpenZeppelin contracts
  • Tokenomics overview
  • Wallet integration
  • Common errors & solutions

Static Analysis

extract-contract-structure catches common mistakes before compilation:

| Check | Severity | Description | | ------------------------- | -------- | ------------------------------------------------------- | | deprecated_ledger_block | P0 | Catches ledger { } → use export ledger field: Type; | | invalid_void_type | P0 | Catches Void → use [] (empty tuple) | | invalid_pragma_format | P0 | Catches old pragma → use >= 0.16 && <= 0.18 | | unexported_enum | P1 | Enums need export for TypeScript access | | module_level_const | P0 | Use pure circuit instead | | + 10 more checks | P1-P2 | Overflow, division, assertions, etc. |

5 Prompts

  • create-contract — Generate new contracts
  • review-contract — Security and code review
  • explain-concept — Learn Midnight concepts
  • compare-approaches — Compare implementation patterns
  • debug-contract — Troubleshoot issues

Indexed Repositories

The API indexes 39 Midnight repositories:

| Category | Repositories | | --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Core | compact, midnight-js, midnight-wallet, midnight-docs, midnight-node, midnight-indexer, midnight-ledger, midnight-zk | | Examples | example-counter, example-bboard, example-dex, create-mn-app | | Infrastructure | midnight-node-docker, midnight-dapp-connector-api, compact-tree-sitter, setup-compact-action | | Partner Libraries | OpenZeppelin/compact-contracts, OpenZeppelin/midnight-apps (LunarSwap) | | Official Partners | bricktowers/midnight-seabattle, bricktowers/midnight-identity, bricktowers/midnight-rwa, MeshJS/midnight-starter-template, midnames/core | | Core Partner | PaimaStudios/midnight-game-2, PaimaStudios/midnight-wasm-prover, PaimaStudios/midnight-batcher, PaimaStudios/midnight-impact-rps-example | | Hackathon Winners | Sea Battle: ErickRomeroDev/naval-battle-game_v2, eddex/midnight-sea-battle-hackathon • Mini DApp: statera-protocol, nel349/midnight-bank, Imdavyking/zkbadge |


Advanced Configuration

HTTP Mode

Run as an HTTP server for web integrations or remote deployment:

# Start HTTP server on port 3000
npx midnight-mcp --http --port 3000

Endpoints:

  • /health - Health check
  • /mcp - Streamable HTTP (MCP protocol)
  • /sse - Server-Sent Events

CLI Options

npx midnight-mcp --help

Options:
  --stdio          Use stdio transport (default, for Claude Desktop)
  --http           Use HTTP transport with SSE support
  --port <number>  HTTP port (default: 3000)
  --json           Output in JSON (default: YAML for better LLM efficiency)
  --github-token   GitHub token (overrides GITHUB_TOKEN env var)
  -h, --help       Show help
  -v, --version    Show version

Why YAML by default? YAML is ~20-30% more token-efficient than JSON, which means AI assistants can process more context from tool responses.

Local Mode

Run everything locally for privacy or offline use:

{
  "mcpServers": {
    "midnight": {
      "command": "npx",
      "args": ["-y", "midnight-mcp@latest"],
      "env": {
        "MIDNIGHT_LOCAL": "true",
        "OPENAI_API_KEY": "sk-...",
        "CHROMA_URL": "http://localhost:8000"
      }
    }
  }
}

Requires ChromaDB (docker run -d -p 8000:8000 chromadb/chroma) and OpenAI API key.

GitHub Token

Add "GITHUB_TOKEN": "ghp_..." for higher GitHub API rate limits (60 → 5000 requests/hour).


Developer Setup

git clone https://github.com/Olanetsoft/midnight-mcp.git && cd midnight-mcp
npm install && npm run build && npm test

The hosted API runs on Cloudflare Workers + Vectorize. See api/README.md for backend details.


Links

License

MIT

Thanks to all Stargazers ⭐️