-
-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (25 loc) · 1.17 KB
/
Copy pathDockerfile
File metadata and controls
29 lines (25 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Containerized tree-sitter-analyzer MCP server (stdio transport).
#
# Built from the repo source so the image always matches the committed code.
# Used by MCP indexers (e.g. Glama) to launch and introspect the server, and
# by anyone who wants to run the MCP server in a container.
#
# Build: docker build -t tree-sitter-analyzer-mcp .
# Run: docker run --rm -i --user "$(id -u):$(id -g)" \
# -v "$PWD:/work" -w /work tree-sitter-analyzer-mcp
# (the server speaks MCP over stdio; -i keeps stdin open. --user runs
# as the host UID/GID so the .ast-cache, decision journal, and any
# `edit`/`refactor` writes under the bind-mounted repo are owned by you,
# not root. Glama-style introspection needs no bind mount, so the bare
# image is fine there.)
FROM python:3.12-slim
# Prebuilt tree-sitter wheels mean no compiler is needed on the slim image.
ENV PIP_NO_CACHE_DIR=1 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
WORKDIR /app
COPY . /app
# Install the package with the MCP extra from the local source.
RUN pip install ".[mcp]"
# The MCP server entry point speaks JSON-RPC over stdio.
ENTRYPOINT ["tree-sitter-analyzer-mcp"]