Skip to content

Deployment: Dockerfile and Smithery config #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
44 changes: 44 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use the official Node.js 18 image as the base image for building
FROM node:18-alpine AS builder

# Set the working directory
WORKDIR /app

# Copy the package.json and package-lock.json to the working directory
COPY package.json package-lock.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application source code
COPY . .

# Build the project
RUN npm run build

# Use a smaller Node.js image for the final image
FROM node:18-slim

# Set the working directory
WORKDIR /app

# Copy the built files from the builder stage
COPY --from=builder /app/build ./build
COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/package-lock.json ./package-lock.json

# Install only production dependencies
RUN npm ci --omit=dev

# Copy the .env.example to .env and instruct users to edit it with their API key
COPY .env.example .env

# Inform Docker that the container listens on port 80
EXPOSE 80

# Set the environment variable to ensure .env is used
ENV NODE_ENV=production

# Define the command to run the application
CMD ["node", "build/index.js"]
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# MCP Etherscan Server
[![smithery badge](https://smithery.ai/badge/@crazyrabbitLTC/mcp-etherscan-server)](https://smithery.ai/server/@crazyrabbitLTC/mcp-etherscan-server)

An MCP (Model Context Protocol) server that provides Ethereum blockchain data tools via Etherscan's API. Features include checking ETH balances, viewing transaction history, tracking ERC20 transfers, fetching contract ABIs, monitoring gas prices, and resolving ENS names.

Expand All @@ -18,6 +19,14 @@ An MCP (Model Context Protocol) server that provides Ethereum blockchain data to

## Installation

### Installing via Smithery

To install Etherscan Tools for Claude Desktop automatically via [Smithery](https://smithery.ai/server/@crazyrabbitLTC/mcp-etherscan-server):

```bash
npx -y @smithery/cli install @crazyrabbitLTC/mcp-etherscan-server --client claude
```

1. Clone the repository:
```bash
git clone [your-repo-url]
Expand Down
17 changes: 17 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Smithery configuration file: https://smithery.ai/docs/config#smitheryyaml

startCommand:
type: stdio
configSchema:
# JSON Schema defining the configuration options for the MCP.
type: object
required:
- etherscanApiKey
properties:
etherscanApiKey:
type: string
description: The API key for the Etherscan API.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({command: 'node', args: ['build/index.js'], env: {ETHERSCAN_API_KEY: config.etherscanApiKey}})