Skip to content

Conversation

wonderwhy-er
Copy link
Owner

@wonderwhy-er wonderwhy-er commented Sep 19, 2025

Summary by CodeRabbit

  • New Features

    • Tool listings now include human-readable titles and UI hints (read-only, destructive, open-world) for many file, search, process, and config actions to improve UI presentation.
  • Chores

    • Added manifest templates (including a "future" manifest) and a bundling build script plus two npm scripts to produce MCP bundles.
    • Updated .gitignore with MCPB and test artifacts.
  • Documentation

    • Updated Privacy Policy link in README to an absolute URL.

Copy link
Contributor

coderabbitai bot commented Sep 19, 2025

Walkthrough

Adds UI annotation metadata to tool descriptors returned by ListTools in src/server.ts; introduces MCP manifest templates and a build script to produce an .mcpb bundle; updates package scripts, .gitignore, and README privacy link. No runtime control-flow changes.

Changes

Cohort / File(s) Summary
Tool annotations
src/server.ts
Adds an annotations object to tool descriptors returned by ListTools (required title, optional readOnlyHint, destructiveHint, openWorldHint) for many tools (e.g., get_config, set_config_value, read_file, write_file, move_file, start_process, interact_with_process, kill_process, get_usage_stats, etc.).
Build tooling & scripts
scripts/build-mcpb.cjs, package.json
Adds scripts/build-mcpb.cjs to assemble an MCPB bundle (build, manifest selection/substitution, copy files, validate, pack) and adds npm scripts build:mcpb and build:mcpb:future to invoke it.
Manifests / bundle metadata
manifest.template.json, manifest.future.json
Adds two manifest files (template and "future" variant) providing MCP metadata and server/mcp_config entries (node entry_point, args, env, placeholders).
Repository & docs
.gitignore, README.md
Extends .gitignore with mcpb- and test-related patterns; updates README privacy link to an absolute URL.

Sequence Diagram(s)

sequenceDiagram
  participant UI as Client/UI
  participant S as Server (`src/server.ts`)
  UI->>S: ListTools request
  Note over UI,S: Request available tools
  S-->>UI: tools[] (each tool includes annotations { title, readOnlyHint?, destructiveHint?, openWorldHint? })
  Note right of UI: UI uses annotations for presentation and constraints
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • dmitry-ottic-ai

Poem

I hop through manifests, bundle in paw,
I tag each tool with a helpful law.
Read-only carrots, dangerous beet—
UI knows which paths to meet.
Hop, build, and pack — a rabbit’s cheer! 🐇🎉

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title "Add annotations" is concise and accurately reflects the primary change in the diff—adding an annotations field and annotation objects to tool descriptors in src/server.ts—so it clearly communicates the main intent for someone scanning the history, even though the PR also includes ancillary files like manifests and build scripts.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch adjustments-for-antropic

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9754420 and 7994c13.

📒 Files selected for processing (1)
  • scripts/build-mcpb.cjs (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • scripts/build-mcpb.cjs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/server.ts (1)

309-319: Add annotations for consistency to remaining tools.

For parity and predictable UI, consider annotating the tools below as well.

Apply diffs:

@@
                 {
                     name: "create_directory",
@@
                     inputSchema: zodToJsonSchema(CreateDirectoryArgsSchema),
+                    annotations: {
+                        title: "Create Directory",
+                        readOnlyHint: false,
+                        destructiveHint: true,
+                        openWorldHint: false,
+                    },
                 },
@@
                 {
                     name: "start_search",
@@
-                    inputSchema: zodToJsonSchema(StartSearchArgsSchema),
+                    inputSchema: zodToJsonSchema(StartSearchArgsSchema),
+                    annotations: {
+                        title: "Start Search",
+                        readOnlyHint: true
+                    },
                 },
@@
                 {
                     name: "stop_search", 
@@
-                    inputSchema: zodToJsonSchema(StopSearchArgsSchema),
+                    inputSchema: zodToJsonSchema(StopSearchArgsSchema),
+                    annotations: {
+                        title: "Stop Search",
+                        readOnlyHint: false
+                    },
                 },
@@
                 {
                     name: "give_feedback_to_desktop_commander",
@@
-                    inputSchema: zodToJsonSchema(GiveFeedbackArgsSchema),
+                    inputSchema: zodToJsonSchema(GiveFeedbackArgsSchema),
+                    annotations: {
+                        title: "Give Feedback",
+                        readOnlyHint: true,
+                        openWorldHint: true
+                    },
                 },
@@
                 {
                     name: "get_prompts",
@@
-                    inputSchema: zodToJsonSchema(GetPromptsArgsSchema),
+                    inputSchema: zodToJsonSchema(GetPromptsArgsSchema),
+                    annotations: {
+                        title: "Get Curated Prompts",
+                        readOnlyHint: true
+                    },
                 },

Also applies to: 356-437, 469-482, 801-836, 838-870

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36df076 and 989d866.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • src/server.ts (19 hunks)
🔇 Additional comments (1)
src/server.ts (1)

172-176: MCP permits annotations on Tool objects — no change required.

MCP Tool objects allow extra properties; annotations and the reserved _meta map are intended for UI/vendor metadata and official clients typically tolerate unknown fields. Keep annotations for UI hints; use _meta (namespaced keys) for vendor-specific metadata if needed.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (4)
.gitignore (2)

48-53: Good: MCP bundle artifacts and local registry tokens are ignored

This prevents accidental commits of build outputs and secrets. Consider pairing this with repo-level secret scanning and a pre-commit hook (e.g., git-secrets) for defense in depth.


54-57: Future-proof the ad‑hoc test script ignores and ensure they don’t ship to npm

If these files are temporary utilities, ignore them via a simple glob so future siblings don’t get committed. Also, .gitignore doesn’t strictly control npm publishing—prefer a package.json "files" allowlist to keep dev/test files out of the published package.

Apply optionally:

 # Test files
 test_files/
 test_fix.js
 test_search.js
+test_*.js

And in package.json (outside this hunk), consider:

{
  "files": ["dist/", "src/**/*.d.ts", "README.md", "LICENSE"]
}
manifest.template.json (1)

7-10: Consider aligning author metadata consistency.

The author field uses "Desktop Commander Team" while package.json line 7 shows "Eduards Ruzga". Consider whether this should be consistent across both files or if the team name is intentionally different for the bundle.

scripts/build-mcpb.cjs (1)

80-87: Consider adding conditional file copying based on existence.

While the script handles missing files gracefully with warning messages, it might be cleaner to define required vs optional files separately to improve maintainability and clarity.

// Step 5: Copy necessary files
+const requiredFiles = [
+    'dist',
+    'package.json',
+    'README.md',
+    'LICENSE'
+];
+
+const optionalFiles = [
+    'PRIVACY.md',
+    'logo.png'
+];

+// Copy required files (fail if missing)
+requiredFiles.forEach(file => {
+    const srcPath = path.join(PROJECT_ROOT, file);
+    const destPath = path.join(BUNDLE_DIR, file);
+    
+    if (!fs.existsSync(srcPath)) {
+        console.error(`❌ Required file ${file} not found`);
+        process.exit(1);
+    }
+    
+    if (fs.statSync(srcPath).isDirectory()) {
+        fs.cpSync(srcPath, destPath, { recursive: true });
+    } else {
+        fs.copyFileSync(srcPath, destPath);
+    }
+    console.log(`✅ Copied ${file}`);
+});
+
+// Copy optional files (warn if missing)
+optionalFiles.forEach(file => {
-const filesToCopy = [
-    'dist',
-    'package.json',
-    'README.md',
-    'LICENSE',
-    'PRIVACY.md',
-    'logo.png'
-];
-
-filesToCopy.forEach(file => {
    const srcPath = path.join(PROJECT_ROOT, file);
    const destPath = path.join(BUNDLE_DIR, file);
    
    if (fs.existsSync(srcPath)) {
        if (fs.statSync(srcPath).isDirectory()) {
-            // Copy directory recursively
            fs.cpSync(srcPath, destPath, { recursive: true });
        } else {
-            // Copy file
            fs.copyFileSync(srcPath, destPath);
        }
        console.log(`✅ Copied ${file}`);
    } else {
        console.log(`⚠️  Skipped ${file} (not found)`);
    }
});
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 989d866 and 9754420.

📒 Files selected for processing (6)
  • .gitignore (1 hunks)
  • README.md (1 hunks)
  • manifest.future.json (1 hunks)
  • manifest.template.json (1 hunks)
  • package.json (1 hunks)
  • scripts/build-mcpb.cjs (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • manifest.future.json
  • README.md
🔇 Additional comments (6)
.gitignore (1)

46-47: Confirm test artifact path in .gitignore

File: .gitignore (lines 46–47) contains:

test/test_output/

Verify the repository actually writes artifacts to test/test_output/ (vs. e.g. tests/output) and update .gitignore to the correct path to avoid accidental check-ins. Automated sandbox verification failed (missing tools); confirm locally.

package.json (1)

45-46: LGTM! New build scripts for MCPB bundling.

The addition of build:mcpb and build:mcpb:future scripts provides a clean interface to generate MCPB bundles using the new build script, with appropriate parameterization for different manifest templates.

manifest.template.json (2)

1-31: Well-structured manifest template with proper versioning.

The manifest template follows MCPB conventions and includes all necessary fields for deployment. The {{VERSION}} placeholder will be properly substituted by the build script.


14-22: Verify NODE_ENV production setting impact.

The manifest explicitly sets NODE_ENV=production which may affect runtime behavior. Ensure this doesn't disable debugging capabilities or change functionality that users might expect during development or troubleshooting.

Based on the search results, MCP servers commonly use environment variables for configuration, including NODE_ENV settings. The search shows that setting NODE_ENV=production in MCP configurations is a standard practice and typically used to control runtime behavior like logging levels and debugging features without breaking core functionality.

scripts/build-mcpb.cjs (2)

1-171: Well-structured build script with comprehensive error handling.

The script provides a complete MCPB bundle generation workflow with proper validation, error handling, and user guidance. The logic correctly handles manifest template selection and variable substitution.


47-51: Resolved — manifest.future.json is present and verified.
manifest.future.json exists in the repository and its contents were inspected; no action required for the --future flag.

Comment on lines +126 to +131
execSync(`mcpb validate "${MANIFEST_PATH}"`, { stdio: 'inherit' });
console.log('✅ Manifest validation passed');
} catch (error) {
console.error('❌ Manifest validation failed:', error.message);
process.exit(1);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

🧩 Analysis chain

Verify mcpb CLI tool availability.

The script depends on the mcpb CLI tool for validation and packing but doesn't check if it's installed. This could cause runtime failures during the build process.


🏁 Script executed:

#!/bin/bash
# Description: Check if mcpb CLI tool is available and working

# Check if mcpb command exists
if command -v mcpb >/dev/null 2>&1; then
    echo "✅ mcpb CLI tool found"
    mcpb --version 2>/dev/null || echo "mcpb version command failed"
else
    echo "❌ mcpb CLI tool not found"
    echo "This tool is required for bundle validation and packing"
    echo "Install it with: npm install -g mcpb"
    exit 1
fi

Length of output: 118


Add availability check for mcpb CLI before execution.
scripts/build-mcpb.cjs:126-131
The script currently invokes mcpb without verifying it’s installed, leading to opaque failures. Insert a preflight check (e.g. command -v mcpb or spawnSync('mcpb',['--version'])) and emit a clear error with install instructions before calling mcpb validate.

🤖 Prompt for AI Agents
In scripts/build-mcpb.cjs around lines 126 to 131, the script calls `mcpb
validate` without checking that the `mcpb` CLI is installed; add a preflight
availability check (for example use child_process.spawnSync('mcpb',
['--version']) or run a shell `command -v mcpb`) prior to execSync, and if the
check fails log a clear error message that explains mcpb is not found and gives
install instructions (or a link) and exit with code 1; only proceed to
execSync(`mcpb validate ...`) when the check succeeds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant