midnight-mcp 0.1.23 โ†’ 0.1.24

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.
package/README.md CHANGED
@@ -15,11 +15,13 @@ MCP server that gives AI assistants access to Midnight blockchainโ€”search contr
15
15
  ```json
16
16
  {
17
17
  "mcpServers": {
18
- "midnight": { "command": "npx", "args": ["-y", "midnight-mcp"] }
18
+ "midnight": { "command": "npx", "args": ["-y", "midnight-mcp@latest"] }
19
19
  }
20
20
  }
21
21
  ```
22
22
 
23
+ > **๐Ÿ’ก Tip:** Using `@latest` ensures you always get the newest version with all features. If tools seem missing, run `rm -rf ~/.npm/_npx` and restart Claude Desktop.
24
+
23
25
  **Cursor** โ€” One-click install:
24
26
 
25
27
  [![Install MCP Server](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=midnight&config=eyJjb21tYW5kIjoibnB4IC15IG1pZG5pZ2h0LW1jcCJ9)
@@ -73,19 +75,23 @@ Restart your editor after adding the config. **No API keys required.**
73
75
 
74
76
  ## Features
75
77
 
76
- **23 Tools** โ€” Search, analyze, version tracking, AI generation, compound operations
77
-
78
- | Category | Tools |
79
- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
80
- | Search | `midnight-search-compact`, `midnight-search-typescript`, `midnight-search-docs` |
81
- | Analysis | `midnight-analyze-contract`, `midnight-explain-circuit` |
82
- | Repository | `midnight-get-file`, `midnight-list-examples`, `midnight-get-latest-updates` |
83
- | Versioning | `midnight-get-version-info`, `midnight-check-breaking-changes`, `midnight-get-migration-guide`, `midnight-get-file-at-version`, `midnight-compare-syntax`, `midnight-get-latest-syntax` |
84
- | AI Generation | `midnight-generate-contract`, `midnight-review-contract`, `midnight-document-contract` _(requires sampling)_ |
85
- | Compound | `midnight-upgrade-check`, `midnight-get-repo-context` _(saves 50-70% tokens)_ |
86
- | Discovery | `midnight-list-tool-categories`, `midnight-list-category-tools`, `midnight-health-check`, `midnight-get-status` |
87
-
88
- > **Tip:** Use compound tools (`midnight-upgrade-check`, `midnight-get-repo-context`) for efficient multi-step operations in a single call.
78
+ **24 Tools** โ€” Search, analyze, validate, version tracking, AI generation, compound operations
79
+
80
+ | Category | Tools |
81
+ | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
82
+ | Search | `midnight-search-compact`, `midnight-search-typescript`, `midnight-search-docs` |
83
+ | Analysis | `midnight-analyze-contract`, `midnight-explain-circuit` |
84
+ | **Validation** | `midnight-validate-contract` โญ, `midnight-extract-contract-structure` |
85
+ | Repository | `midnight-get-file`, `midnight-list-examples`, `midnight-get-latest-updates` |
86
+ | Versioning | `midnight-get-version-info`, `midnight-check-breaking-changes`, `midnight-get-migration-guide`, `midnight-get-file-at-version`, `midnight-compare-syntax`, `midnight-get-latest-syntax` |
87
+ | AI Generation | `midnight-generate-contract`, `midnight-review-contract`, `midnight-document-contract` _(requires sampling)_ |
88
+ | Compound | `midnight-upgrade-check`, `midnight-get-repo-context` _(saves 50-70% tokens)_ |
89
+ | Health | `midnight-health-check`, `midnight-get-status`, `midnight-check-version` ๐Ÿ”„ |
90
+ | Discovery | `midnight-list-tool-categories`, `midnight-list-category-tools` |
91
+
92
+ > **โญ Key Tool:** `midnight-validate-contract` compiles code using the **real Compact compiler** - essential for verifying contracts actually work before deployment.
93
+ >
94
+ > **๐Ÿ”„ New:** `midnight-check-version` tells you if you're running the latest version with update instructions.
89
95
 
90
96
  **9 Embedded Resources** โ€” Quick references available offline: Compact syntax, SDK API, OpenZeppelin contracts, tokenomics, wallet integration, common errors
91
97
 
@@ -11,8 +11,10 @@ export declare const HealthCheckInputSchema: z.ZodObject<{
11
11
  detailed?: boolean | undefined;
12
12
  }>;
13
13
  export declare const GetStatusInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
14
+ export declare const CheckVersionInputSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
14
15
  export type HealthCheckInput = z.infer<typeof HealthCheckInputSchema>;
15
16
  export type GetStatusInput = z.infer<typeof GetStatusInputSchema>;
17
+ export type CheckVersionInput = z.infer<typeof CheckVersionInputSchema>;
16
18
  /**
17
19
  * Perform health check on the MCP server
18
20
  */
@@ -64,5 +66,30 @@ export declare function getStatus(_input: GetStatusInput): Promise<{
64
66
  metadata: import("../utils/cache.js").CacheStats;
65
67
  };
66
68
  }>;
69
+ /**
70
+ * Check if current version is up to date with npm
71
+ */
72
+ export declare function checkVersion(_input: CheckVersionInput): Promise<{
73
+ currentVersion: string;
74
+ latestVersion: string;
75
+ isUpToDate: boolean;
76
+ error: string;
77
+ message?: undefined;
78
+ updateInstructions?: undefined;
79
+ newFeatures?: undefined;
80
+ } | {
81
+ currentVersion: string;
82
+ latestVersion: string;
83
+ isUpToDate: boolean;
84
+ message: string;
85
+ updateInstructions: {
86
+ step1: string;
87
+ step2: string;
88
+ step3: string;
89
+ alternative: string;
90
+ } | null;
91
+ newFeatures: string[] | null;
92
+ error?: undefined;
93
+ }>;
67
94
  export declare const healthTools: ExtendedToolDefinition[];
68
95
  //# sourceMappingURL=health.d.ts.map
@@ -4,6 +4,8 @@
4
4
  import { z } from "zod";
5
5
  import { getHealthStatus, getQuickHealthStatus, getRateLimitStatus, formatRateLimitStatus, } from "../utils/index.js";
6
6
  import { searchCache, fileCache, metadataCache } from "../utils/cache.js";
7
+ // Current version - should match package.json
8
+ const CURRENT_VERSION = "0.1.24";
7
9
  // Schema definitions
8
10
  export const HealthCheckInputSchema = z.object({
9
11
  detailed: z
@@ -13,6 +15,7 @@ export const HealthCheckInputSchema = z.object({
13
15
  .describe("Include detailed checks (slower but more comprehensive)"),
14
16
  });
15
17
  export const GetStatusInputSchema = z.object({});
18
+ export const CheckVersionInputSchema = z.object({});
16
19
  /**
17
20
  * Perform health check on the MCP server
18
21
  */
@@ -61,6 +64,56 @@ export async function getStatus(_input) {
61
64
  },
62
65
  };
63
66
  }
67
+ /**
68
+ * Check if current version is up to date with npm
69
+ */
70
+ export async function checkVersion(_input) {
71
+ try {
72
+ const response = await fetch("https://registry.npmjs.org/midnight-mcp/latest");
73
+ if (!response.ok) {
74
+ return {
75
+ currentVersion: CURRENT_VERSION,
76
+ latestVersion: "unknown",
77
+ isUpToDate: true, // Assume up to date if we can't check
78
+ error: "Could not fetch latest version from npm",
79
+ };
80
+ }
81
+ const data = (await response.json());
82
+ const latestVersion = data.version;
83
+ const isUpToDate = CURRENT_VERSION === latestVersion;
84
+ return {
85
+ currentVersion: CURRENT_VERSION,
86
+ latestVersion,
87
+ isUpToDate,
88
+ message: isUpToDate
89
+ ? "โœ… You are running the latest version!"
90
+ : `โš ๏ธ UPDATE AVAILABLE: v${latestVersion} (you have v${CURRENT_VERSION})`,
91
+ updateInstructions: isUpToDate
92
+ ? null
93
+ : {
94
+ step1: "Clear npx cache: rm -rf ~/.npm/_npx (macOS/Linux) or del /s /q %LocalAppData%\\npm-cache\\_npx (Windows)",
95
+ step2: "Restart Claude Desktop completely (Cmd+Q / Alt+F4, then reopen)",
96
+ step3: "Or update config to use: npx -y midnight-mcp@latest (forces latest)",
97
+ alternative: "You can also install globally: npm install -g midnight-mcp@latest",
98
+ },
99
+ newFeatures: isUpToDate
100
+ ? null
101
+ : [
102
+ "midnight-validate-contract - Compile with REAL Compact compiler",
103
+ "midnight-extract-contract-structure - Static analysis with 10 pre-compilation checks",
104
+ "Pre-compilation detection: division operator, Counter.value, overflow, disclose() requirements",
105
+ ],
106
+ };
107
+ }
108
+ catch (error) {
109
+ return {
110
+ currentVersion: CURRENT_VERSION,
111
+ latestVersion: "unknown",
112
+ isUpToDate: true,
113
+ error: `Failed to check version: ${error instanceof Error ? error.message : "Unknown error"}`,
114
+ };
115
+ }
116
+ }
64
117
  // Output schemas for health tools
65
118
  const healthCheckOutputSchema = {
66
119
  type: "object",
@@ -160,5 +213,47 @@ export const healthTools = [
160
213
  },
161
214
  handler: getStatus,
162
215
  },
216
+ {
217
+ name: "midnight-check-version",
218
+ description: "๐Ÿ”„ Check if you're running the latest version of midnight-mcp. " +
219
+ "Compares your installed version against npm registry and provides update instructions if outdated. " +
220
+ "Use this if tools seem missing or you want to ensure you have the latest features like midnight-validate-contract.",
221
+ inputSchema: {
222
+ type: "object",
223
+ properties: {},
224
+ },
225
+ outputSchema: {
226
+ type: "object",
227
+ properties: {
228
+ currentVersion: {
229
+ type: "string",
230
+ description: "Your installed version",
231
+ },
232
+ latestVersion: { type: "string", description: "Latest version on npm" },
233
+ isUpToDate: {
234
+ type: "boolean",
235
+ description: "Whether you have the latest",
236
+ },
237
+ message: { type: "string", description: "Status message" },
238
+ updateInstructions: {
239
+ type: "object",
240
+ description: "How to update if outdated",
241
+ },
242
+ newFeatures: {
243
+ type: "array",
244
+ items: { type: "string" },
245
+ description: "New features in latest version",
246
+ },
247
+ },
248
+ },
249
+ annotations: {
250
+ readOnlyHint: true,
251
+ idempotentHint: true,
252
+ openWorldHint: true,
253
+ title: "๐Ÿ”„ Check for Updates",
254
+ category: "health",
255
+ },
256
+ handler: checkVersion,
257
+ },
163
258
  ];
164
259
  //# sourceMappingURL=health.js.map
@@ -4,8 +4,8 @@ export { analyzeTools, analyzeContract, explainCircuit } from "./analyze.js";
4
4
  export type { AnalyzeContractInput, ExplainCircuitInput } from "./analyze.js";
5
5
  export { repositoryTools, getFile, listExamples, getLatestUpdates, } from "./repository.js";
6
6
  export type { GetFileInput, ListExamplesInput, GetLatestUpdatesInput, } from "./repository.js";
7
- export { healthTools, healthCheck, getStatus } from "./health.js";
8
- export type { HealthCheckInput, GetStatusInput } from "./health.js";
7
+ export { healthTools, healthCheck, getStatus, checkVersion } from "./health.js";
8
+ export type { HealthCheckInput, GetStatusInput, CheckVersionInput, } from "./health.js";
9
9
  export { generationTools, generationHandlers } from "./generation.js";
10
10
  export { metaTools, listToolCategories, listCategoryTools } from "./meta.js";
11
11
  export type { ExtendedToolDefinition, ToolAnnotations, OutputSchema, } from "../types/index.js";
@@ -1,7 +1,7 @@
1
1
  export { searchTools, searchCompact, searchTypeScript, searchDocs, } from "./search.js";
2
2
  export { analyzeTools, analyzeContract, explainCircuit } from "./analyze.js";
3
3
  export { repositoryTools, getFile, listExamples, getLatestUpdates, } from "./repository.js";
4
- export { healthTools, healthCheck, getStatus } from "./health.js";
4
+ export { healthTools, healthCheck, getStatus, checkVersion } from "./health.js";
5
5
  export { generationTools, generationHandlers } from "./generation.js";
6
6
  export { metaTools, listToolCategories, listCategoryTools } from "./meta.js";
7
7
  // Combined tool list for MCP server
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "midnight-mcp",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Model Context Protocol Server for Midnight Blockchain Development",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",