Dockerfile•2.13 kB
# Generated by https://smithery.ai. See: https://smithery.ai/docs/build/project-config
FROM python:3.12-slim
WORKDIR /app
COPY pyproject.toml pyproject.toml
# Install uv for dependency management
RUN pip install uv
RUN uv pip install --system . # Install dependencies from pyproject.toml
COPY blockscout_mcp_server /app/blockscout_mcp_server
ENV PYTHONUNBUFFERED=1
# Expose environment variables that can be set at runtime
# Set defaults here to document expected environment variables
# ENV BLOCKSCOUT_BS_API_KEY="" # It is commented out because docker build warns about sensitive data in ENV instructions
ENV BLOCKSCOUT_BS_TIMEOUT="120.0"
ENV BLOCKSCOUT_BS_REQUEST_MAX_RETRIES="3"
ENV BLOCKSCOUT_BENS_URL="https://bens.services.blockscout.com"
ENV BLOCKSCOUT_BENS_TIMEOUT="30.0"
ENV BLOCKSCOUT_METADATA_URL="https://metadata.services.blockscout.com"
ENV BLOCKSCOUT_METADATA_TIMEOUT="30.0"
ENV BLOCKSCOUT_CHAINSCOUT_URL="https://chains.blockscout.com"
ENV BLOCKSCOUT_CHAINSCOUT_TIMEOUT="15.0"
ENV BLOCKSCOUT_CHAIN_CACHE_TTL_SECONDS="1800"
ENV BLOCKSCOUT_CHAINS_LIST_TTL_SECONDS="300"
ENV BLOCKSCOUT_PROGRESS_INTERVAL_SECONDS="15.0"
ENV BLOCKSCOUT_CONTRACTS_CACHE_MAX_NUMBER="10"
ENV BLOCKSCOUT_CONTRACTS_CACHE_TTL_SECONDS="3600"
ENV BLOCKSCOUT_NFT_PAGE_SIZE="10"
ENV BLOCKSCOUT_LOGS_PAGE_SIZE="10"
ENV BLOCKSCOUT_ADVANCED_FILTERS_PAGE_SIZE="10"
ENV BLOCKSCOUT_RPC_REQUEST_TIMEOUT="60.0"
ENV BLOCKSCOUT_RPC_POOL_PER_HOST="50"
ENV BLOCKSCOUT_MCP_USER_AGENT="Blockscout MCP"
# ENV BLOCKSCOUT_MIXPANEL_TOKEN="" # Intentionally commented out: pass at runtime to avoid embedding secrets in image
ENV BLOCKSCOUT_MIXPANEL_API_HOST=""
ENV BLOCKSCOUT_DISABLE_COMMUNITY_TELEMETRY="false"
ENV BLOCKSCOUT_INTERMEDIARY_HEADER="Blockscout-MCP-Intermediary"
ENV BLOCKSCOUT_INTERMEDIARY_ALLOWLIST="ClaudeDesktop,HigressPlugin"
# Set the default transport mode. Can be overridden at runtime with -e.
# Options: "stdio" (default), "http"
ENV BLOCKSCOUT_MCP_TRANSPORT="stdio"
ENV PORT="8000"
# Expose the default port. This can be overridden at runtime by the PORT environment variable.
EXPOSE 8000
CMD ["python", "-m", "blockscout_mcp_server"]