Skip to content

Commit 7af12a1

Browse files
Fix dependency vulns and Dockerfile python version mismatch (#206)
* Fix high/critical dependency vulns and FastMCP init compatibility * Add fastmcp.json to declare environment dependencies metadata * fix(docker): match builder python version to pyatlan runtime The switch to pyatlan base image in b8157d6 introduced two issues: 1. Builder stage used Python 3.12 while the pyatlan runtime image uses Python 3.11. Packages compiled against 3.12 (C extensions, bytecode) can fail on 3.11 at runtime. 2. The venv python symlink pointed to /usr/local/bin/python (builder path) which does not exist in the pyatlan runtime image where python lives at /usr/bin/python3. This caused the venv to be silently skipped, falling back to the system python without any of the installed dependencies (fastmcp, uvicorn, etc). Changes: - Builder image changed from python3.12 to python3.11 - Added symlink fixup after COPY to repoint venv python to the runtime's /usr/bin/python3
1 parent b8157d6 commit 7af12a1

5 files changed

Lines changed: 537 additions & 102 deletions

File tree

modelcontextprotocol/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Use a Python image with uv pre-installed
2-
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS builder
2+
FROM ghcr.io/astral-sh/uv:python3.11-bookworm-slim AS builder
33

44
# Set environment variables for build
55
ENV PYTHONDONTWRITEBYTECODE=1 \
@@ -22,6 +22,10 @@ WORKDIR /home/nonroot/app
2222

2323
COPY --from=builder --chown=nonroot:nonroot /app /home/nonroot/app
2424

25+
# Fix venv python symlink: builder has python at /usr/local/bin, runtime at /usr/bin
26+
RUN ln -sf /usr/bin/python3 /home/nonroot/app/.venv/bin/python && \
27+
ln -sf /usr/bin/python3 /home/nonroot/app/.venv/bin/python3
28+
2529
# Set the PATH to use the virtual environment
2630
ENV PATH="/home/nonroot/app/.venv/bin:$PATH"
2731

modelcontextprotocol/fastmcp.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"entrypoint": "server.py",
3+
"environment": {
4+
"dependencies": ["pyatlan", "fastmcp"]
5+
}
6+
}

modelcontextprotocol/pyproject.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,24 @@ classifiers = [
1616
]
1717

1818
dependencies = [
19-
"fastmcp==2.13.2",
19+
"fastmcp>=2.14.0",
2020
"pyatlan>=6.0.1",
2121
"uvicorn>=0.35.0"
2222
]
2323

2424
[project.scripts]
2525
atlan-mcp-server = "server:main"
2626

27+
[tool.uv]
28+
constraint-dependencies = [
29+
"authlib>=1.6.6",
30+
"cryptography>=46.0.5",
31+
"h11>=0.16.0",
32+
"python-multipart>=0.0.22",
33+
"starlette>=0.49.1",
34+
"urllib3>=2.6.3",
35+
]
36+
2737
[project.urls]
2838
"Homepage" = "https://github.com/atlanhq/agent-toolkit"
2939
"Documentation" = "https://ask.atlan.com/hc/en-us/articles/12525731740175-How-to-implement-the-Atlan-MCP-server"

modelcontextprotocol/server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
from settings import get_settings
3333

3434

35-
mcp = FastMCP("Atlan MCP Server", dependencies=["pyatlan", "fastmcp"])
35+
mcp = FastMCP("Atlan MCP Server")
3636

3737
# Get restricted tools from environment variable or use default
3838
restricted_tools_env = os.getenv("RESTRICTED_TOOLS", "")

0 commit comments

Comments
 (0)