MCP server that gives AI assistants access to Midnight blockchain—search contracts, analyze code, and explore documentation.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"midnight": {
"command": "npx",
"args": ["-y", "midnight-mcp"]
}
}
}📍 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
Add to Cursor's MCP settings (Settings → MCP → Add Server):
{
"mcpServers": {
"midnight": {
"command": "npx",
"args": ["-y", "midnight-mcp"]
}
}
}Or add to .cursor/mcp.json in your project:
{
"mcpServers": {
"midnight": {
"command": "npx",
"args": ["-y", "midnight-mcp"]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"midnight": {
"command": "npx",
"args": ["-y", "midnight-mcp"]
}
}
}Restart your editor after adding the config. All features work out of the box—no API keys or setup required.
By default, the MCP uses a hosted API for semantic search:
- ✅ Zero configuration — just install and use
- ✅ Semantic search works immediately
- ✅ No API keys needed
Run everything locally for privacy or offline use:
{
"mcpServers": {
"midnight": {
"command": "npx",
"args": ["-y", "midnight-mcp"],
"env": {
"MIDNIGHT_LOCAL": "true",
"OPENAI_API_KEY": "sk-...",
"CHROMA_URL": "http://localhost:8000"
}
}
}
}Local mode requires ChromaDB (docker run -d -p 8000:8000 chromadb/chroma) and an OpenAI API key.
Add "GITHUB_TOKEN": "ghp_..." for higher GitHub API rate limits (60 → 5000 requests/hour).
| Tool | Description |
|---|---|
midnight-search-compact |
Search Compact contract code |
midnight-search-typescript |
Search TypeScript SDK |
midnight-search-docs |
Search documentation |
midnight-analyze-contract |
Analyze contract structure and security |
midnight-explain-circuit |
Explain circuits in plain language |
midnight-get-file |
Get files from Midnight repos |
midnight-list-examples |
List example contracts |
midnight-get-latest-updates |
Recent repo changes |
midnight-get-version-info |
Get version and release info |
midnight-check-breaking-changes |
Check for breaking changes |
midnight-get-migration-guide |
Migration guides between versions |
midnight-get-file-at-version |
Get file at specific version |
midnight-compare-syntax |
Compare files between versions |
midnight-get-latest-syntax |
Latest syntax reference |
midnight-health-check |
Check server health status |
midnight-get-status |
Get rate limits and cache stats |
midnight://docs/*— Documentation (Compact reference, SDK API, ZK concepts)midnight://code/*— Examples, patterns, and templatesmidnight://schema/*— AST, transaction, and proof schemas
midnight:create-contract— Create new contractsmidnight:review-contract— Security reviewmidnight:explain-concept— Learn Midnight conceptsmidnight:compare-approaches— Compare implementation approachesmidnight:debug-contract— Debug issues
For contributors:
git clone https://github.com/Olanetsoft/midnight-mcp.git
cd midnight-mcp
npm install
npm run build
npm testTo test against a local API server instead of production:
# Terminal 1: Start local API
cd api
npm install
npm run dev # Starts at http://localhost:8787
# Terminal 2: Run MCP with local API
MIDNIGHT_API_URL=http://localhost:8787 npm startThe hosted API runs on Cloudflare Workers + Vectorize. See api/README.md for deployment and development instructions.
MIT