<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: xyaz1313</title>
    <description>The latest articles on DEV Community by xyaz1313 (@xyaz1313).</description>
    <link>https://dev.to/xyaz1313</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3875976%2F1dda4ea6-a072-41bf-b259-0cabadf3f09c.png</url>
      <title>DEV Community: xyaz1313</title>
      <link>https://dev.to/xyaz1313</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/xyaz1313"/>
    <language>en</language>
    <item>
      <title>Using midnight-mcp for Contract Development with AI Assistants</title>
      <dc:creator>xyaz1313</dc:creator>
      <pubDate>Mon, 13 Apr 2026 07:01:56 +0000</pubDate>
      <link>https://dev.to/xyaz1313/using-midnight-mcp-for-contract-development-with-ai-assistants-g5b</link>
      <guid>https://dev.to/xyaz1313/using-midnight-mcp-for-contract-development-with-ai-assistants-g5b</guid>
      <description>&lt;h1&gt;
  
  
  Using midnight-mcp for Contract Development with AI Assistants
&lt;/h1&gt;

&lt;p&gt;I've been exploring how to make Midnight smart contract development faster, and stumbled upon midnight-mcp — a Model Context Protocol server that connects AI assistants directly to the Midnight blockchain. After setting it up with Claude Desktop, I found it genuinely useful for catching bugs early and understanding the Compact language faster. Here's how to get started.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is midnight-mcp?
&lt;/h2&gt;

&lt;p&gt;midnight-mcp is an MCP (Model Context Protocol) server that gives AI assistants like Claude, Cursor, and VS Code Copilot direct access to Midnight blockchain capabilities. It includes 29 tools covering:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Search&lt;/strong&gt; — Find Compact code, TypeScript patterns, and documentation&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Analysis&lt;/strong&gt; — Analyze contracts, explain circuits, compile code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Generation&lt;/strong&gt; — Generate, review, and document contracts&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Versioning&lt;/strong&gt; — Track breaking changes and migration guides&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The best part? No API keys needed. Just install and go.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Node.js 20+ (check with &lt;code&gt;node --version&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;One of: Claude Desktop, Cursor, VS Code with Copilot, or Windsurf&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Installation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Claude Desktop
&lt;/h3&gt;

&lt;p&gt;Add this to your &lt;code&gt;claude_desktop_config.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"midnight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"midnight-mcp@latest"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Config file locations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;macOS: &lt;code&gt;~/Library/Application Support/Claude/claude_desktop_config.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Windows: &lt;code&gt;%APPDATA%\Claude\claude_desktop_config.json&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Linux: &lt;code&gt;~/.config/Claude/claude_desktop_config.json&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Using nvm?&lt;/strong&gt; Claude Desktop might not see your nvm-managed Node. Use this config instead:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"midnight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"/bin/sh"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"-c"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="s2"&gt;"source ~/.nvm/nvm.sh &amp;amp;&amp;amp; nvm use 20 &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; npx -y midnight-mcp@latest"&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Cursor
&lt;/h3&gt;

&lt;p&gt;Add to &lt;code&gt;.cursor/mcp.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"midnight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"midnight-mcp@latest"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  VS Code Copilot
&lt;/h3&gt;

&lt;p&gt;Use Command Palette: &lt;code&gt;MCP: Add Server&lt;/code&gt; → "command (stdio)" → &lt;code&gt;npx -y midnight-mcp@latest&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Windsurf
&lt;/h3&gt;

&lt;p&gt;Add to &lt;code&gt;~/.codeium/windsurf/mcp_config.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"mcpServers"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"midnight"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"npx"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"args"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"-y"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"midnight-mcp@latest"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Restart your editor after adding the config.&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Use &lt;code&gt;@latest&lt;/code&gt; to get updates on each restart. If upgrading, clear your npx cache: &lt;code&gt;rm -rf ~/.npm/_npx&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Step 2: Verify Installation
&lt;/h2&gt;

&lt;p&gt;After restarting your editor, check if midnight-mcp is working:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Claude Desktop (or your chosen editor)&lt;/li&gt;
&lt;li&gt;Ask: "Check midnight-mcp status"&lt;/li&gt;
&lt;li&gt;You should see a response confirming the server is running&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;If it's not working, check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Node.js version is 20+&lt;/li&gt;
&lt;li&gt;Config file is in the correct location&lt;/li&gt;
&lt;li&gt;Editor was restarted after config changes&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 3: Exploring the Tools
&lt;/h2&gt;

&lt;p&gt;Here's what I found most useful during development:&lt;/p&gt;

&lt;h3&gt;
  
  
  Searching Documentation
&lt;/h3&gt;

&lt;p&gt;Instead of hunting through docs manually, just ask:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Search midnight docs for how to handle private state"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;midnight-search-docs&lt;/code&gt; tool finds relevant documentation sections and returns them with context.&lt;/p&gt;

&lt;h3&gt;
  
  
  Analyzing Contracts
&lt;/h3&gt;

&lt;p&gt;When you have a Compact contract, you can analyze it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Analyze this contract for security issues"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;midnight-analyze-contract&lt;/code&gt; tool checks for common patterns and potential issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Real Compilation
&lt;/h3&gt;

&lt;p&gt;This is the killer feature. The &lt;code&gt;midnight-compile-contract&lt;/code&gt; tool actually compiles your Compact code against the Midnight compilation endpoint:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Compile this contract and tell me if there are errors"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's not just syntax checking — it's real compilation that catches type errors, missing imports, and logic issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  Code Generation
&lt;/h3&gt;

&lt;p&gt;Need a starting point? Ask the AI to generate a contract:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Generate a simple token contract with transfer functionality"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;midnight-generate-contract&lt;/code&gt; tool creates boilerplate code you can build on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Real-World Usage
&lt;/h2&gt;

&lt;p&gt;Here's a development session I had with midnight-mcp:&lt;/p&gt;

&lt;h3&gt;
  
  
  Scenario: Building a Privacy-Preserving Allowlist
&lt;/h3&gt;

&lt;p&gt;I wanted to build a contract where an admin adds members to an allowlist, and members can prove membership without revealing their identity.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Ask for help&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"How do I build a Merkle tree-based allowlist in Compact?"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Claude used &lt;code&gt;midnight-search-docs&lt;/code&gt; and &lt;code&gt;midnight-search-compact&lt;/code&gt; to find relevant examples.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Generate starter code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Generate a basic allowlist contract with Merkle tree verification"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The AI generated a working contract skeleton using &lt;code&gt;midnight-generate-contract&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Review and fix&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Review this contract for security issues"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;midnight-review-contract&lt;/code&gt; caught a missing nullifier check that could allow replay attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Compile and test&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Compile this contract and fix any errors"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The real compilation endpoint found a type mismatch I would have missed.&lt;/p&gt;

&lt;h3&gt;
  
  
  What I Learned
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Start with questions, not code.&lt;/strong&gt; Let the AI search docs first — it finds patterns you might miss.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use the compound tools.&lt;/strong&gt; &lt;code&gt;midnight-upgrade-check&lt;/code&gt; and &lt;code&gt;midnight-get-repo-context&lt;/code&gt; save 50-70% of tokens by combining multiple operations.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Verify AI output.&lt;/strong&gt; Always compile generated code. The AI can make mistakes, but the compiler catches them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use versioning tools.&lt;/strong&gt; When Midnight updates, &lt;code&gt;midnight-check-breaking-changes&lt;/code&gt; tells you exactly what changed.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 5: Advanced Tips
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Tool Categories
&lt;/h3&gt;

&lt;p&gt;The 29 tools are organized into categories. You can explore them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"List all midnight-mcp tool categories"
"Show me tools in the Analysis category"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Token Efficiency
&lt;/h3&gt;

&lt;p&gt;The compound tools are designed to save tokens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;midnight-upgrade-check&lt;/code&gt;: Combines version check + breaking changes + migration guide&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-get-repo-context&lt;/code&gt;: Fetches relevant repo structure in one call&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Use these instead of multiple individual tool calls.&lt;/p&gt;

&lt;h3&gt;
  
  
  Custom Workflows
&lt;/h3&gt;

&lt;p&gt;You can chain tools for complex tasks:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"Search for Compact examples, then analyze the best one, then explain how to adapt it for my use case"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The AI will use multiple tools in sequence to give a comprehensive answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting
&lt;/h2&gt;

&lt;h3&gt;
  
  
  "Server not found" error
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Check Node.js version: &lt;code&gt;node --version&lt;/code&gt; (needs 20+)&lt;/li&gt;
&lt;li&gt;Verify config file location and syntax&lt;/li&gt;
&lt;li&gt;Restart your editor completely&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Tools not responding
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Check internet connection (tools fetch live data)&lt;/li&gt;
&lt;li&gt;Try &lt;code&gt;@latest&lt;/code&gt; to ensure you have the newest version&lt;/li&gt;
&lt;li&gt;Clear npx cache: &lt;code&gt;rm -rf ~/.npm/_npx&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Compilation errors
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Make sure your Compact code syntax is valid&lt;/li&gt;
&lt;li&gt;Check Midnight docs for current syntax (it's evolving)&lt;/li&gt;
&lt;li&gt;Use &lt;code&gt;midnight-get-latest-syntax&lt;/code&gt; to check for updates&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;npm:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/midnight-mcp" rel="noopener noreferrer"&gt;npmjs.com/package/midnight-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Olanetsoft/midnight-mcp" rel="noopener noreferrer"&gt;github.com/Olanetsoft/midnight-mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Midnight Docs:&lt;/strong&gt; &lt;a href="https://docs.midnight.network" rel="noopener noreferrer"&gt;docs.midnight.network&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Discord:&lt;/strong&gt; &lt;a href="https://discord.com/invite/midnightnetwork" rel="noopener noreferrer"&gt;discord.com/invite/midnightnetwork&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;em&gt;This tutorial was written for the Midnight Contributor Hub bounty program. #MidnightforDevs&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Found this helpful? Star the &lt;a href="https://github.com/Olanetsoft/midnight-mcp" rel="noopener noreferrer"&gt;midnight-mcp repo&lt;/a&gt; and join the Midnight Discord to connect with other developers.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Deep Dive: How the Tools Work
&lt;/h2&gt;

&lt;p&gt;Understanding what's happening under the hood helps you use the tools more effectively.&lt;/p&gt;

&lt;h3&gt;
  
  
  Search Tools
&lt;/h3&gt;

&lt;p&gt;The search tools use semantic search, not just keyword matching. When you ask "how to handle private state", it understands concepts like "confidentiality", "ZK proofs", and "shielded transactions".&lt;/p&gt;

&lt;p&gt;Available search tools:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;midnight-search-compact&lt;/code&gt;: Search Compact language examples&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-search-typescript&lt;/code&gt;: Search TypeScript witness implementations&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-search-docs&lt;/code&gt;: Search official documentation&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-fetch-docs&lt;/code&gt;: Fetch specific documentation pages&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Analysis Tools
&lt;/h3&gt;

&lt;p&gt;The analysis tools combine static analysis with the Midnight compiler:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;midnight-analyze-contract&lt;/code&gt;: Checks for common security patterns&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-explain-circuit&lt;/code&gt;: Breaks down ZK circuit structure&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-extract-contract-structure&lt;/code&gt;: Shows contract interface&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-compile-contract&lt;/code&gt;: Real compilation against Midnight endpoint&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Versioning Tools
&lt;/h3&gt;

&lt;p&gt;Midnight is actively evolving. These tools help you stay current:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;midnight-get-version-info&lt;/code&gt;: Check current SDK version&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-check-breaking-changes&lt;/code&gt;: Find what changed between versions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-get-migration-guide&lt;/code&gt;: Get upgrade instructions&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-compare-syntax&lt;/code&gt;: Compare old vs new syntax&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  AI Generation Tools
&lt;/h3&gt;

&lt;p&gt;These require sampling mode to be enabled:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;midnight-generate-contract&lt;/code&gt;: Generate contract code&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-review-contract&lt;/code&gt;: Review for security issues&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;midnight-document-contract&lt;/code&gt;: Generate documentation&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting Up a Development Environment
&lt;/h2&gt;

&lt;p&gt;For the best experience, I recommend this setup:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Create a project structure
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;my-midnight-project/
├── contracts/          # Compact contracts
├── witnesses/          # TypeScript witnesses
├── tests/              # Test files
└── .cursor/            # Cursor config
    └── mcp.json        # midnight-mcp config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. Initialize with hello world
&lt;/h3&gt;

&lt;p&gt;Start with the official hello world example from Midnight docs, then iterate using midnight-mcp tools.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Use the AI as a pair programmer
&lt;/h3&gt;

&lt;p&gt;Don't just ask for code. Ask questions like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"What's the best pattern for handling X in Compact?"&lt;/li&gt;
&lt;li&gt;"Review my approach before I implement it"&lt;/li&gt;
&lt;li&gt;"What are the security considerations for this design?"&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This leads to better code than just generating and fixing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Patterns I've Discovered
&lt;/h2&gt;

&lt;p&gt;Using midnight-mcp regularly, I've found these patterns work well:&lt;/p&gt;

&lt;h3&gt;
  
  
  Pattern 1: Question → Search → Generate → Compile
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Ask a conceptual question&lt;/li&gt;
&lt;li&gt;Let AI search docs for examples&lt;/li&gt;
&lt;li&gt;Generate code based on findings&lt;/li&gt;
&lt;li&gt;Compile to verify&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Pattern 2: Write → Review → Fix
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Write your contract manually&lt;/li&gt;
&lt;li&gt;Ask AI to review for issues&lt;/li&gt;
&lt;li&gt;Fix based on feedback&lt;/li&gt;
&lt;li&gt;Compile to verify&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Pattern 3: Migrate → Compare → Update
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Check for breaking changes&lt;/li&gt;
&lt;li&gt;Compare old vs new syntax&lt;/li&gt;
&lt;li&gt;Update code accordingly&lt;/li&gt;
&lt;li&gt;Compile to verify&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Performance Notes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;First run is slow.&lt;/strong&gt; The first compilation downloads ~30MB of ZK parameters. Subsequent runs are faster.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use compound tools.&lt;/strong&gt; They save 50-70% tokens compared to individual tool calls.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cache is your friend.&lt;/strong&gt; Once you've searched for something, the AI remembers the context.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;midnight-mcp made Midnight development significantly more accessible for me. The ability to ask natural language questions and get accurate, contextual answers about Compact syntax and patterns is invaluable.&lt;/p&gt;

&lt;p&gt;The real compilation feature alone is worth the setup — catching errors before deployment saves hours of debugging.&lt;/p&gt;

&lt;p&gt;If you're building on Midnight, give it a try. Start with Claude Desktop since it has the best MCP support, then expand to your preferred editor.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Last updated: April 13, 2026&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>blockchain</category>
      <category>mcp</category>
      <category>tooling</category>
    </item>
    <item>
      <title>Getting NIGHT Tokens: Exchanges, Bridging &amp; Wallet Funding on Mainnet</title>
      <dc:creator>xyaz1313</dc:creator>
      <pubDate>Mon, 13 Apr 2026 06:17:58 +0000</pubDate>
      <link>https://dev.to/xyaz1313/getting-night-tokens-exchanges-bridging-wallet-funding-on-mainnet-5h84</link>
      <guid>https://dev.to/xyaz1313/getting-night-tokens-exchanges-bridging-wallet-funding-on-mainnet-5h84</guid>
      <description>&lt;h1&gt;
  
  
  Getting NIGHT Tokens: Exchanges, Bridging &amp;amp; Wallet Funding on Mainnet
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;A practical guide to acquiring NIGHT tokens and getting your wallet ready for the Midnight ecosystem.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Midnight is a privacy-focused blockchain platform built on Cardano, designed for developers who want to build decentralized applications (DApps) with programmable confidentiality controls. To interact with the Midnight network — whether you are deploying smart contracts, testing DApps, or simply participating in the ecosystem — you will need NIGHT tokens.&lt;/p&gt;

&lt;p&gt;This tutorial walks you through every step of acquiring NIGHT tokens, from choosing the right exchange to setting up a compatible wallet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A basic understanding of cryptocurrency wallets and exchanges&lt;/li&gt;
&lt;li&gt;A device with internet access&lt;/li&gt;
&lt;li&gt;An email address for exchange registration&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1: Choose an Exchange That Lists NIGHT
&lt;/h2&gt;

&lt;p&gt;As of April 2026, NIGHT tokens are available on major exchanges:&lt;/p&gt;

&lt;h3&gt;
  
  
  Binance (Recommended)
&lt;/h3&gt;

&lt;p&gt;NIGHT was listed on Binance on March 11, 2026, with pairs NIGHT/USDT and NIGHT/USDC.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an account at &lt;a href="https://www.binance.com" rel="noopener noreferrer"&gt;Binance&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Complete KYC verification&lt;/li&gt;
&lt;li&gt;Deposit USDT or USDC&lt;/li&gt;
&lt;li&gt;Search for NIGHT trading pair&lt;/li&gt;
&lt;li&gt;Place your order&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Bitget
&lt;/h3&gt;

&lt;p&gt;Bitget listed NIGHT in April 2026.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Register at &lt;a href="https://www.bitget.com" rel="noopener noreferrer"&gt;Bitget&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Complete verification&lt;/li&gt;
&lt;li&gt;Fund your account&lt;/li&gt;
&lt;li&gt;Trade NIGHT/USDT&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Gate.io
&lt;/h3&gt;

&lt;p&gt;Gate.io also supports NIGHT trading.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pro tip:&lt;/strong&gt; Check official Midnight channels for the latest listings.&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>blockchain</category>
      <category>cryptocurrency</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
