Skip to content

fix(docker): build the image from the repository and fix the documented setups - #214

Merged
chadha-sridi merged 1 commit into
masterfrom
fix/docker
Nov 24, 2026
Merged

chadha-sridi merged 1 commit into
masterfrom
fix/docker

Conversation

@chadha-sridi

Copy link
Copy Markdown
Contributor

Supersedes #75, #77, and #149. Thanks @MH0386 for #75 and #77, which pointed at the same problems.

Problem

The Dockerfile installs mcp-server-qdrant from PyPI, then runs it with uvx. I built it from master and checked each documented setup:

What happens on master
Image contents 0.8.1 from PyPI, with fastmcp 2.7.0 (the version with the CVE from #173), whatever code the repository holds
Container start uvx ignores that install and downloads every dependency from PyPI again, on every start, at whatever version is current
README docker run example The server listens on 127.0.0.1 inside the container, so it can't be reached (HTTP 000). The example sets FASTMCP_HOST, which fastmcp 2.7 doesn't read
Local mode (QDRANT_LOCAL_PATH) Fails at startup: If 'local_path' is set, 'location' and 'api_key' must be None, because the Dockerfile sets QDRANT_URL="" and QDRANT_API_KEY=""
README VS Code configs (docker run -i) Hang: the container starts an SSE server and never answers initialize on stdin

Changes

Dockerfile

  • Builds the code in the checkout with uv sync --locked --no-dev, so the image has the dependency versions from uv.lock, the ones CI tests. Nothing is downloaded when the container starts.
  • python:3.13-slim: the newest Python version CI tests. All dependencies have 3.14 wheels, but CI doesn't run 3.14.
  • Sets FASTMCP_HOST=0.0.0.0, so the server is reachable without extra flags.
  • No longer sets QDRANT_URL and QDRANT_API_KEY to empty strings, so local mode works.
  • Runs as an unprivileged user (mcp, uid 1000). /data is owned by that user, so a volume mounted there is writable.
  • Dependencies are installed before the source is copied, so code changes rebuild quickly.
  • uv is copied from the official image at a pinned version, and UV_PYTHON_DOWNLOADS=never keeps it on the image's Python.
  • Adds a .dockerignore, so .venv, .git, and caches stay out of the build context.

The default command is still mcp-server-qdrant --transport sse, so existing docker run setups keep working.

README

  • The VS Code Docker configs and both install badges run mcp-server-qdrant --transport stdio and drop the unused -p 8000:8000.
  • Adds a stdio example and a local-mode example with a volume, and notes that the image sets FASTMCP_HOST.
  • Adds a note to set QDRANT_URL or QDRANT_LOCAL_PATH: with neither, the server connects to localhost:6333, which inside the container is the container itself. To reach Qdrant on the host, use host.docker.internal.

Behavior change

The image now runs the code it was built from, instead of downloading the latest PyPI release each time it starts. To update, rebuild the image.

Testing

Built the image and checked each case against Qdrant 1.20.0 in Docker:

  • The image contains the repository's code (0.9.0, fastmcp 4.1.6) and runs as mcp.
  • The container starts in about 7 seconds with nothing downloaded, and listens on 0.0.0.0.
  • From the host over SSE, with only QDRANT_URL and COLLECTION_NAME set: qdrant-store and qdrant-find work.
  • Local mode with QDRANT_LOCAL_PATH=/data on a named volume: store and find work, and the data is still there in a new container.
  • The stdio command from the README: an MCP client connects, lists both tools, and qdrant-find works. I drove it with a client script, not VS Code itself.
  • A container reaches a Qdrant running on the host through host.docker.internal (Docker Desktop on macOS).

No Python code changes; the test suite and pre-commit pass.

🤖 Generated with Claude Code

…ed setups

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@AstraBert AstraBert left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! A good add-on would be to actually build and distribute the docker image as a GHCR image from our github actions, but that's not strictly required

@chadha-sridi
chadha-sridi merged commit d858b29 into master Nov 24, 2026
5 checks passed
@chadha-sridi

Copy link
Copy Markdown
Contributor Author

@AstraBert thanks! I like the idea, it would also make the VS Code Docker badge work without a local build. Since we're planning to sunset the server, do you think it's worth adding a new distribution channel now? If yes, I'll add the workflow before the 0.9.0 release so the first image matches it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants