Skip to content

Commit f6f4739

Browse files
committed
feat: improve Docker setup, publish to GHCR, and enhance test client
- Add --allow-net to Dockerfile CMD for Deno network access - Add .dockerignore to reduce image size and exclude unneeded files - Update GitHub Actions workflow to publish to GitHub Container Registry (GHCR) - Improve integration test client with assertions for automated validation
1 parent a3524f0 commit f6f4739

File tree

4 files changed

+26
-4
lines changed

4 files changed

+26
-4
lines changed

.github/workflows/docker-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ jobs:
2727
with:
2828
context: ./mcp-run-python
2929
push: true
30-
tags: yourdockerhubuser/mcp-run-python:latest
30+
tags: ghcr.io/${{ github.repository_owner }}/mcp-run-python:latest

mcp-run-python/.dockerignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Ignore Python artifacts
2+
__pycache__/
3+
*.pyc
4+
*.pyo
5+
*.pyd
6+
7+
# Ignore test files
8+
test_*
9+
tests/
10+
*.log
11+
12+
# Ignore Git and local config files
13+
.git
14+
.gitignore
15+
.env
16+
*.md
17+
18+
# Node modules - unnecessary in container for Deno
19+
node_modules/

mcp-run-python/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ COPY . .
1111
EXPOSE 3101
1212

1313
# Default command: run MCP Run Python server in SSE mode with health check endpoint
14-
CMD ["run", "-N", "-R=node_modules", "-W=node_modules", "--node-modules-dir=auto", "jsr:@pydantic/mcp-run-python", "sse", "--port=3101"]
14+
CMD ["run", "--allow-net=0.0.0.0:3101", "-N", "-R=node_modules", "-W=node_modules", "--node-modules-dir=auto", "jsr:@pydantic/mcp-run-python", "sse", "--port=3101"]

mcp-run-python/test_mcp_client.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ async def main():
1111
result = await session.call_tool('run_python_code', {'python_code': "print('hello world')"})
1212
content = result.content[0]
1313
if isinstance(content, types.TextContent):
14-
print(content.text)
14+
print("Received:", content.text)
15+
assert content.text.strip() == "hello world", "Unexpected response from server"
1516
else:
16-
print(content)
17+
raise ValueError("Unexpected content type:", content)
18+
19+
1720

1821

1922
if __name__ == '__main__':

0 commit comments

Comments
 (0)