{"id":47301309,"url":"https://github.com/Olanetsoft/midnight-mcp","last_synced_at":"2026-03-31T07:00:43.037Z","repository":{"id":329474003,"uuid":"1119089192","full_name":"Olanetsoft/midnight-mcp","owner":"Olanetsoft","description":"Midnight MCP server giving AI assistants access to Midnight blockchain — search contracts, analyze code, explore docs","archived":false,"fork":false,"pushed_at":"2026-03-26T10:38:05.000Z","size":685,"stargazers_count":24,"open_issues_count":8,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-27T03:54:56.701Z","etag":null,"topics":["ai","ai-agent","artificial-intelligence","blockchain","claude","compact","cursor","javascript","mcp","mcp-server","midnightntwrk","smart-contracts","typescript","zero-knowledge","zk"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/midnight-mcp","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Olanetsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-18T18:15:03.000Z","updated_at":"2026-03-26T10:38:09.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Olanetsoft/midnight-mcp","commit_stats":null,"previous_names":["olanetsoft/midnight-mcp"],"tags_count":52,"template":false,"template_full_name":null,"purl":"pkg:github/Olanetsoft/midnight-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Fmidnight-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Fmidnight-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Fmidnight-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Fmidnight-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Olanetsoft","download_url":"https://codeload.github.com/Olanetsoft/midnight-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Olanetsoft%2Fmidnight-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31224248,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-31T04:08:55.938Z","status":"ssl_error","status_checked_at":"2026-03-31T04:08:47.883Z","response_time":111,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","ai-agent","artificial-intelligence","blockchain","claude","compact","cursor","javascript","mcp","mcp-server","midnightntwrk","smart-contracts","typescript","zero-knowledge","zk"],"created_at":"2026-03-17T03:00:22.710Z","updated_at":"2026-03-31T07:00:43.023Z","avatar_url":"https://github.com/Olanetsoft.png","language":"TypeScript","funding_links":[],"categories":["Developer Tools"],"sub_categories":[],"readme":"# Midnight MCP Server\n\n[![npm version](https://badge.fury.io/js/midnight-mcp.svg)](https://www.npmjs.com/package/midnight-mcp)\n[![npm downloads](https://img.shields.io/npm/dm/midnight-mcp)](https://npm-stat.com/charts.html?package=midnight-mcp)\n[![License](https://img.shields.io/npm/l/midnight-mcp)](./LICENSE)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.3-blue?logo=typescript)](https://www.typescriptlang.org/)\n[![CI](https://github.com/Olanetsoft/midnight-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/Olanetsoft/midnight-mcp/actions/workflows/ci.yml)\n\nMCP server that gives AI assistants access to Midnight blockchain—search contracts, analyze code, and explore documentation.\n\nThis project extends the Midnight Network with additional developer tooling.\n\n## Requirements\n\n- **Node.js 20+** (LTS recommended)\n\nCheck your version: `node --version`\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cstrong\u003eUsing nvm?\u003c/strong\u003e Click for Claude Desktop setup\u003c/summary\u003e\n\nIf you use nvm, Claude Desktop may not see your nvm-managed Node. Use this config instead:\n\n```json\n{\n  \"mcpServers\": {\n    \"midnight\": {\n      \"command\": \"/bin/sh\",\n      \"args\": [\n        \"-c\",\n        \"source ~/.nvm/nvm.sh \u0026\u0026 nvm use 20 \u003e/dev/null 2\u003e\u00261 \u0026\u0026 npx -y midnight-mcp@latest\"\n      ]\n    }\n  }\n}\n```\n\n\u003c/details\u003e\n\n## Quick Start\n\n### Claude Desktop\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"midnight\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"midnight-mcp@latest\"]\n    }\n  }\n}\n```\n\n**Config file locations:**\n\n- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`\n- Windows: `%APPDATA%\\Claude\\claude_desktop_config.json`\n- Linux: `~/.config/Claude/claude_desktop_config.json`\n\n### Cursor\n\nOne-click install:\n\n[![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=midnight\u0026config=eyJjb21tYW5kIjoibnB4IC15IG1pZG5pZ2h0LW1jcEBsYXRlc3QifQ==)\n\nOr manually add to `.cursor/mcp.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"midnight\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"midnight-mcp@latest\"]\n    }\n  }\n}\n```\n\n### VS Code Copilot\n\nAdd to `.vscode/mcp.json` or use Command Palette: `MCP: Add Server` → \"command (stdio)\" → `npx -y midnight-mcp@latest`\n\n### Windsurf\n\nAdd to `~/.codeium/windsurf/mcp_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"midnight\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"midnight-mcp@latest\"]\n    }\n  }\n}\n```\n\n**No API keys required.** Restart your editor after adding the config.\n\n\u003e **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`\n\n---\n\n## What's Included\n\n### 29 Tools\n\n| Category          | Tools                                                                                                                             | Description                                      |\n| ----------------- | --------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |\n| **Search**        | `search-compact`, `search-typescript`, `search-docs`, `fetch-docs`                                                                | Semantic search + live docs fetching             |\n| **Analysis**      | `analyze-contract`, `explain-circuit`, `extract-contract-structure`, `compile-contract`                                           | Static analysis + real compilation               |\n| **Repository**    | `get-file`, `list-examples`, `get-latest-updates`                                                                                 | Access files and examples                        |\n| **Versioning**    | `get-version-info`, `check-breaking-changes`, `get-migration-guide`, `get-file-at-version`, `compare-syntax`, `get-latest-syntax` | Version tracking and migration                   |\n| **AI Generation** | `generate-contract`, `review-contract`, `document-contract`                                                                       | AI-powered code generation _(requires sampling)_ |\n| **Compound**      | `upgrade-check`, `get-repo-context`                                                                                               | Multi-step operations _(saves 50-70% tokens)_    |\n| **Health**        | `health-check`, `get-status`, `check-version`                                                                                     | Server status and version checking               |\n| **Discovery**     | `list-tool-categories`, `list-category-tools`, `suggest-tool`                                                                     | Explore available tools and get recommendations  |\n\nAll tools are prefixed with `midnight-` (e.g., `midnight-search-compact`).\n\n### Real Contract Compilation\n\nThe `midnight-compile-contract` tool validates Compact code using a hosted compiler service:\n\n```\n✅ Compilation successful (Compiler v0.29.0) in 2841ms\n```\n\n- **Fast mode** (`skipZk=true`): Syntax validation in ~1-2 seconds\n- **Full mode** (`fullCompile=true`): Complete ZK circuit generation in ~10-30 seconds\n- **Automatic fallback**: Falls back to static analysis if the compiler service is unavailable\n\nThis catches semantic errors that static analysis misses (sealed fields, disclose rules, type mismatches).\n\n### MCP Capabilities\n\n| Capability      | Feature                                         |\n| --------------- | ----------------------------------------------- |\n| **Tools**       | 29 tools with `listChanged` notifications       |\n| **Resources**   | 9 embedded resources with subscription support  |\n| **Prompts**     | 5 workflow prompts                              |\n| **Logging**     | Client-controllable log level                   |\n| **Completions** | Autocomplete for prompt arguments               |\n| **Progress**    | Real-time progress for compound tools           |\n| **Sampling**    | AI-powered generation (when client supports it) |\n\n### 9 Embedded Resources\n\nQuick references available offline:\n\n- Compact syntax guide (v0.16-0.21)\n- SDK API reference\n- OpenZeppelin contracts\n- Tokenomics overview\n- Wallet integration\n- Common errors \u0026 solutions\n\n### Static Analysis\n\n`extract-contract-structure` catches common mistakes before compilation:\n\n| Check                     | Severity | Description                                             |\n| ------------------------- | -------- | ------------------------------------------------------- |\n| `deprecated_ledger_block` | P0       | Catches `ledger { }` → use `export ledger field: Type;` |\n| `invalid_void_type`       | P0       | Catches `Void` → use `[]` (empty tuple)                 |\n| `invalid_pragma_format`   | P0       | Catches old pragma → use `\u003e= 0.16 \u0026\u0026 \u003c= 0.21`           |\n| `unexported_enum`         | P1       | Enums need `export` for TypeScript access               |\n| `module_level_const`      | P0       | Use `pure circuit` instead                              |\n| + 10 more checks          | P1-P2    | Overflow, division, assertions, etc.                    |\n\n### 5 Prompts\n\n- `create-contract` — Generate new contracts\n- `review-contract` — Security and code review\n- `explain-concept` — Learn Midnight concepts\n- `compare-approaches` — Compare implementation patterns\n- `debug-contract` — Troubleshoot issues\n\n---\n\n## Indexed Repositories\n\nThe API indexes **102+ Midnight repositories** from the entire Midnight ecosystem:\n\n| Category                 | Count | Key Repositories                                                                 |\n| ------------------------ | ----- | -------------------------------------------------------------------------------- |\n| **Compact Language**     | 6     | `compact`, `compact-lsp`, `compact-tree-sitter`, `compact-zed`                   |\n| **SDKs \u0026 APIs**          | 5     | `midnight-js`, `midnight-sdk`, `midnight-wallet`, `midnight-dapp-connector`      |\n| **Core Infrastructure**  | 9     | `midnight-node`, `midnight-indexer`, `midnight-ledger`, `midnight-zk`            |\n| **ZK \u0026 Cryptography**    | 6     | `midnight-trusted-setup`, `fri`, `galois_recursion`, `pluto_eris`                |\n| **Documentation**        | 5     | `midnight-docs`, `midnight-improvement-proposals`, `midnight-architecture`       |\n| **Examples \u0026 Templates** | 8     | `example-counter`, `example-bboard`, `example-dex`, `example-DAO`                |\n| **Identity**             | 5     | `midnight-did`, `midnight-did-resolver`, `midnight-verifiable-credentials`       |\n| **Developer Tools**      | 4     | `setup-compact-action`, `upload-sarif-github-action`, `midnight-dev-utils`       |\n| **Solutions \u0026 Apps**     | 7     | `midnight-solutions`, `midnight-website-next`, `nightcap`, `ocp`                 |\n| **Glacier Drop**         | 15    | `midnight-glacier-drop-tools`, `gd-claim-api`, `gd-claim-portal`                 |\n| **Partners**             | 14    | OpenZeppelin, BrickTowers, MeshJS, PaimaStudios, hackathon winners               |\n| **Other**                | 18+   | Contracts, bridges, token distribution, monitoring, QA tools, community projects |\n\nAll **non-archived** repositories from the `midnightntwrk` organization plus community partners. See [api/README.md](api/README.md#indexed-repositories-102) for the complete list.\n\n---\n\n## Advanced Configuration\n\n### HTTP Mode\n\nRun as an HTTP server for web integrations or remote deployment:\n\n```bash\n# Start HTTP server on port 3000\nnpx midnight-mcp --http --port 3000\n```\n\nEndpoints:\n\n- `/health` - Health check\n- `/mcp` - Streamable HTTP (MCP protocol)\n- `/sse` - Server-Sent Events\n\n### CLI Options\n\n```bash\nnpx midnight-mcp --help\n\nOptions:\n  --stdio          Use stdio transport (default, for Claude Desktop)\n  --http           Use HTTP transport with SSE support\n  --port \u003cnumber\u003e  HTTP port (default: 3000)\n  --json           Output in JSON (default: YAML for better LLM efficiency)\n  --github-token   GitHub token (overrides GITHUB_TOKEN env var)\n  -h, --help       Show help\n  -v, --version    Show version\n```\n\n\u003e **Why YAML by default?** YAML is ~20-30% more token-efficient than JSON, which means AI assistants can process more context from tool responses.\n\n### Local Mode\n\nRun everything locally for privacy or offline use:\n\n```json\n{\n  \"mcpServers\": {\n    \"midnight\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"midnight-mcp@latest\"],\n      \"env\": {\n        \"MIDNIGHT_LOCAL\": \"true\",\n        \"OPENAI_API_KEY\": \"sk-...\",\n        \"CHROMA_URL\": \"http://localhost:8000\"\n      }\n    }\n  }\n}\n```\n\nRequires ChromaDB (`docker run -d -p 8000:8000 chromadb/chroma`) and OpenAI API key.\n\n### GitHub Token\n\nAdd `\"GITHUB_TOKEN\": \"ghp_...\"` for higher GitHub API rate limits (60 → 5000 requests/hour).\n\n---\n\n## Developer Setup\n\n```bash\ngit clone https://github.com/Olanetsoft/midnight-mcp.git \u0026\u0026 cd midnight-mcp\nnpm install \u0026\u0026 npm run build \u0026\u0026 npm test\n\n# Lint \u0026 format\nnpm run lint          # ESLint (typescript-eslint)\nnpm run lint:fix      # Auto-fix lint issues\nnpm run format        # Prettier\n```\n\nThe hosted API runs on Cloudflare Workers + Vectorize. See [api/README.md](./api/README.md) for backend details.\n\n---\n\n## Links\n\n- [Midnight Docs](https://docs.midnight.network)\n- [MCP Spec](https://modelcontextprotocol.io)\n- [Midnight GitHub](https://github.com/midnightntwrk)\n\n## License\n\nMIT\n\n## Stargazers ⭐️\n\n[![Star History Chart](https://api.star-history.com/svg?repos=Olanetsoft/midnight-mcp\u0026type=Date)](https://star-history.com/#Olanetsoft/midnight-mcp\u0026Date)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOlanetsoft%2Fmidnight-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOlanetsoft%2Fmidnight-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOlanetsoft%2Fmidnight-mcp/lists"}