Skip to content

Commit b25ee7e

Browse files
committed
fix: Force minimal Dockerfile for hello world test
1 parent ad5a40e commit b25ee7e

16 files changed

+625
-15
lines changed

Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
FROM python:3.11-slim
22
WORKDIR /app
3-
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
43
RUN groupadd -r app && useradd --no-log-init -r -m -g app app
5-
RUN pip install uv
6-
COPY pyproject.toml uv.lock* LICENSE README.md ./
4+
COPY hello-mcp-test/server.py .
75
RUN chown -R app:app /app
86
USER app
9-
RUN uv sync
10-
COPY --chown=app:app . .
11-
ARG WITH_DEV=false
12-
RUN if [ "$WITH_DEV" = "true" ]; then uv pip install -e ".[dev]"; else uv pip install -e .; fi
13-
CMD ["uv", "run", "python", "-m", "gx_mcp_instant"]
7+
CMD ["python", "server.py"]

Dockerfile.hello

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM python:3.11-slim
2+
WORKDIR /app
3+
RUN groupadd -r app && useradd --no-log-init -r -m -g app app
4+
RUN pip install uv
5+
COPY pyproject-hello.toml pyproject.toml
6+
COPY src/gx_mcp_hello/ gx_mcp_hello/
7+
RUN chown -R app:app /app
8+
USER app
9+
RUN uv sync
10+
RUN uv pip install -e .
11+
CMD ["uv", "run", "python", "-m", "gx_mcp_hello"]

Dockerfile.http-instant

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM python:3.11-slim
2+
WORKDIR /app
3+
RUN groupadd -r app && useradd --no-log-init -r -m -g app app
4+
RUN pip install uv
5+
COPY pyproject-http-instant.toml pyproject.toml
6+
COPY src/gx_mcp_http_instant/ gx_mcp_http_instant/
7+
RUN chown -R app:app /app
8+
USER app
9+
RUN uv sync
10+
RUN uv pip install -e .
11+
EXPOSE 8000
12+
CMD ["uv", "run", "python", "-m", "gx_mcp_http_instant", "8000"]

hello-mcp-test/Dockerfile.backup

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM python:3.11-slim
2+
WORKDIR /app
3+
RUN groupadd -r app && useradd --no-log-init -r -m -g app app
4+
COPY server.py .
5+
RUN chown -R app:app /app
6+
USER app
7+
CMD ["python", "server.py"]

hello-mcp-test/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Hello MCP Test
2+
3+
Ultra-minimal MCP server to test Smithery deployment.
4+
5+
## What it does
6+
- Single `hello` tool that says "Hello, {name}!"
7+
- Zero dependencies (pure Python stdlib)
8+
- STDIO transport like the working calculator example
9+
10+
## Test locally
11+
```bash
12+
cd hello-mcp-test
13+
docker build -t hello-mcp-test .
14+
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}' | docker run --rm -i hello-mcp-test
15+
```
16+
17+
## Deploy to Smithery
18+
1. Build and push: `docker build -t davidf9999/hello-mcp-test:latest . && docker push davidf9999/hello-mcp-test:latest`
19+
2. Deploy with smithery.yaml
20+
21+
## Expected result
22+
- If this works → Problem is with GX dependencies/complexity
23+
- If this fails → Problem is with Smithery STDIO setup

hello-mcp-test/server.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Hello World MCP Server - Absolute minimal test
4+
Zero dependencies beyond Python standard library
5+
Tests basic STDIO MCP functionality on Smithery
6+
"""
7+
8+
import json
9+
import sys
10+
11+
def main():
12+
"""Main server loop - pure STDIO MCP protocol."""
13+
for line in sys.stdin:
14+
try:
15+
line = line.strip()
16+
if not line:
17+
continue
18+
19+
request = json.loads(line)
20+
method = request.get("method")
21+
request_id = request.get("id")
22+
23+
if method == "initialize":
24+
response = {
25+
"jsonrpc": "2.0",
26+
"id": request_id,
27+
"result": {
28+
"protocolVersion": "2024-11-05",
29+
"capabilities": {"tools": {"listChanged": False}},
30+
"serverInfo": {"name": "hello-mcp", "version": "1.0.0"}
31+
}
32+
}
33+
34+
elif method == "tools/list":
35+
response = {
36+
"jsonrpc": "2.0",
37+
"id": request_id,
38+
"result": {
39+
"tools": [{
40+
"name": "hello",
41+
"description": "Say hello",
42+
"inputSchema": {
43+
"type": "object",
44+
"properties": {"name": {"type": "string", "default": "World"}}
45+
}
46+
}]
47+
}
48+
}
49+
50+
elif method == "tools/call":
51+
tool_name = request["params"]["name"]
52+
arguments = request["params"].get("arguments", {})
53+
54+
if tool_name == "hello":
55+
name = arguments.get("name", "World")
56+
result = f"Hello, {name}! 👋 MCP server working on Smithery!"
57+
58+
response = {
59+
"jsonrpc": "2.0",
60+
"id": request_id,
61+
"result": {
62+
"content": [{"type": "text", "text": result}]
63+
}
64+
}
65+
else:
66+
response = {
67+
"jsonrpc": "2.0",
68+
"id": request_id,
69+
"error": {"code": -32601, "message": f"Unknown tool: {tool_name}"}
70+
}
71+
72+
else:
73+
response = {
74+
"jsonrpc": "2.0",
75+
"id": request_id,
76+
"error": {"code": -32601, "message": f"Method not found: {method}"}
77+
}
78+
79+
print(json.dumps(response), flush=True)
80+
81+
except Exception as e:
82+
error_response = {
83+
"jsonrpc": "2.0",
84+
"id": request.get("id") if 'request' in locals() else None,
85+
"error": {"code": -32603, "message": f"Error: {str(e)}"}
86+
}
87+
print(json.dumps(error_response), flush=True)
88+
89+
if __name__ == "__main__":
90+
main()

pyproject-hello.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "gx-mcp-server"
7+
version = "2.0.2"
8+
description = "Hello World MCP Server - Minimal test"
9+
authors = [{ name = "David Front", email = "[email protected]" }]
10+
requires-python = ">=3.11"
11+
dependencies = []
12+
13+
[project.scripts]
14+
gx-mcp-server = "gx_mcp_hello.server:main"
15+
16+
[tool.hatch.build.targets.wheel]
17+
packages = ["gx_mcp_hello"]

pyproject-http-instant.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[build-system]
2+
requires = ["hatchling"]
3+
build-backend = "hatchling.build"
4+
5+
[project]
6+
name = "gx-mcp-server"
7+
version = "2.0.2"
8+
description = "HTTP Instant GX MCP Server"
9+
authors = [{ name = "David Front", email = "[email protected]" }]
10+
requires-python = ">=3.11"
11+
dependencies = [
12+
"pandas>=1.5",
13+
"fastapi>=0.100.0",
14+
"uvicorn>=0.20.0",
15+
]
16+
17+
[project.scripts]
18+
gx-mcp-server = "gx_mcp_http_instant.server:main"
19+
20+
[tool.hatch.build.targets.wheel]
21+
packages = ["gx_mcp_http_instant"]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Issues = "https://github.com/dfront/gx-mcp-server/issues"
7272
Documentation = "https://github.com/dfront/gx-mcp-server#readme"
7373

7474
[tool.hatch.build.targets.wheel]
75-
packages = ["gx_mcp_server", "src/gx_mcp_stdio", "src/gx_mcp_simple", "src/gx_mcp_minimal", "src/gx_mcp_instant"]
75+
packages = ["gx_mcp_server", "src/gx_mcp_stdio", "src/gx_mcp_simple", "src/gx_mcp_minimal", "src/gx_mcp_instant", "src/gx_mcp_http_instant"]
7676

7777
[tool.black]
7878
line-length = 88

smithery.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
# smithery.yaml – container-based STDIO server, no user config needed
22
runtime: container
3-
image: "davidf9999/gx-mcp-server:latest"
3+
image: "davidf9999/hello-mcp-test:latest"
44

55
startCommand:
6-
type: stdio # use STDIO transport (like calculator)
7-
configSchema: # empty schema ⇒ no API keys required
6+
type: stdio
7+
configSchema:
88
type: object
9-
description: "No configuration necessary"
9+
description: "No configuration needed"
1010
exampleConfig: {}
1111

1212
metadata:
13-
name: "gx-mcp-server"
14-
description: "Expose Great Expectations data-quality checks as MCP tools"
13+
name: "hello-mcp-test"
14+
description: "Minimal MCP server test for Smithery debugging"
1515
homepage: "https://github.com/davidf9999/gx-mcp-server"
1616
tags: ["data-quality", "great-expectations"]

0 commit comments

Comments
 (0)