Skip to content
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

Deployment: Dockerfile and Smithery config #4

Merged
merged 4 commits into from
Feb 10, 2025
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
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Generated by https://smithery.ai. See: https://smithery.ai/docs/config#dockerfile
# Use Node.js 18 LTS (Gallium) as the base image
FROM node:18-bullseye-slim AS builder

# Set the working directory in the container
WORKDIR /app

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

# Install the dependencies
RUN npm install

# Copy the entire application to the working directory
COPY . .

# Build the application
RUN npm run build

# Use a smaller base image for production
FROM node:18-bullseye-slim AS production

# Set the working directory in the container
WORKDIR /app

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

# Set environment variables
ENV NODE_ENV=production
ENV SERVER_MODE=stdio

# Expose the port the app runs on
EXPOSE 3000

# Start the application
CMD ["node", "build/cli.js"]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<a href="https://github.com/AbdelStark/bitcoin-mcp/actions/workflows/ci.yml"><img alt="GitHub Workflow Status" src="https://img.shields.io/github/actions/workflow/status/AbdelStark/bitcoin-mcp/ci.yml?style=for-the-badge" height=30></a>
<a href="https://bitcoin.org/"> <img alt="Bitcoin" src="https://img.shields.io/badge/Bitcoin-000?style=for-the-badge&logo=bitcoin&logoColor=white" height=30></a>
<a href="https://modelcontextprotocol.com/"> <img alt="MCP" src="https://img.shields.io/badge/MCP-000?style=for-the-badge&logo=modelcontextprotocol&logoColor=white" height=30></a>
<a href="https://smithery.ai/server/@AbdelStark/bitcoin-mcp"><img alt="Smithery Badge" src="https://smithery.ai/badge/@AbdelStark/bitcoin-mcp"></a>
<a href="https://www.npmjs.com/package/bitcoin-mcp"><img alt="NPM Version" src="https://img.shields.io/npm/v/bitcoin-mcp?style=for-the-badge" height=30></a>

</div>
Expand Down
33 changes: 33 additions & 0 deletions smithery.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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:
- bitcoinNetwork
properties:
logLevel:
type: string
default: info
description: The log level for the server (e.g., info, debug, error).
bitcoinNetwork:
type: string
default: mainnet
description: The Bitcoin network to interact with (e.g., mainnet, testnet).
blockstreamApiBase:
type: string
description: The base URL for the Blockstream API.
serverMode:
type: string
default: stdio
description: The server mode (e.g., stdio, sse).
port:
type: number
default: 3000
description: The port for the server to run on.
commandFunction:
# A function that produces the CLI command to start the MCP on stdio.
|-
(config) => ({command:'node', args:['build/cli.js'], env: {LOG_LEVEL: config.logLevel || 'info', BITCOIN_NETWORK: config.bitcoinNetwork || 'mainnet', BLOCKSTREAM_API_BASE: config.blockstreamApiBase, SERVER_MODE: config.serverMode || 'stdio', PORT: config.port ? config.port.toString() : '3000'}})