Skip to content

Commit 400ad3c

Browse files
committed
remote sse setup
1 parent 688cfd0 commit 400ad3c

File tree

4 files changed

+452
-4
lines changed

4 files changed

+452
-4
lines changed

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Use a Python image with uv pre-installed
2+
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
3+
4+
# Install the project into `/app`
5+
WORKDIR /app
6+
7+
# Enable bytecode compilation
8+
ENV UV_COMPILE_BYTECODE=1
9+
10+
# Copy from the cache instead of linking since it's a mounted volume
11+
ENV UV_LINK_MODE=copy
12+
13+
COPY pyproject.toml pyproject.toml
14+
COPY uv.lock uv.lock
15+
16+
# Install the project's dependencies using the lockfile and settings
17+
RUN uv sync --frozen --no-install-project --no-dev
18+
19+
# Then, add the rest of the project source code and install it
20+
# Installing separately from its dependencies allows optimal layer caching
21+
ADD . /app
22+
RUN uv sync --frozen --no-dev
23+
24+
# Place executables in the environment at the front of the path
25+
ENV PATH="/app/.venv/bin:$PATH"
26+
27+
# Reset the entrypoint, don't invoke `uv`
28+
ENTRYPOINT []
29+
30+
# Run the FastAPI application by default
31+
# Uses `fastapi dev` to enable hot-reloading when the `watch` sync occurs
32+
# Uses `--host 0.0.0.0` to allow access from outside the container
33+
CMD ["uvicorn", "--host", "0.0.0.0", "--port", "8080", "inkeep_mcp_server.app:app"]

inkeep_mcp_server/app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from fastapi import FastAPI
2+
3+
from inkeep_mcp_server.server import mcp
4+
5+
app = FastAPI()
6+
7+
app.mount("/", mcp.sse_app())

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ description = "Inkeep MCP Server"
55
readme = "README.md"
66
requires-python = ">=3.10"
77
dependencies = [
8+
"fastapi[standard]>=0.115.12",
89
"mcp[cli]>=1.3.0",
910
"openai>=1.66.3",
1011
"pydantic-settings>=2.8.1",
@@ -15,4 +16,4 @@ dev = [
1516
"black>=25.1.0",
1617
"ipython>=8.34.0",
1718
"isort>=6.0.1",
18-
]
19+
]

0 commit comments

Comments
 (0)