midnight-mcp 0.1.26 → 0.1.28
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 +8 -6
- package/dist/server.js +1 -1
- package/dist/tools/health.js +1 -1
- package/dist/tools/meta.js +2 -1
- package/dist/tools/repository/validation.js +27 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,6 +21,8 @@ MCP server that gives AI assistants access to Midnight blockchain—search contr
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
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
|
+
>
|
|
25
|
+
> **🔄 Auto-Update Detection:** The server automatically checks for updates and prompts the AI to help you update if you're running an older version.
|
|
24
26
|
|
|
25
27
|
**Cursor** — One-click install:
|
|
26
28
|
|
|
@@ -34,17 +36,17 @@ MCP server that gives AI assistants access to Midnight blockchain—search contr
|
|
|
34
36
|
```json
|
|
35
37
|
{
|
|
36
38
|
"mcpServers": {
|
|
37
|
-
"midnight": { "command": "npx", "args": ["-y", "midnight-mcp"] }
|
|
39
|
+
"midnight": { "command": "npx", "args": ["-y", "midnight-mcp@latest"] }
|
|
38
40
|
}
|
|
39
41
|
}
|
|
40
42
|
```
|
|
41
43
|
|
|
42
|
-
**VS Code Copilot** — Add to `.vscode/mcp.json` or use Command Palette: `MCP: Add Server` → "command (stdio)" → `npx -y midnight-mcp`
|
|
44
|
+
**VS Code Copilot** — Add to `.vscode/mcp.json` or use Command Palette: `MCP: Add Server` → "command (stdio)" → `npx -y midnight-mcp@latest`
|
|
43
45
|
|
|
44
46
|
```json
|
|
45
47
|
{
|
|
46
48
|
"mcpServers": {
|
|
47
|
-
"midnight": { "command": "npx", "args": ["-y", "midnight-mcp"] }
|
|
49
|
+
"midnight": { "command": "npx", "args": ["-y", "midnight-mcp@latest"] }
|
|
48
50
|
}
|
|
49
51
|
}
|
|
50
52
|
```
|
|
@@ -54,7 +56,7 @@ MCP server that gives AI assistants access to Midnight blockchain—search contr
|
|
|
54
56
|
```json
|
|
55
57
|
{
|
|
56
58
|
"mcpServers": {
|
|
57
|
-
"midnight": { "command": "npx", "args": ["-y", "midnight-mcp"] }
|
|
59
|
+
"midnight": { "command": "npx", "args": ["-y", "midnight-mcp@latest"] }
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
```
|
|
@@ -75,7 +77,7 @@ Restart your editor after adding the config. **No API keys required.**
|
|
|
75
77
|
|
|
76
78
|
## Features
|
|
77
79
|
|
|
78
|
-
**
|
|
80
|
+
**26 Tools** — Search, analyze, validate, version tracking, AI generation, compound operations
|
|
79
81
|
|
|
80
82
|
| Category | Tools |
|
|
81
83
|
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -109,7 +111,7 @@ Run everything locally for privacy or offline use:
|
|
|
109
111
|
"mcpServers": {
|
|
110
112
|
"midnight": {
|
|
111
113
|
"command": "npx",
|
|
112
|
-
"args": ["-y", "midnight-mcp"],
|
|
114
|
+
"args": ["-y", "midnight-mcp@latest"],
|
|
113
115
|
"env": {
|
|
114
116
|
"MIDNIGHT_LOCAL": "true",
|
|
115
117
|
"OPENAI_API_KEY": "sk-...",
|
package/dist/server.js
CHANGED
|
@@ -8,7 +8,7 @@ import { allResources, getDocumentation, getCode, getSchema, } from "./resources
|
|
|
8
8
|
import { promptDefinitions, generatePrompt } from "./prompts/index.js";
|
|
9
9
|
import { registerSamplingCallback } from "./services/index.js";
|
|
10
10
|
// Server information - version should match package.json
|
|
11
|
-
const CURRENT_VERSION = "0.1.
|
|
11
|
+
const CURRENT_VERSION = "0.1.27";
|
|
12
12
|
const SERVER_INFO = {
|
|
13
13
|
name: "midnight-mcp",
|
|
14
14
|
version: CURRENT_VERSION,
|
package/dist/tools/health.js
CHANGED
|
@@ -5,7 +5,7 @@ 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
7
|
// Current version - should match package.json
|
|
8
|
-
const CURRENT_VERSION = "0.1.
|
|
8
|
+
const CURRENT_VERSION = "0.1.27";
|
|
9
9
|
// Schema definitions
|
|
10
10
|
export const HealthCheckInputSchema = z.object({
|
|
11
11
|
detailed: z
|
package/dist/tools/meta.js
CHANGED
|
@@ -142,6 +142,7 @@ function getToolsByCategory() {
|
|
|
142
142
|
...repositoryTools,
|
|
143
143
|
...healthTools,
|
|
144
144
|
...generationTools,
|
|
145
|
+
...metaTools,
|
|
145
146
|
];
|
|
146
147
|
const byCategory = new Map();
|
|
147
148
|
for (const tool of allTools) {
|
|
@@ -230,7 +231,7 @@ function generateCategorySuggestion(category) {
|
|
|
230
231
|
export const metaTools = [
|
|
231
232
|
{
|
|
232
233
|
name: "midnight-list-tool-categories",
|
|
233
|
-
description: "📋 DISCOVERY TOOL: List available tool categories for progressive exploration. Use this FIRST to understand what capabilities are available, then drill into specific categories with midnight-list-category-tools. Reduces cognitive load by organizing
|
|
234
|
+
description: "📋 DISCOVERY TOOL: List available tool categories for progressive exploration. Use this FIRST to understand what capabilities are available, then drill into specific categories with midnight-list-category-tools. Reduces cognitive load by organizing 26 tools into 8 logical groups.",
|
|
234
235
|
inputSchema: {
|
|
235
236
|
type: "object",
|
|
236
237
|
properties: {
|
|
@@ -1417,6 +1417,33 @@ export async function extractContractStructure(input) {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
}
|
|
1419
1419
|
}
|
|
1420
|
+
// 11. Detect "if" expression used in assignment context (should use ternary)
|
|
1421
|
+
// Pattern: const x = if (...) { ... } else { ... }
|
|
1422
|
+
const ifAssignmentPattern = /(?:const|let)\s+\w+\s*=\s*if\s*\(/g;
|
|
1423
|
+
let ifAssignMatch;
|
|
1424
|
+
while ((ifAssignMatch = ifAssignmentPattern.exec(code)) !== null) {
|
|
1425
|
+
const lineNum = lineByIndex[ifAssignMatch.index] || 1;
|
|
1426
|
+
potentialIssues.push({
|
|
1427
|
+
type: "invalid_if_expression",
|
|
1428
|
+
line: lineNum,
|
|
1429
|
+
message: `'if' cannot be used as an expression in assignments`,
|
|
1430
|
+
suggestion: `Use ternary operator instead: 'const x = condition ? valueIfTrue : valueIfFalse;'`,
|
|
1431
|
+
severity: "error",
|
|
1432
|
+
});
|
|
1433
|
+
}
|
|
1434
|
+
// 12. Detect "Void" return type (should use [] empty tuple)
|
|
1435
|
+
const voidReturnPattern = /circuit\s+\w+\s*\([^)]*\)\s*:\s*Void\b/g;
|
|
1436
|
+
let voidMatch;
|
|
1437
|
+
while ((voidMatch = voidReturnPattern.exec(code)) !== null) {
|
|
1438
|
+
const lineNum = lineByIndex[voidMatch.index] || 1;
|
|
1439
|
+
potentialIssues.push({
|
|
1440
|
+
type: "invalid_void_type",
|
|
1441
|
+
line: lineNum,
|
|
1442
|
+
message: `'Void' is not a valid type in Compact`,
|
|
1443
|
+
suggestion: `Use empty tuple '[]' for circuits with no return value: 'circuit name(): []'`,
|
|
1444
|
+
severity: "error",
|
|
1445
|
+
});
|
|
1446
|
+
}
|
|
1420
1447
|
const summary = [];
|
|
1421
1448
|
if (circuits.length > 0) {
|
|
1422
1449
|
summary.push(`${circuits.length} circuit(s)`);
|