Midnight + Next.js MCP

io.github.FractionEstate由 GitHub 帳號 FractionEstate 發布v0.3.1更新於 Oct 25, 2026

Unified MCP server for Midnight blockchain development and Next.js dApps.

已驗證STDIO僅桌面瀏覽器自動化開發者工具

概覽

AI 產生的概覽

本機 MCP 伺服器,為 AI 助理提供 Midnight 區塊鏈合約、錢包與網路工具,以及用來開發 dApp 的 Next.js DevTools。

可以做什麼
初始化 Midnight 開發環境、產生 dApp 專案範本、將 Compact 合約編譯為 TypeScript 與 ZK 產物、執行靜態分析、部署合約並呼叫已部署合約的電路。建立錢包、讀取錢包狀態與餘額、轉帳 tDUST 代幣。檢查 Indexer、Proof Server 與 Node 的網路健康狀態,查詢區塊與交易,檢查 Midnight 套件版本。搜尋、取得、同步並列出 Midnight 文件。使用 Next.js 工具:初始化開發環境、搜尋 Next.js 文件、探索執行中的開發伺服器、執行執行期診斷、以 Playwright 評估頁面,並參考 Next.js 16 與 Cache Components 升級指南。
適用情境
適合在 Midnight 網路上搭配 Next.js 前端開發去中心化應用時使用,讓助理在同一個伺服器內完成合約編譯、分析、部署與呼叫,管理測試錢包,檢視鏈上狀態,並查閱 Midnight 與 Next.js 文件。
執行需求
透過 stdio 在本機執行,通常以 npx 搭配 Node.js,也可全域安裝 npm 套件或使用 Docker 容器。選用 GITHUB_TOKEN 可提高 API 速率限制;LOG_LEVEL 設定日誌詳細程度;MIDNIGHT_LOCAL 啟用搭配 ChromaDB 的本機模式以進行離線語意搜尋。網路端點預設指向 Midnight 測試網,可用環境變數覆寫。鏈上查詢與文件同步需要網路存取。
安裝前請注意
此伺服器可部署合約、執行電路呼叫並轉帳 tDUST 代幣,會轉移資金並改變鏈上狀態。建立錢包會產生助記詞,任何助記詞或金鑰材料都應視為敏感資訊。GITHUB_TOKEN 是密鑰,應盡量縮小權限範圍。合約與文件操作會存取 Midnight 網路服務與 GitHub。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Midnight + Next.js MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

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 AssistantPlatformConfiguration
ClaudeDesktop App, VS CodeNative MCP support
GitHub CopilotVS Code, JetBrainsMCP extension
CursorIDEBuilt-in MCP support
WindsurfIDEBuilt-in MCP support
CodeiumVS Code, JetBrainsMCP integration
Continue.devVS Code, JetBrainsMCP config file
ZedIDEMCP support
Sourcegraph CodyVS CodeMCP extension

🌙 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

bash
# Clone the repositorygit clone https://github.com/your-username/midnight-nextjs-mcp.gitcd midnight-nextjs-mcp
# Install dependenciespnpm install
# Buildpnpm build

🚀 Usage

Quick Start with npx

The easiest way to use this MCP server is via npx — no installation required:

json
{  "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:

json
{  "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:

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

Or for Claude extension specifically:

json
{  "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:

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:

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:

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):

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

Add to your Windsurf MCP settings:

json
{  "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:

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):

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

Sourcegraph Cody

Add to your Cody MCP configuration:

json
{  "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:

json
{  "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:

bash
npm install -g midnight-nextjs-mcp

Then configure:

json
{  "mcpServers": {    "midnight-nextjs-mcp": {      "type": "stdio",      "command": "midnight-nextjs-mcp"    }  }}
Local Development / From Source
json
{  "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:

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

CLI Flags

bash
# 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 startupnpx 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:

json
{  "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
bash
# Midnight Network (optional, defaults to testnet)MIDNIGHT_NETWORK=testnetMIDNIGHT_INDEXER_URL=https://indexer.testnet.midnight.network/graphqlMIDNIGHT_PROOF_SERVER_URL=https://proof-server.testnet.midnight.networkMIDNIGHT_NODE_URL=https://rpc.testnet.midnight.network

Network Configurations

NetworkIndexerProof Server
Testnetindexer.testnet.midnight.networkproof-server.testnet.midnight.network
Devnetlocalhost:8080localhost: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

bash
# Watch modepnpm dev
# Type checkpnpm typecheck
# Run testspnpm test
# Buildpnpm 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.

來源:README.md,提交 4a88d65

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.3.1最新Sep 16, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。