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
76 changes: 76 additions & 0 deletions .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: build-deploy mcpserver

on:
pull_request: {}
release:
types: [published]
push:
branches:
- main

jobs:
build-arm:
if: (github.event_name != 'pull_request')
runs-on: ubuntu-latest
name: make and build arm
env:
container: ghcr.io/converged-computing/mcp-server
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: GHCR Login
if: (github.event_name != 'pull_request')
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Add custom buildx ARM builder
run: |
docker buildx create --name armbuilder
docker buildx use armbuilder
docker buildx inspect --bootstrap

- name: Build Container
run: make arm

- name: Tag Release Image
if: (github.event_name == 'release')
run: |
tag=${GITHUB_REF#refs/tags/}
echo "Tagging and releasing ${{ env.container }}:${tag}"
docker tag ${{ env.container }}:latest ${{ env.container }}:${tag}

- name: Deploy Container
run: make push

build:
permissions:
packages: write
runs-on: ubuntu-latest
name: build
env:
container: ghcr.io/converged-computing/mcp-server
steps:
- uses: actions/checkout@v4
- name: Build Container
run: make
- name: Tag Release Image
if: (github.event_name == 'release')
run: |
tag=${GITHUB_REF#refs/tags/}
echo "Tagging and releasing ${{ env.container }}:${tag}"
docker tag ${{ env.container }}:latest ${{ env.container }}:${tag}

- name: GHCR Login
if: (github.event_name != 'pull_request')
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy Container
if: (github.event_name != 'pull_request')
run: make push
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM python:3.12-slim

# Install system-level dependencies for HPC introspection
RUN apt-get update && apt-get install -y --no-install-recommends \
hwloc \
libhwloc-dev \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/code

WORKDIR /code
COPY . /code
RUN pip install --no-cache-dir .
EXPOSE 8089
ENTRYPOINT ["mcpserver", "start"]

# Default command if no arguments are provided.
# We bind to 0.0.0.0 so the server is reachable outside the container.
CMD ["-t", "http", "--host", "0.0.0.0", "--port", "8089"]
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
IMAGE_NAME ?= ghcr.io/converged-computing/mcp-server
IMAGE_TAG ?= latest
FULL_IMAGE_NAME = $(IMAGE_NAME):$(IMAGE_TAG)
FULL_ARM_IMAGE = $(IMAGE_NAME):arm
DOCKERFILE_PATH = Dockerfile
BUILD_CONTEXT = .

# Default target: builds the Docker image
all: build

# Build the Docker image
build:
@echo "Building Docker image $(FULL_IMAGE_NAME)..."
docker build \
-f $(DOCKERFILE_PATH) \
-t $(FULL_IMAGE_NAME) \
.
@echo "Docker image $(FULL_IMAGE_NAME) built successfully."

# Push the docker image
push:
@echo "Pushing image $(FULL_IMAGE_NAME)..."
docker push $(IMAGE_NAME) --all-tags

# Remove the image (clean with rmi)
clean:
@echo "Removing Docker image $(FULL_IMAGE_NAME)..."
docker rmi $(FULL_IMAGE_NAME) || true
@echo "Docker image $(FULL_IMAGE_NAME) removed (if it existed)."

arm:
@echo "Building arm Docker image $(FULL_IMAGE_NAME)..."
docker build \
-f $(DOCKERFILE_PATH) \
-t $(FULL_ARM_IMAGE) \
.
@echo "Docker image $(FULL_ARM_IMAGE) built successfully."

.PHONY: all build push clean arm
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,26 @@ It is recommended to open in VSCode container. Then install:
pip install --break-system-packages -e .
```

### Docker

To build the Docker container:

```bash
make
```

To run a dummy example:

```bash
docker run -p 8089:8089 -it ghcr.io/converged-computing/mcp-server:latest
```

And then interact from the outside:

```bash
python3 ./examples/echo/test_echo.py
```

### Environment

The following variables can be set in the environment.
Expand All @@ -68,7 +88,6 @@ The following variables can be set in the environment.

## Examples


### Simple Echo

Start the server in one terminal. Export `MCPSERVER_TOKEN` if you want some client to use simple token auth.
Expand Down
2 changes: 1 addition & 1 deletion mcpserver/cli/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def main(args, extra, **kwargs):

# stdio does not!
else:
mcp.run(transport=cfg.transport)
mcp.run(transport=cfg.server.transport)

# For testing we usually control+C, let's not make it ugly
except KeyboardInterrupt:
Expand Down
2 changes: 1 addition & 1 deletion mcpserver/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
__version__ = "0.0.1"
AUTHOR = "Vanessa Sochat"
AUTHOR_EMAIL = "vsoch@users.noreply.github.com"
NAME = "mcp-node"
NAME = "mcp-serve"
PACKAGE_URL = "https://github.com/converged-computing/mcp-server"
KEYWORDS = "cluster, orchestration, mcp, server, agents"
DESCRIPTION = "Agentic server to support MCP tools for science"
Expand Down