midnight-mcp 0.1.22 → 0.1.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -377,7 +377,11 @@ const explainCircuitOutputSchema = {
377
377
  export const analyzeTools = [
378
378
  {
379
379
  name: "midnight-analyze-contract",
380
- description: "Analyze a Compact smart contract for structure, patterns, and potential security issues. Returns detailed breakdown of circuits, witnesses, ledger state, and recommendations.",
380
+ description: "⚠️ STATIC ANALYSIS ONLY - Analyze contract structure and patterns. " +
381
+ "🚫 THIS DOES NOT COMPILE THE CONTRACT. Cannot catch: sealed field rules, disclose() requirements, semantic errors. " +
382
+ "👉 ALWAYS call 'midnight-validate-contract' FIRST to verify the code actually compiles. " +
383
+ "Use this for: understanding structure, security pattern analysis, recommendations. " +
384
+ "NEVER claim a contract 'works' or 'compiles' based on this tool alone.",
381
385
  inputSchema: {
382
386
  type: "object",
383
387
  properties: {
@@ -358,7 +358,13 @@ export const repositoryTools = [
358
358
  // ============================================================================
359
359
  {
360
360
  name: "midnight-validate-contract",
361
- description: "🔍 PRIMARY VERIFICATION: Compile and validate a Compact contract using the ACTUAL Compact compiler. **ALWAYS use this tool first** when verifying contract code - it catches real compilation errors that static analysis cannot detect. Returns detailed error messages with line numbers, suggested fixes, and actionable guidance. If the compiler is not installed, it will provide installation instructions. Accepts either source code directly OR a file path to a .compact file. For contracts you generate, ALWAYS validate with this tool before presenting to the user.",
361
+ description: " REQUIRED - ALWAYS CALL THIS FIRST: Compile a Compact contract using the REAL compiler. " +
362
+ "⚠️ CRITICAL: You MUST call this tool BEFORE telling the user a contract works or is correct. " +
363
+ "Static analysis tools like 'extract-contract-structure' or 'analyze-contract' CANNOT verify compilation - they miss semantic errors like: " +
364
+ "(1) sealed fields require constructor, (2) constructor params need disclose(), (3) export circuits cannot modify sealed fields. " +
365
+ "This tool runs the ACTUAL Compact compiler and returns real errors with line numbers. " +
366
+ "If compiler not installed, it provides installation instructions. " +
367
+ "WORKFLOW: Generate code → Call this tool → Fix errors → Repeat until success → THEN present to user.",
362
368
  inputSchema: {
363
369
  type: "object",
364
370
  properties: {
@@ -454,7 +460,12 @@ export const repositoryTools = [
454
460
  },
455
461
  {
456
462
  name: "midnight-extract-contract-structure",
457
- description: "📋 STATIC ANALYSIS (not verification): Extract the structure of a Compact contract and detect common issues. Returns circuits, witnesses, ledger items, types, structs, enums, and **potentialIssues** (module-level const, stdlib collisions, sealed+export conflicts). **WARNING: This does NOT verify compilation** - use 'midnight-validate-contract' for actual compiler verification. Use this tool for: (1) understanding contract structure, (2) quick pre-checks before compilation, (3) fallback analysis when compiler unavailable. Do NOT claim a contract 'compiles correctly' based only on this tool.",
463
+ description: "⚠️ STATIC ANALYSIS ONLY - NOT A COMPILER: Extracts contract structure (circuits, witnesses, ledger) and detects common patterns. " +
464
+ "🚫 THIS TOOL CANNOT VERIFY COMPILATION. It will NOT catch: sealed field rules, disclose() requirements, type mismatches, or semantic errors. " +
465
+ "✅ USE FOR: Understanding structure, quick pattern checks, fallback when compiler unavailable. " +
466
+ "❌ NEVER USE TO: Verify a contract works, claim code 'compiles correctly', or validate before presenting to user. " +
467
+ "👉 ALWAYS call 'midnight-validate-contract' FIRST to actually compile the code. " +
468
+ "Detects: module-level const, stdlib collisions, sealed+export conflicts, missing disclose(), Counter.value access, division operator.",
458
469
  inputSchema: {
459
470
  type: "object",
460
471
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "midnight-mcp",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "Model Context Protocol Server for Midnight Blockchain Development",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",