Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,21 +257,21 @@ docker pull ghcr.io/blockscout/mcp-server:latest
To run the Docker container in HTTP mode with port mapping:

```bash
docker run --rm -p 8000:8000 ghcr.io/blockscout/mcp-server:latest --http --http-host 0.0.0.0
docker run --rm -p 8000:8000 ghcr.io/blockscout/mcp-server:latest python -m blockscout_mcp_server --http --http-host 0.0.0.0
```

With custom port:

```bash
docker run --rm -p 8080:8080 ghcr.io/blockscout/mcp-server:latest --http --http-host 0.0.0.0 --http-port 8080
docker run --rm -p 8080:8080 ghcr.io/blockscout/mcp-server:latest python -m blockscout_mcp_server --http --http-host 0.0.0.0 --http-port 8080
```

**HTTP Mode with REST API:**

To run with the REST API enabled:

```bash
docker run --rm -p 8000:8000 ghcr.io/blockscout/mcp-server:latest --http --rest --http-host 0.0.0.0
docker run --rm -p 8000:8000 ghcr.io/blockscout/mcp-server:latest python -m blockscout_mcp_server --http --rest --http-host 0.0.0.0
```

**Note:** When running in HTTP mode with Docker, use `--http-host 0.0.0.0` to bind to all interfaces so the server is accessible from outside the container.
Expand Down
29 changes: 29 additions & 0 deletions dxt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,35 @@ The reasons for this are:

## Packaging instructions

### 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:**

```shell
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`.

### Manual Build

For manual building or if you prefer step-by-step control:

1. This step is optional and required only if there is no local Node.js installation.

For the project directory run:
Expand Down
91 changes: 91 additions & 0 deletions dxt/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#!/bin/bash

# Build script for Blockscout MCP Server Desktop Extension
# This script can be run inside the Docker container to build the extension automatically
#
# Usage: ./build.sh [mode]
# mode: "prod" (default) or "dev"

set -e # Exit on any error

# Parse arguments
MODE="${1:-prod}"

if [[ "$MODE" != "prod" && "$MODE" != "dev" ]]; then
echo "❌ Error: Mode must be 'prod' or 'dev'"
echo "Usage: $0 [prod|dev]"
exit 1
fi

echo "🚀 Building Blockscout MCP Server Desktop Extension (${MODE} mode)..."

# Step 1: Install system dependencies
echo "📦 Installing system dependencies..."
apt-get update -qq
apt-get install -y openssl

# Step 2: Install DXT CLI
echo "🔧 Installing DXT CLI..."
npm install -g @anthropic-ai/dxt

# Step 3: Prepare build directory
echo "📂 Preparing build directory..."
if [ -d "_build" ]; then
echo " Cleaning existing _build directory..."
rm -rf _build
fi

mkdir _build

# Step 4: Copy required files based on mode
echo "📋 Copying manifest and assets..."
if [[ "$MODE" == "dev" ]]; then
echo " Using development manifest (manifest-dev.json)"
cp manifest-dev.json _build/manifest.json
else
echo " Using production manifest (manifest.json)"
cp manifest.json _build/
fi
cp blockscout.png _build/

# Step 5: Change to build directory and install dependencies
echo "📦 Installing mcp-remote dependency..."
cd _build
npm install mcp-remote@0.1.18

# Step 6: Package the extension
echo "📦 Packaging extension..."
if [[ "$MODE" == "dev" ]]; then
DXT_FILENAME="blockscout-mcp-dev.dxt"
else
DXT_FILENAME="blockscout-mcp.dxt"
fi
dxt pack . "$DXT_FILENAME"

# Step 7: Sign the extension
echo "✍️ Signing extension..."
dxt sign "$DXT_FILENAME" --self-signed

# Step 8: Verify the extension
echo "✅ Verifying extension..."
if dxt verify "$DXT_FILENAME"; then
echo " ✅ Extension signature verified successfully"
else
echo " ⚠️ Extension verification failed (expected for self-signed certificates)"
echo " ℹ️ This is normal when using self-signed certificates and won't affect functionality"
fi
echo ""
echo "ℹ️ Extension info:"
dxt info "$DXT_FILENAME"

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"
118 changes: 118 additions & 0 deletions dxt/manifest-dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
{
"dxt_version": "0.1",
"name": "blockscout-mcp-dev",
"display_name": "Blockscout (dev)",
"version": "0.2.0",
"description": "Contextual blockchain activity analysis via Blockscout APIs",
"long_description": "This extension enables contextual blockchain activity analysis with multi-chain support, intelligent context optimization, smart response slicing, and seamless pagination. The server exposes blockchain data including balances, tokens, NFTs, contract metadata, transactions, and logs via MCP for comprehensive blockchain analysis. This extension acts as a proxy to the official Blockscout MCP server.",
"author": {
"name": "Blockscout",
"url": "https://blockscout.com"
},
"repository": {
"type": "git",
"url": "https://github.com/blockscout/mcp-server"
},
"homepage": "https://blockscout.com",
"documentation": "https://mcp.blockscout.com",
"support": "https://github.com/blockscout/mcp-server/issues",
"icon": "blockscout.png",
"server": {
"type": "node",
"entry_point": "node_modules/mcp-remote/dist/proxy.js",
"mcp_config": {
"command": "node",
"args": [
"${__dirname}/node_modules/mcp-remote/dist/proxy.js",
"${user_config.blockscout_url}",
"--transport", "http-only",
"--allow-http"
],
"env": {}
}
},
"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/",
"required": true
}
},
"tools": [
{
"name": "__unlock_blockchain_analysis__",
"description": "Provides custom instructions for the MCP host. This is a mandatory first step."
},
{
"name": "get_chains_list",
"description": "Returns a list of all known blockchain chains"
},
{
"name": "get_address_by_ens_name",
"description": "Converts an ENS name to its Ethereum address"
},
{
"name": "lookup_token_by_symbol",
"description": "Searches for tokens by symbol"
},
{
"name": "get_contract_abi",
"description": "Retrieves the ABI for a smart contract"
},
{
"name": "get_address_info",
"description": "Gets comprehensive information about an address"
},
{
"name": "get_tokens_by_address",
"description": "Returns ERC20 token holdings for an address"
},
{
"name": "get_latest_block",
"description": "Returns the latest indexed block"
},
{
"name": "get_transactions_by_address",
"description": "Gets transactions for an address"
},
{
"name": "get_token_transfers_by_address",
"description": "Returns ERC-20 token transfers for an address"
},
{
"name": "transaction_summary",
"description": "Provides a human-readable transaction summary"
},
{
"name": "nft_tokens_by_address",
"description": "Retrieves NFT tokens owned by an address"
},
{
"name": "get_block_info",
"description": "Returns detailed block information"
},
{
"name": "get_transaction_info",
"description": "Gets comprehensive transaction information"
},
{
"name": "get_transaction_logs",
"description": "Returns transaction logs with decoded event data"
},
{
"name": "read_contract",
"description": "Executes a read-only smart contract function"
}
],
"keywords": [
"blockchain",
"ethereum",
"evm",
"blockscout",
"arbitrum",
"optimism"
],
"license": "MIT"
}
2 changes: 1 addition & 1 deletion dxt/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"dxt_version": "0.1",
"name": "blockscout-mcp",
"display_name": "Blockscout",
"version": "0.1.0",
"version": "0.2.0",
"description": "Contextual blockchain activity analysis via Blockscout APIs",
"long_description": "This extension enables contextual blockchain activity analysis with multi-chain support, intelligent context optimization, smart response slicing, and seamless pagination. The server exposes blockchain data including balances, tokens, NFTs, contract metadata, transactions, and logs via MCP for comprehensive blockchain analysis. This extension acts as a proxy to the official Blockscout MCP server.",
"author": {
Expand Down