Skip to content
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ NODE_IP=localhost
ROUTING_TYPE=direct
ROUTING_URL=ws://node.naptha.ai:8765

# Naptha MCP Server
MCP_SERVER_PORT=8001

# rabbitmq instance
RMQ_USER=username
RMQ_PASSWORD=password
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -196,4 +196,5 @@ docker_compose_command.sh
user_private.pem
*.pem
node/inference/ollama/.gitkeep
node/inference/litellm/start_litellm.sh
node/inference/litellm/start_litellm.sh
node/mcp/start_mcp.sh
44 changes: 44 additions & 0 deletions Dockerfile-mcp
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM condaforge/miniforge3:24.9.2-0

WORKDIR /app

# use bash instead of sh
SHELL ["/bin/bash", "-c"]

# install deps
RUN apt-get update
RUN apt-get install gcc curl git -y

# add conda install to path; use base environment
ENV PATH="/opt/conda/bin:${PATH}"
RUN conda create -y -n mcp python=3.12
RUN echo "source activate mcp" > /root/.bashrc
ENV PATH="/opt/conda/envs/mcp/bin:$PATH"

# Install uv properly and add to PATH
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
ENV PATH="/root/.cargo/bin:/root/.local/bin:${PATH}"

# Copy MCP server code - copy to /app directly
COPY node/mcp .

# Create virtual environment with uv
RUN uv venv .venv

# Install pip explicitly in the virtual environment
RUN curl -sSL https://bootstrap.pypa.io/get-pip.py -o get-pip.py && \
.venv/bin/python get-pip.py && \
rm get-pip.py

# Install dependencies from pyproject.toml
RUN . .venv/bin/activate && \
uv pip install -e .

ENV PYTHONPATH=/app

# Expose MCP server port
EXPOSE 8001

# Command to run the server
CMD . .venv/bin/activate && \
python server.py --port 8001
24 changes: 24 additions & 0 deletions docker-compose.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,30 @@ services:
networks:
- naptha-network

mcp-server:
container_name: mcp-server
build:
context: .
dockerfile: Dockerfile-mcp
env_file:
- ./.env
restart: unless-stopped
ports:
- '${MCP_SERVER_PORT:-8001}:8001'
networks:
- naptha-network
# In development mode, mount the source code for live reloading
volumes:
- ./node/mcp:/app/node/mcp
- ./${PRIVATE_KEY}:/app/${PRIVATE_KEY}
develop:
watch:
- action: sync+restart
path: ./node/mcp
target: /app/node/mcp
- action: rebuild
path: ./node/mcp/pyproject.toml

volumes:
rabbitmq_data:
postgres_data:
Expand Down
14 changes: 14 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,20 @@ services:
networks:
- naptha-network

mcp-server:
container_name: mcp-server
build:
context: .
dockerfile: Dockerfile-mcp
env_file:
- ./.env
restart: unless-stopped
ports:
- '${MCP_SERVER_PORT:-8001}:8001'
networks:
- naptha-network
volumes:
- ./${PRIVATE_KEY}:/app/${PRIVATE_KEY}
volumes:
rabbitmq_data: # persist rabbitMQ data e.g. anything durable; users & credentials; configs
postgres_data:
Expand Down
Loading
Loading