Skip to content

Conversation

@akolotov
Copy link
Collaborator

@akolotov akolotov commented Aug 13, 2025

Closes #200

Summary by CodeRabbit

  • New Features

    • Added automated Docker-based build script with Production and Development modes to package the desktop extension.
    • Introduced a development extension manifest with a configurable Blockscout MCP server URL.
    • Build outputs signed .dxt artifacts for easy installation in Claude Desktop.
  • Documentation

    • Updated README examples to run the Python module explicitly inside the container.
    • Added automated build instructions, mode details, output paths, and installation guidance.
  • Chores

    • Bumped extension version to 0.2.0.

@akolotov akolotov self-assigned this Aug 13, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 13, 2025

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the "Integrations" page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/dxt-build-script

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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 (9)
dxt/README.md (1)

24-49: Add copy-out instructions and note about verify behavior

Two small doc gaps to streamline usage:

  • Show a docker cp example to retrieve the artifact from the container.
  • Note that dxt verify may return non-zero for self-signed certificates (expected).

Proposed patch:

 ### Automated Build (Recommended)

 For automated building using the provided build script:

 **Production mode (default):**

 ```shell
 docker run --rm -it -v "$(pwd)"/dxt:/workspace -w /workspace node:20-slim bash -c "./build.sh"
 # or explicitly:
 docker run --rm -it -v "$(pwd)"/dxt:/workspace -w /workspace node:20-slim bash -c "./build.sh prod"

Development mode:

docker run --rm -it -v "$(pwd)"/dxt:/workspace -w /workspace node:20-slim bash -c "./build.sh dev"

Build Modes

  • Production (prod): Uses manifest.json and connects to the official https://mcp.blockscout.com/mcp/ server. Creates blockscout-mcp.dxt.
  • Development (dev): Uses manifest-dev.json with configurable URL and creates blockscout-mcp-dev.dxt. Users can configure the Blockscout MCP server URL during installation in Claude Desktop.

This will automatically handle all the steps below and create the extension at dxt/_build/blockscout-mcp[--dev].dxt.
+
+Retrieving the artifact to your host:
+
+bash +# If you ran an interactive shell, you can copy the file out with: +docker cp <container_id>:/workspace/_build/blockscout-mcp.dxt . +# or for dev builds: +docker cp <container_id>:/workspace/_build/blockscout-mcp-dev.dxt . +
+
+Note: dxt verify may return a non-zero exit code when using self-signed certificates. This is expected; the build script handles it and continues.


</blockquote></details>
<details>
<summary>dxt/build.sh (6)</summary><blockquote>

`9-10`: **Harden shell options**

Use stronger shell options to fail fast on unset vars and pipeline errors.

```diff
-set -e  # Exit on any error
+set -euo pipefail  # Exit on error, unset var, or pipeline failure

22-26: Make apt non-interactive and minimal; clean apt cache

Prevents interactive prompts and keeps the container lean.

 # Step 1: Install system dependencies
 echo "📦 Installing system dependencies..."
-apt-get update -qq
-apt-get install -y openssl
+export DEBIAN_FRONTEND=noninteractive
+apt-get update -qq
+apt-get install -y --no-install-recommends openssl ca-certificates
+rm -rf /var/lib/apt/lists/*

28-30: Pin DXT CLI for reproducible builds (optional)

Helps avoid breakages from upstream changes.

-echo "🔧 Installing DXT CLI..."
-npm install -g @anthropic-ai/dxt
+echo "🔧 Installing DXT CLI..."
+# Optionally pin to a known-good version for reproducibility, e.g.:
+# npm install -g @anthropic-ai/dxt@<known-good-version>
+npm install -g @anthropic-ai/dxt

46-48: Copy prod manifest explicitly as manifest.json for consistency

Keeps behavior symmetric with dev branch and avoids relying on the filename.

 else
     echo "   Using production manifest (manifest.json)"
-    cp manifest.json _build/
+    cp manifest.json _build/manifest.json
 fi

78-81: Don’t let dxt info terminate the script if it fails

Very rare, but guard to preserve the success flow.

 echo ""
 echo "ℹ️  Extension info:"
-dxt info "$DXT_FILENAME"
+dxt info "$DXT_FILENAME" || true

81-92: Optional: print checksum and clearer copy guidance

Makes artifact integrity and transfer easier for users.

 echo ""
 echo "🎉 Extension built successfully!"
 echo "📄 Output: dxt/_build/$DXT_FILENAME"
 echo "🔧 Mode: $MODE"
 if [[ "$MODE" == "dev" ]]; then
     echo "⚙️  Note: Dev mode requires manual configuration of Blockscout MCP server URL"
 fi
 echo ""
 echo "To use this extension:"
 echo "1. Copy the .dxt file from the container to your host system"
-echo "2. Install it in Claude Desktop"
+echo "   Example: docker cp \$(hostname):/workspace/_build/$DXT_FILENAME ."
+echo "2. (Optional) Verify checksum: sha256sum $DXT_FILENAME"
+echo "3. Install it in Claude Desktop"
dxt/manifest-dev.json (2)

24-31: Confirm mcp-remote flags are correct for your version

Double-check that the mcp-remote version you install supports "--transport http-only" and "--allow-http". If flag names changed upstream, adjust accordingly.


35-41: Add URI format to user_config for better UX

Explicitly marking the value as a URI can improve validation in clients that honor the schema.

 "user_config": {
   "blockscout_url": {
     "type": "string",
     "title": "Blockscout MCP Server URL",
     "description": "The URL of the Blockscout MCP server to connect to (e.g., http://127.0.0.1:8000/mcp/ for local development)",
-    "default": "http://127.0.0.1:8000/mcp/",
+    "default": "http://127.0.0.1:8000/mcp/",
+    "format": "uri",
     "required": true
   }
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between babb439 and 7645863.

📒 Files selected for processing (5)
  • README.md (1 hunks)
  • dxt/README.md (1 hunks)
  • dxt/build.sh (1 hunks)
  • dxt/manifest-dev.json (1 hunks)
  • dxt/manifest.json (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📚 Learning: 2025-07-22T00:12:19.870Z
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.870Z
Learning: Applies to blockscout_mcp_server/__init__.py : When updating the version of the MCP server, update the `__version__` variable in `blockscout_mcp_server/__init__.py`.

Applied to files:

  • dxt/manifest.json
📚 Learning: 2025-07-22T00:11:07.554Z
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.554Z
Learning: Applies to **/*.py : The MCP server must wrap Blockscout APIs and expose blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol (MCP).

Applied to files:

  • dxt/manifest.json
  • README.md
  • dxt/manifest-dev.json
📚 Learning: 2025-07-22T00:12:19.870Z
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/130-version-management.mdc:0-0
Timestamp: 2025-07-22T00:12:19.870Z
Learning: Use the exact same version string in both `pyproject.toml` and `blockscout_mcp_server/__init__.py`.

Applied to files:

  • dxt/manifest.json
📚 Learning: 2025-07-22T00:11:07.554Z
Learnt from: CR
PR: blockscout/mcp-server#0
File: .cursor/rules/000-role-and-task.mdc:0-0
Timestamp: 2025-07-22T00:11:07.554Z
Learning: Applies to {Dockerfile,docker-compose.yml} : The MCP server must be able to run locally or through Docker.

Applied to files:

  • README.md
🔇 Additional comments (2)
dxt/manifest.json (1)

5-5: Version bump looks good

Manifest version updated to 0.2.0; no issues spotted with the rest of the config.

README.md (1)

260-260: Docker run examples are correct and clearer now

Using python -m blockscout_mcp_server inside the container for HTTP/REST modes is appropriate and matches the image’s contents.

Also applies to: 266-266, 274-274

@akolotov akolotov merged commit 82f6f70 into main Aug 13, 2025
8 checks passed
@akolotov akolotov deleted the feat/dxt-build-script branch August 13, 2025 23:31
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.

Create Automated DXT Build Script with Prod/Dev Modes

2 participants