Skip to main content
Glama

Midnight + Next.js Development MCP Server

A Model Context Protocol (MCP) server combining Midnight Network blockchain development tools with Next.js DevTools for building decentralized applications.

Compatible with all MCP-enabled AI assistants: Claude, GitHub Copilot, Cursor, Windsurf, Codeium, Continue.dev, Zed, Sourcegraph Cody, and more.

๐Ÿค– Supported AI Assistants

This MCP server works with any AI assistant that supports the Model Context Protocol:

AI Assistant

Platform

Configuration

Claude

Desktop App, VS Code

Native MCP support

GitHub Copilot

VS Code, JetBrains

MCP extension

Cursor

IDE

Built-in MCP support

Windsurf

IDE

Built-in MCP support

Codeium

VS Code, JetBrains

MCP integration

Continue.dev

VS Code, JetBrains

MCP config file

Zed

IDE

MCP support

Sourcegraph Cody

VS Code

MCP extension

Related MCP server: Debugger MCP Server

๐ŸŒ™ Features

Midnight Network Tools

Contract Development

  • midnight_init - Initialize development context

  • midnight_compile_contract - Compile Compact contracts to TypeScript/ZK artifacts

  • midnight_analyze_contract - Static analysis for contracts

  • midnight_deploy_contract - Deploy contracts to the network

  • midnight_call_contract - Execute circuit calls on deployed contracts

  • midnight_scaffold_project - Create new dApp projects from templates

Wallet & Tokens

  • midnight_create_wallet - Generate new wallet with seed phrase

  • midnight_wallet_state - Get detailed wallet state and balances

  • midnight_transfer_tokens - Transfer tDUST tokens

  • midnight_get_balance - Query token balances

Network & Queries

  • midnight_network_status - Check network health (Indexer, Proof Server, Node)

  • midnight_get_block - Query blockchain blocks

  • midnight_get_transaction - Query transaction details

  • midnight_check_versions - Check for Midnight package updates

Documentation

  • midnight_search_docs - Search Midnight documentation

  • midnight-fetch-docs - Fetch specific documentation pages

  • midnight-sync-docs - Sync documentation from official repo

  • midnight-docs-status - Check documentation sync status

  • midnight-list-docs - List available documentation sources

Next.js DevTools

  • init - Initialize Next.js development context

  • nextjs_docs - Search Next.js documentation

  • nextjs_index - Discover running dev servers

  • nextjs_call - Execute runtime diagnostic tools

  • browser_eval - Browser automation with Playwright

  • upgrade_nextjs_16 - Next.js 16 upgrade guide

  • enable_cache_components - Cache Components migration

๐Ÿ“ฆ Installation

# Clone the repository
git clone https://github.com/your-username/midnight-nextjs-mcp.git
cd midnight-nextjs-mcp

# Install dependencies
pnpm install

# Build
pnpm build

๐Ÿš€ Usage

Quick Start with npx

The easiest way to use this MCP server is via npx โ€” no installation required:

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

Configuration Examples

The MCP configuration format is standardized across most AI assistants. Below are platform-specific examples:


Universal MCP Configuration

Most MCP clients use this standard JSON format. Add to your client's MCP configuration file:

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

VS Code (GitHub Copilot / Claude Extension)

Add to your VS Code settings.json or workspace .vscode/mcp.json:

{
  "mcp.servers": {
    "midnight-nextjs-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "midnight-nextjs-mcp@latest"]
    }
  }
}

Or for Claude extension specifically:

{
  "claude.mcpServers": {
    "midnight-nextjs-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "midnight-nextjs-mcp@latest"]
    }
  }
}

Claude Desktop (macOS)

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:

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

Claude Desktop (Windows)

Edit %APPDATA%\Claude\claude_desktop_config.json:

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

Claude Desktop (Linux)

Edit ~/.config/Claude/claude_desktop_config.json:

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

Cursor IDE

Add to your Cursor MCP configuration (.cursor/mcp.json in your project or global settings):

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

Windsurf / Codeium

Add to your Windsurf MCP settings:

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

Continue.dev (VS Code / JetBrains)

Add to ~/.continue/config.json or your project's .continue/config.json:

{
  "experimental": {
    "modelContextProtocolServers": [
      {
        "name": "midnight-nextjs-mcp",
        "transport": {
          "type": "stdio",
          "command": "npx",
          "args": ["-y", "midnight-nextjs-mcp@latest"]
        }
      }
    ]
  }
}

Zed Editor

Add to your Zed settings (~/.config/zed/settings.json on Linux, ~/Library/Application Support/Zed/settings.json on macOS):

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

Sourcegraph Cody

Add to your Cody MCP configuration:

{
  "cody.experimental.mcp.servers": {
    "midnight-nextjs-mcp": {
      "command": "npx",
      "args": ["-y", "midnight-nextjs-mcp@latest"]
    }
  }
}

JetBrains IDEs (IntelliJ, WebStorm, etc.)

For AI assistants in JetBrains IDEs that support MCP, add to your MCP configuration:

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

Using Global Installation

If you prefer a global install instead of npx:

npm install -g midnight-nextjs-mcp

Then configure:

{
  "mcpServers": {
    "midnight-nextjs-mcp": {
      "type": "stdio",
      "command": "midnight-nextjs-mcp"
    }
  }
}

Local Development / From Source

{
  "mcpServers": {
    "midnight-nextjs-mcp": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/midnight-nextjs-mcp/dist/index.js"]
    }
  }
}

Docker

Run the MCP server in a Docker container:

{
  "mcpServers": {
    "midnight-nextjs-mcp": {
      "type": "stdio",
      "command": "docker",
      "args": ["run", "-i", "--rm", "fractionestate/midnight-nextjs-mcp:latest"]
    }
  }
}

CLI Flags

# Enable both tool categories (default)
npx midnight-nextjs-mcp@latest

# Disable Midnight tools (Next.js only)
npx midnight-nextjs-mcp@latest --no-midnight

# Disable Next.js tools (Midnight only)
npx midnight-nextjs-mcp@latest --no-nextjs

# Check package versions on startup
npx midnight-nextjs-mcp@latest --check-versions

# Set version polling interval (default 24 hours)
npx midnight-nextjs-mcp@latest --poll-interval=12

๐Ÿ—๏ธ Project Structure

midnight-nextjs-mcp/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ index.ts                    # Server entry point
โ”‚   โ”œโ”€โ”€ tools/
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts                # Unified tool registry
โ”‚   โ”‚   โ”œโ”€โ”€ midnight/               # Midnight Network tools
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ init.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ network-status.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ get-balance.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ get-block.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ get-transaction.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ search-docs.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ scaffold-project.ts
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ compile-contract.ts
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ analyze-contract.ts
โ”‚   โ”‚   โ””โ”€โ”€ nextjs/                 # Next.js DevTools
โ”‚   โ”‚       โ”œโ”€โ”€ init.ts
โ”‚   โ”‚       โ”œโ”€โ”€ nextjs-docs.ts
โ”‚   โ”‚       โ”œโ”€โ”€ nextjs_index.ts
โ”‚   โ”‚       โ”œโ”€โ”€ nextjs_call.ts
โ”‚   โ”‚       โ”œโ”€โ”€ browser-eval.ts
โ”‚   โ”‚       โ”œโ”€โ”€ upgrade-nextjs-16.ts
โ”‚   โ”‚       โ””โ”€โ”€ enable-cache-components.ts
โ”‚   โ”œโ”€โ”€ providers/                  # Midnight API providers
โ”‚   โ”‚   โ”œโ”€โ”€ index.ts
โ”‚   โ”‚   โ”œโ”€โ”€ indexer.ts              # GraphQL indexer client
โ”‚   โ”‚   โ”œโ”€โ”€ proof-server.ts         # Proof generation client
โ”‚   โ”‚   โ””โ”€โ”€ node.ts                 # Node RPC client
โ”‚   โ”œโ”€โ”€ resources/                  # MCP resources
โ”‚   โ”‚   โ”œโ”€โ”€ (midnight-compact)/     # Compact language docs
โ”‚   โ”‚   โ”œโ”€โ”€ (midnight-sdk)/         # SDK documentation
โ”‚   โ”‚   โ”œโ”€โ”€ (cache-components)/     # Next.js cache docs
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ prompts/                    # MCP prompts
โ”‚   โ”‚   โ”œโ”€โ”€ create-midnight-contract.ts
โ”‚   โ”‚   โ”œโ”€โ”€ upgrade-nextjs-16.ts
โ”‚   โ”‚   โ””โ”€โ”€ enable-cache-components.ts
โ”‚   โ””โ”€โ”€ types/                      # TypeScript definitions
โ”‚       โ”œโ”€โ”€ midnight.ts
โ”‚       โ””โ”€โ”€ mcp.ts
โ”œโ”€โ”€ package.json
โ””โ”€โ”€ README.md

๐Ÿ”ง Configuration

Environment Variables

You can pass environment variables to the MCP server in your configuration:

{
  "mcpServers": {
    "midnight-nextjs-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "midnight-nextjs-mcp@latest"],
      "env": {
        "MIDNIGHT_NETWORK": "testnet",
        "MIDNIGHT_INDEXER_URL": "https://indexer.testnet.midnight.network/graphql"
      }
    }
  }
}

Available Environment Variables

# Midnight Network (optional, defaults to testnet)
MIDNIGHT_NETWORK=testnet
MIDNIGHT_INDEXER_URL=https://indexer.testnet.midnight.network/graphql
MIDNIGHT_PROOF_SERVER_URL=https://proof-server.testnet.midnight.network
MIDNIGHT_NODE_URL=https://rpc.testnet.midnight.network

Network Configurations

Network

Indexer

Proof Server

Testnet

indexer.testnet.midnight.network

proof-server.testnet.midnight.network

Devnet

localhost:8080

localhost:6300

๐Ÿ“š Resources

The server exposes documentation resources:

Midnight Resources

  • midnight://compact/overview - Compact language introduction

  • midnight://compact/reference - Complete syntax reference

  • midnight://sdk/overview - Midnight.js SDK guide

Next.js Resources

  • nextjs-docs://llms-index - Documentation index

  • cache-components://overview - Cache Components guide

๐Ÿงช Development

# Watch mode
pnpm dev

# Type check
pnpm typecheck

# Run tests
pnpm test

# Build
pnpm build

๐Ÿ“– Documentation

Client-Specific MCP Documentation

๐Ÿค Contributing

Contributions welcome! Please read the contributing guidelines first.

๐Ÿ“„ License

MIT License - see LICENSE for details.


Built with โค๏ธ for the Midnight and Next.js communities.

Available Tools

35 tools
browser_evalA

Automate and test web applications using Playwright browser automation. This tool connects to playwright-mcp server and provides access to all Playwright capabilities.

CRITICAL FOR PAGE VERIFICATION: When verifying pages in Next.js projects (especially during upgrades or testing), you MUST use browser automation to load pages in a real browser instead of curl or simple HTTP requests. This is because:

  • Browser automation actually renders the page and executes JavaScript (curl only fetches HTML)

  • Detects runtime errors, hydration issues, and client-side problems that curl cannot catch

  • Verifies the full user experience, not just HTTP status codes

  • Captures browser console errors and warnings via console_messages action

IMPORTANT FOR NEXT.JS PROJECTS: If working with a Next.js application, PRIORITIZE using the 'nextjs_index' and 'nextjs_call' tools instead of browser console log forwarding. Next.js has built-in MCP integration that provides superior error reporting, build diagnostics, and runtime information directly from the Next.js dev server. Only use browser_eval's console_messages action as a fallback when these Next.js tools are not available or when you specifically need to test client-side browser behavior that Next.js runtime cannot capture.

Available actions:

  • start: Start browser automation (automatically installs if needed). Verbose logging is always enabled.

  • navigate: Navigate to a URL

  • click: Click on an element

  • type: Type text into an element

  • fill_form: Fill multiple form fields at once

  • evaluate: Execute JavaScript in browser context

  • screenshot: Take a screenshot of the page

  • console_messages: Get browser console messages (for Next.js, prefer nextjs_index/nextjs_call tools instead)

  • close: Close the browser

  • drag: Perform drag and drop

  • upload_file: Upload files

  • list_tools: List all available browser automation tools from the server

Note: The playwright-mcp server will be automatically installed if not present.

Inputs: action, browser, headless, url, +15 more.

disable_toolsetA

Disable a toolset that was previously enabled. The tools in this toolset will no longer be available.

Inputs: toolset.

enable_cache_componentsB

Migrate Next.js applications to Cache Components mode and complete setup for Next.js 16.

Use this tool when you need to:

  • Migrate to Cache Components mode

  • Migrate to cache components

  • Enable Cache Components

  • Set up Cache Components

  • Convert to Cache Components

This tool handles ALL steps for migrating and enabling Cache Components:

  • Configuration: Updates cacheComponents flag (experimental in 16.0.0, stable in canary > 16), removes incompatible flags

  • Dev Server: Starts dev server (MCP is enabled by default in Next.js 16+)

  • Error Detection: Loads all routes via browser automation, collects errors using Next.js MCP

  • Automated Fixing: Adds Suspense boundaries, "use cache" directives, generateStaticParams, cacheLife profiles, cache tags

  • Verification: Validates all routes work with zero errors

Key Features:

  • One-time dev server start (no restarts needed)

  • Automated error detection using Next.js MCP tools

  • Browser-based testing with browser automation

  • Fast Refresh applies fixes instantly

  • Comprehensive fix strategies for all error types

  • Support for "use cache", "use cache: private", Suspense boundaries

  • Cache invalidation with cacheTag() and cacheLife() configuration

Requires:

  • Next.js 16.0.0+ (stable or canary only - beta versions are NOT supported)

  • Clean working directory preferred

  • Browser automation installed (auto-installed if needed)

This tool embeds complete knowledge base for:

  • Cache Components mechanics

  • Error patterns and solutions

  • Caching strategies (static vs dynamic)

  • Advanced patterns (cacheLife, cacheTag, draft mode)

  • Build behavior and prefetching

  • Test-driven patterns from 125+ fixtures

Inputs: project_path.

enable_toolsetA

Enable one of the sets of tools the MCP server provides. Use get_toolset_tools and list_available_toolsets first to see what this will enable.

Inputs: toolset.

get_environment_infoA

Get information about the runtime environment including Node.js version, platform, and system resources.

Inputs: no named parameters.

get_server_statusA

Get the current server status including health, active connections, and resource usage. Use this to diagnose server issues.

Inputs: no named parameters.

get_session_infoA

Get information about the current MCP session including server version, enabled toolsets, and environment. Use this to understand the current context.

Inputs: no named parameters.

get_toolset_toolsA

Lists all the capabilities that are enabled with the specified toolset. Use this to get clarity on whether enabling a toolset would help you to complete a task.

Inputs: toolset.

initA

โš ๏ธ CALL THIS FIRST - Initialize Next.js DevTools MCP context and establish MANDATORY documentation requirements.

IMPORTANT: This tool MUST be called at the START of every Next.js development session.

This tool:

  • Establishes MANDATORY requirement to use nextjs_docs for ALL Next.js-related queries

  • Instructs AI to forget any prior Next.js knowledge and always query docs

  • Documents all available MCP tools (nextjs_docs, nextjs_index, nextjs_call, browser_eval, upgrade_nextjs_16, enable_cache_components)

Use this tool at the beginning of a Next.js session to:

  • Reset AI's Next.js knowledge baseline

  • Ensure 100% documentation-first approach with no exceptions

  • Understand available tools and their use cases

  • Follow best practices for Next.js development

Inputs: project_path.

list_available_toolsetsA

List all available toolsets this MCP server can offer, providing the enabled status of each. Use this when a task could be achieved with a tool and the currently available tools aren't enough. Call get_toolset_tools with these toolset names to discover specific tools you can call.

Inputs: no named parameters.

list_enabled_featuresA

List all currently enabled features and feature flags. Use this to understand what capabilities are available.

Inputs: no named parameters.

midnight_analyze_contractA

Perform static analysis on a Compact smart contract.

Analyzes:

  • Contract structure and patterns

  • Potential security issues

  • Gas/complexity estimates

  • Best practice violations

  • Privacy considerations

Use this tool to:

  • Review contracts before deployment

  • Identify potential issues

  • Learn Compact best practices

  • Optimize contract design

Inputs: source, check_security, check_gas.

midnight_call_contractA

Execute a circuit call on a deployed Midnight smart contract.

Circuit Types:

  • Public circuits: Read-only operations that don't modify state

  • Private circuits: Operations with private witnesses and ZK proofs

  • State-changing circuits: Modify ledger state (requires wallet)

Call Process:

  1. Load contract at specified address

  2. Prepare circuit arguments

  3. Generate ZK proof (if required)

  4. Submit transaction

  5. Return result or state changes

Privacy Features:

  • Private inputs are never revealed on-chain

  • ZK proofs validate computation without exposing data

  • Private state is stored locally with private_state_id

Example:

midnight_call_contract({
  contract_address: "0x123...",
  circuit_name: "transfer",
  arguments: {
    to: "0xabc...",
    amount: 100
  }
})

Inputs: contract_address, circuit_name, arguments, private_state_id, +3 more.

midnight_check_versionsA

Check for updates to @midnight-ntwrk npm packages.

Compares installed versions against the latest available on npm. Supports both stable and alpha/beta version tracking.

Use this tool to:

  • Check if dependencies are outdated

  • Find available updates for Midnight SDK

  • Get upgrade commands

  • Track alpha/beta releases for early testing

Inputs: packages, include_alpha, refresh, format.

midnight_compile_contractA

Compile a Compact smart contract to TypeScript bindings and ZK artifacts.

Generates:

  • TypeScript type definitions

  • Contract interaction code

  • Circuit metadata

  • ZK proving/verifying keys (references)

Use this tool to:

  • Compile Compact source code

  • Generate TypeScript bindings for SDK

  • Prepare contracts for deployment

Note: Full compilation requires the compactc compiler installed locally.

Inputs: source, output_dir, contract_name.

midnight_create_walletA

Create a new Midnight wallet with a fresh seed phrase.

Security Warning:

  • The seed phrase will be displayed ONCE

  • Store it securely offline

  • Never share your seed phrase

  • Loss of seed phrase = loss of funds

Wallet Features:

  • Native tDUST balance management

  • Private and shielded transactions

  • Contract interaction support

  • Multiple address derivation

After Creation:

  1. Save your seed phrase securely

  2. Get testnet tDUST from the faucet

  3. Use wallet for contract deployment

Faucet: https://faucet.testnet.midnight.network

Inputs: network, seed_words.

midnight_deploy_contractA

Deploy a compiled Compact smart contract to the Midnight Network.

Prerequisites:

  1. Contract must be compiled first using midnight_compile_contract

  2. Wallet with sufficient tDUST balance for deployment

  3. Network connectivity to target environment

Deployment Process:

  1. Load compiled contract artifacts

  2. Initialize contract private state (if any)

  3. Create deployment transaction

  4. Generate ZK proof for deployment

  5. Submit transaction to the network

  6. Wait for confirmation

Returns:

  • Contract address

  • Transaction hash

  • Block height

  • Deployment cost

Security: Use MIDNIGHT_WALLET_SEED environment variable for wallet credentials.

Testnet Faucet: Get free tDUST at https://faucet.testnet.midnight.network

Inputs: contract_name, compiled_path, initial_state, network, +3 more.

midnight-docs-statusB

Get the current status of documentation sync, including cache age and available updates.

Inputs: input.

midnight-fetch-docsB

Fetch documentation directly from the official Midnight docs. Use when you know the specific path or need the full content of a documentation page.

Inputs: input.

midnight_get_balanceA

Query token balance for a Midnight Network address.

Returns:

  • tDUST (native token) balance

  • Address information

Use this tool to:

  • Check wallet balances

  • Verify transaction results

  • Monitor account funds

Note: For testnet, you can get free tDUST from the faucet.

Inputs: address, network.

midnight_get_blockB

Query block information from the Midnight blockchain.

Returns:

  • Block height

  • Block hash

  • Timestamp

  • Transaction count

Use this tool to:

  • Get current block height (omit height parameter)

  • Inspect specific blocks

  • Monitor chain progress

Inputs: height, network.

midnight_get_transactionA

Query transaction details from the Midnight blockchain.

Returns:

  • Transaction hash

  • Block height

  • Status (pending/confirmed/failed)

  • Contract address (if applicable)

  • Circuit name (if contract call)

Use this tool to:

  • Check transaction status

  • Debug failed transactions

  • Inspect contract interactions

Inputs: hash, network.

midnight_initA

โš ๏ธ CALL THIS FIRST - Initialize Midnight Network development context.

IMPORTANT: This tool MUST be called at the START of every Midnight development session.

This tool:

  • Establishes network configuration (testnet, devnet, or mainnet)

  • Documents all available Midnight MCP tools

  • Provides guidance on Compact smart contract development

  • Sets up provider connections for blockchain queries

Use this tool to:

  • Configure which Midnight network to connect to

  • Understand available tools for contract development

  • Learn about Compact language basics

  • Get started with Midnight dApp development

Inputs: network, indexer_url, proof_server_url.

midnight-list-docsC

List all available documentation sources with their sync status.

Inputs: input.

midnight_network_statusB

Check the health status of Midnight Network services.

Returns the status of:

  • Indexer (GraphQL API for blockchain data)

  • Proof Server (ZK proof generation)

  • Node RPC (transaction submission)

  • Current block height

  • Network ID

Use this tool to:

  • Verify network connectivity before operations

  • Debug connection issues

  • Check service latency

Inputs: network, indexer_url, proof_server_url, node_url.

midnight_scaffold_projectA

Scaffold a new Midnight dApp project from a template.

Templates available:

  • counter: Simple counter contract (great for learning)

  • token: Private token with transfers and balances

  • voting: Privacy-preserving voting system

  • blank: Empty project structure

Generates:

  • Compact contract files

  • TypeScript SDK integration

  • React UI (optional)

  • Build and test configuration

Use this tool to:

  • Start a new Midnight project quickly

  • Learn from example contracts

  • Set up proper project structure

Inputs: name, template, include_ui, package_manager, +3 more.

midnight-search-docsB

Search Midnight documentation content. Use for finding guides, API docs, and conceptual explanations about the Midnight blockchain and Compact language.

Inputs: input.

midnight_search_docsA

Search Midnight Network official documentation.

Searches across:

  • Compact language reference

  • SDK/API documentation

  • Tutorials and guides

  • Example code

Use this tool to:

  • Find how to use specific features

  • Look up Compact syntax

  • Find code examples

  • Learn Midnight concepts

Inputs: query, category.

midnight-sync-docsB

Sync documentation from the official Midnight repository. Use to ensure documentation is up to date.

Inputs: input.

midnight_transfer_tokensA

Transfer tDUST tokens to another address.

Transfer Types:

  • Standard: Public transfer visible on-chain

  • Shielded: Private transfer using ZK proofs

Requirements:

  • Wallet with sufficient balance

  • Network connectivity

  • Gas for transaction fees

Fees:

  • Standard transfer: ~0.001 tDUST

  • Shielded transfer: ~0.005 tDUST (proof generation)

Security: Use MIDNIGHT_WALLET_SEED environment variable.

Inputs: to, amount, network, memo, +1 more.

midnight_wallet_stateA

Get detailed wallet state including balances, coins, and sync status.

Returns:

  • tDUST balance (total and available)

  • Individual coin details

  • Pending transactions

  • Sync status with network

Coin Types:

  • Unshielded: Publicly visible balance

  • Shielded: Private balance (ZK protected)

  • Pending: Awaiting confirmation

Use for:

  • Checking available funds before operations

  • Debugging transaction issues

  • Monitoring wallet health

Inputs: address, network.

nextjs_callA

Call a specific MCP tool on a running Next.js development server.

REQUIREMENTS:

  • Port number of the target Next.js dev server

  • Tool name to execute

  • Optional arguments object (if the tool requires parameters)

Use 'nextjs_index' first to discover available servers, tools, and their input schemas. If 'nextjs_index' auto-discovery fails, ask the user for the port and call 'nextjs_index' again with the 'port' parameter.

IMPORTANT: When calling tools:

  • The 'args' parameter MUST be an object (e.g., {key: "value"}), NOT a string

  • If a tool doesn't require arguments, OMIT the 'args' parameter entirely - do NOT pass {} or "{}"

  • Check the tool's inputSchema from 'nextjs_index' to see what arguments are required

Common Next.js MCP tools include:

  • Error diagnostics (get compilation/runtime errors)

  • Route information (list all routes)

  • Build status (check compilation state)

  • Cache management (clear caches)

  • And more (varies by Next.js version)

Example usage:

  1. Call 'nextjs_index' to see servers and tools

  2. Call 'nextjs_call' with port=3000, toolName="get_errors" to get errors from server on port 3000

Inputs: port, toolName, args.

nextjs_docsB

Fetch Next.js official documentation by path.

IMPORTANT: You MUST first read the nextjs-docs://llms-index MCP resource to get the correct path. Do NOT guess paths.

Workflow:

  1. Read the nextjs-docs://llms-index resource to get the documentation index

  2. Find the relevant path in the index for what you're looking for

  3. Call this tool with that exact path

Example: nextjs_docs({ path: "/docs/app/api-reference/functions/refresh" })

Inputs: action, query, path, anchor.

nextjs_indexA

Discover all running Next.js development servers and list their available MCP tools.

WHEN TO USE THIS TOOL - Use proactively in these scenarios:

  1. Before implementing ANY changes to the app: When asked to add, modify, or fix anything in the application:

    • "Add a loading state" โ†’ Check current component structure and routes first

    • "Fix the navigation" โ†’ Inspect existing routes and components

    • "Update the API endpoint" โ†’ Query current routes and data flows

    • "Add error handling" โ†’ Check runtime errors and component hierarchy

    • "Refactor the auth logic" โ†’ Inspect current auth implementation and routes

    • "Optimize performance" โ†’ Check runtime diagnostics and component tree Use this to understand where changes should be made and what currently exists.

  2. For diagnostic and investigation questions:

    • "What's happening?" / "What's going on?" / "Why isn't this working?"

    • "Check the errors" / "See what's wrong"

    • "What routes are available?" / "Show me the routes"

    • "Clear the cache" / "Reset everything"

    • Questions about build status, compilation errors, or runtime diagnostics

  3. For agentic codebase search: Use this as FIRST CHOICE for searching the currently running app. If not found, fallback to static codebase search tools.

KEY PRINCIPLE: If the request involves the running Next.js application (whether to investigate OR modify it), query the runtime FIRST to understand current state before proceeding.

REQUIREMENTS:

  • Next.js 16 or later (MCP support was added in v16)

  • If you're on Next.js 15 or earlier, use the 'upgrade-nextjs-16' MCP prompt to upgrade first

Next.js 16+ exposes an MCP (Model Context Protocol) endpoint at /_next/mcp automatically when the dev server starts. No configuration needed - MCP is enabled by default in Next.js 16 and later.

This tool discovers all running Next.js servers and returns:

  • Server port, PID, and URL

  • Complete list of available MCP tools for each server

  • Tool descriptions and input schemas

After calling this tool, use 'nextjs_call' to execute specific tools.

[IMPORTANT] If auto-discovery returns no servers:

  1. Ask the user which port their Next.js dev server is running on

  2. Call this tool again with the 'port' parameter set to the user-provided port

If the MCP endpoint is not available:

  1. Ensure you're running Next.js 16 or later (use the 'upgrade-nextjs-16' prompt to upgrade)

  2. Verify the dev server is running (npm run dev)

  3. Check that the dev server started successfully without errors

Inputs: port.

upgrade_nextjs_16A

Guide through upgrading Next.js to version 16.

CRITICAL: Runs the official codemod FIRST (requires clean git state) for automatic upgrades and fixes, then handles remaining issues manually. The codemod upgrades Next.js, React, and React DOM automatically.

Covers:

  • Next.js version upgrade to 16

  • Async API changes (params, searchParams, cookies, headers)

  • Config migration (next.config changes)

  • Image defaults and optimization

  • Parallel routes and dynamic segments

  • Deprecated API removals

  • React 19 compatibility

The codemod requires:

  • Clean git working directory (commit or stash changes first)

  • Node.js 18+

  • npm/pnpm/yarn/bun installed

After codemod runs, provides manual guidance for any remaining issues not covered by the codemod.

Inputs: project_path.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    B3.3/5.0

    Scored across 35 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is direct overlap between midnight-search-docs and midnight_search_docs, which ambiguously serve the same function. Additionally, the mix of Next.js and Midnight tools with similar prefixes (init vs midnight_init) could cause confusion.

    Naming Consistency3/5

    Naming conventions are inconsistent: some Midnight tools use underscores (midnight_analyze_contract) while others use hyphens (midnight-docs-status). Next.js tools use underscores, and general tools also use underscores. This mix of patterns reduces predictability.

    Tool Count2/5

    With 35 tools covering two distinct domains (Next.js and Midnight), the count exceeds the recommended upper bound of 25. While each domain individually has a reasonable number, the combined surface is too large for a single server.

    Completeness3/5

    The Next.js tools cover common workflows (indexing, calling, docs, upgrade) and the Midnight tools cover contract lifecycle and network queries. However, there are notable gaps like missing contract deletion or event log retrieval, and the duplicate search tool suggests incomplete rationalization.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to automate Next.js development including project scaffolding, React component generation, API route creation, and full-stack application workflows with TypeScript and Tailwind CSS support.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides real-time debugging, code quality monitoring, and performance insights for React/Next.js applications with features including Chrome DevTools integration, breakpoint management, complexity analysis, and live error streaming.
      17 npm
      1
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Provides specialized development tools and utilities for Next.js, allowing AI agents to perform runtime diagnostics and access official documentation. It enables automated context initialization and real-time interaction with Next.js development servers to query application state.
      4
      161,535 npm
      836
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables MCP-compatible clients to inspect Next.js codebases, analyze App Router and Pages Router structure, discover API routes, and audit build performance through controlled tools.
      7 npm
      MIT