midnight-mcp 0.1.37 → 0.1.38

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
@@ -71,19 +71,28 @@ Add to `~/.codeium/windsurf/mcp_config.json`:
71
71
 
72
72
  **No API keys required.** Restart your editor after adding the config.
73
73
 
74
- ### Automatic Updates
74
+ ### Updating to Latest Version
75
75
 
76
- Using `midnight-mcp@latest` ensures you always get the newest version.
76
+ Using `midnight-mcp@latest` in your config ensures you get updates automatically on restart.
77
77
 
78
- **If you have an older version:** The AI agent will detect it and offer to update your config automatically—no manual steps required! Just approve the config edit and restart your editor.
79
-
80
- Or manually update your config:
78
+ **Already using an older version without `@latest`?** Update your config manually:
81
79
 
82
80
  ```diff
83
81
  - "args": ["-y", "midnight-mcp"]
84
82
  + "args": ["-y", "midnight-mcp@latest"]
85
83
  ```
86
84
 
85
+ **Then clear npm cache and restart:**
86
+
87
+ ```bash
88
+ # Clear npx cache (required to fetch new version)
89
+ rm -rf ~/.npm/_npx
90
+
91
+ # Restart your editor (Cmd+Q on Mac, then reopen)
92
+ ```
93
+
94
+ > **Note:** AI agents cannot auto-update your config because they run in a sandboxed environment without access to your local filesystem.
95
+
87
96
  ---
88
97
 
89
98
  ## What's Included
@@ -98,7 +107,7 @@ Or manually update your config:
98
107
  | **Versioning** | `get-version-info`, `check-breaking-changes`, `get-migration-guide`, `get-file-at-version`, `compare-syntax`, `get-latest-syntax` | Version tracking and migration |
99
108
  | **AI Generation** | `generate-contract`, `review-contract`, `document-contract` | AI-powered code generation _(requires sampling)_ |
100
109
  | **Compound** | `upgrade-check`, `get-repo-context` | Multi-step operations _(saves 50-70% tokens)_ |
101
- | **Health** | `health-check`, `get-status`, `check-version`, `auto-update-config` | Server status, version checking, auto-update |
110
+ | **Health** | `health-check`, `get-status`, `check-version` | Server status and version checking |
102
111
  | **Discovery** | `list-tool-categories`, `list-category-tools` | Explore available tools |
103
112
 
104
113
  All tools are prefixed with `midnight-` (e.g., `midnight-search-compact`).
package/dist/server.js CHANGED
@@ -354,24 +354,25 @@ function registerToolHandlers(server) {
354
354
  // Include prominent update prompt in ALL responses when outdated
355
355
  const updateWarning = getUpdateWarning();
356
356
  if (updateWarning && versionCheckResult.isOutdated) {
357
- // Prepend urgent update notice with AUTO-UPDATE instructions
357
+ // Prepend update notice with MANUAL instructions (auto-update not possible in sandbox)
358
358
  const updatePrompt = {
359
- "🚨 AUTO-UPDATE AVAILABLE": {
360
- message: `You are using an OUTDATED version of midnight-mcp (v${CURRENT_VERSION}). Latest is v${versionCheckResult.latestVersion}.`,
361
- agentAction: {
362
- instruction: "YOU CAN AUTO-UPDATE FOR THE USER. Call the midnight-auto-update-config tool, then use your file editing capabilities to update their config automatically.",
363
- tool: "midnight-auto-update-config",
359
+ "🚨 UPDATE AVAILABLE": {
360
+ message: `You are using v${CURRENT_VERSION} but v${versionCheckResult.latestVersion} is available.`,
361
+ userAction: {
362
+ instruction: "Tell the user to update manually. Auto-update is NOT possible because you run in a sandboxed environment without access to local files.",
364
363
  steps: [
365
- "1. Call midnight-auto-update-config to get config file paths",
366
- "2. Read the user's config file (Claude Desktop, Cursor, VS Code, or Windsurf)",
367
- "3. Replace 'midnight-mcp' with 'midnight-mcp@latest' in the args array",
368
- "4. Save the file",
369
- "5. Tell user: 'I've updated your config! Please restart your editor to use the latest version.'",
364
+ "1. Edit config file to use 'midnight-mcp@latest' instead of 'midnight-mcp'",
365
+ "2. Run: rm -rf ~/.npm/_npx (to clear npm cache)",
366
+ "3. Restart the editor completely (Cmd+Q on Mac, then reopen)",
370
367
  ],
368
+ configLocations: {
369
+ claudeDesktop: "~/Library/Application Support/Claude/claude_desktop_config.json",
370
+ cursor: ".cursor/mcp.json",
371
+ vscode: ".vscode/mcp.json",
372
+ windsurf: "~/.codeium/windsurf/mcp_config.json",
373
+ },
371
374
  },
372
- fallbackInstructions: {
373
- ifAutoUpdateFails: "Ask user to manually update config to use midnight-mcp@latest",
374
- },
375
+ note: "If user already has @latest in config, they just need to clear cache (rm -rf ~/.npm/_npx) and restart.",
375
376
  },
376
377
  result,
377
378
  };
@@ -332,9 +332,9 @@ export const healthTools = [
332
332
  },
333
333
  {
334
334
  name: "midnight-auto-update-config",
335
- description: "🔧 AUTO-UPDATE: Get config file paths so YOU (the AI agent) can automatically update the user's MCP config to use @latest. " +
336
- "This tool returns the exact file paths and search/replace instructions. " +
337
- "After calling this, use your file editing capabilities to update the config file automatically - NO USER ACTION REQUIRED except restart.",
335
+ description: "⚠️ DEPRECATED: Auto-update is NOT possible because AI agents run in sandboxed environments without access to local filesystems. " +
336
+ "Instead, tell users to manually update their config to use midnight-mcp@latest, then run: rm -rf ~/.npm/_npx && restart their editor. " +
337
+ "This tool only returns config file paths for reference.",
338
338
  inputSchema: {
339
339
  type: "object",
340
340
  properties: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "midnight-mcp",
3
- "version": "0.1.37",
3
+ "version": "0.1.38",
4
4
  "description": "Model Context Protocol Server for Midnight Blockchain Development",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",