2424
2525 - name : Install jq
2626 run : sudo apt-get install -y jq
27-
27+
2828 - name : Run docker compose
2929 uses :
hoverkraft-tech/[email protected] 3030 with :
@@ -34,65 +34,60 @@ jobs:
3434 - name : Wait for services to be ready
3535 run : |
3636 echo "Waiting for services to be ready..."
37- # Longer wait time for services
3837 sleep 60
39- # Show running containers
4038 docker ps
4139
4240 - name : Verify container readiness
4341 run : |
4442 echo "Checking Docker container status..."
4543 docker ps
4644
47- # Check if all containers are running
48- if ! docker ps | grep -q api; then
49- echo "ERROR: API container is not running!"
50- echo "Building container logs:"
51- docker compose logs --tail=100 api
52- exit 1
53- fi
54-
55- if ! docker ps | grep -q mcp-server; then
56- echo "ERROR: MCP server container is not running!"
57- docker compose logs --tail=100 mcp-server
58- exit 1
59- fi
60-
61- if ! docker ps | grep -q mcp-proxy; then
62- echo "ERROR: MCP proxy container is not running!"
63- docker compose logs --tail=100 mcp-proxy
64- exit 1
65- fi
66-
67- echo "All required containers are running."
45+ for container in api mcp-server mcp-proxy; do
46+ if ! docker ps | grep -q "$container"; then
47+ echo "ERROR: $container is not running!"
48+ docker compose logs --tail=100 "$container"
49+ exit 1
50+ fi
51+ done
52+
53+ echo "All containers are running."
6854 echo "API container logs:"
6955 docker logs $(docker ps -q --filter name=api)
70-
56+
7157 echo "Waiting 30 more seconds for services to stabilize..."
7258 sleep 30
7359
74- - name : Install cmcp client
60+ - name : Install cmcp client (latest version)
61+ run : |
62+ pip install --upgrade cmcp
63+ echo "cmcp version:"
64+ cmcp --version
65+ echo "cmcp help output:"
66+ cmcp --help
67+
68+ - name : Check MCP proxy port binding
7569 run : |
76- pip install cmcp
70+ echo "Checking if anything is listening on port 3000..."
71+ sudo lsof -i :3000 || echo "Nothing found on port 3000"
72+ curl --fail --silent http://localhost:3000/tools/list || echo "Port 3000 not responding"
7773
78- - name : Test FastAPI endpoints with better error handling
74+ - name : Test FastAPI endpoints
7975 run : |
8076 echo "Testing FastAPI /mcp/compile endpoint..."
8177 RESPONSE=$(curl -s -S -f -X POST http://localhost:8000/mcp/compile \
8278 -H "Content-Type: application/json" \
8379 -d '{
8480 "code": "[filename: Cargo.toml]\n[package]\nname = \"hello_world\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[dependencies]\n\n[filename: src/main.rs]\nfn main() {\n println!(\"Hello, World!\");\n}"
8581 }' || echo "CURL_FAILED")
86-
82+
8783 if [ "$RESPONSE" = "CURL_FAILED" ]; then
88- echo "Failed to connect to FastAPI service. Debug information: "
84+ echo "Failed to connect to FastAPI service"
8985 docker ps
9086 docker logs $(docker ps -q --filter name=api)
9187 exit 1
9288 fi
93-
9489 echo "$RESPONSE" | jq || echo "$RESPONSE"
95-
90+
9691 echo "Testing FastAPI /mcp/compile-and-fix endpoint..."
9792 RESPONSE=$(curl -s -S -f -X POST http://localhost:8000/mcp/compile-and-fix \
9893 -H "Content-Type: application/json" \
@@ -101,38 +96,42 @@ jobs:
10196 "description": "A simple hello world program",
10297 "max_attempts": 3
10398 }' || echo "CURL_FAILED")
104-
99+
105100 if [ "$RESPONSE" = "CURL_FAILED" ]; then
106- echo "Failed to connect to FastAPI service. Debug information: "
101+ echo "Failed to connect to FastAPI service"
107102 docker ps
108103 docker logs $(docker ps -q --filter name=api)
109104 exit 1
110105 fi
111-
112- echo "$RESPONSE"
106+ echo "$RESPONSE" | jq || echo "$RESPONSE"
113107
114108 - name : Test MCP Server with cmcp client
115109 run : |
116110 echo "Testing MCP server compile method..."
117111 echo '{
118112 "code": "[filename: Cargo.toml]\n[package]\nname = \"hello_world\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[dependencies]\n\n[filename: src/main.rs]\nfn main() {\n println!(\"Hello, World!\");\n}"
119- }' | cmcp tools/call http://localhost:3000 rust-compiler compile
113+ }' | cmcp tools/call http://localhost:3000 rust-compiler compile || {
114+ echo "MCP compile test failed"
115+ exit 1
116+ }
120117
121118 echo "Testing MCP server compileAndFix method..."
122119 echo '{
123120 "code": "[filename: Cargo.toml]\n[package]\nname = \"hello_world\"\nversion = \"0.1.0\"\nedition = \"2021\"\n\n[dependencies]\n\n[filename: src/main.rs]\nfn main() {\n println!(\"Hello, World!\" // Missing closing parenthesis\n}",
124- "description": "A simple hello world program",
121+ "description": "A simple hello world program",
125122 "max_attempts": 3
126- }' | cmcp tools/call http://localhost:3000 rust-compiler compileAndFix
127-
123+ }' | cmcp tools/call http://localhost:3000 rust-compiler compileAndFix || {
124+ echo "MCP compileAndFix test failed"
125+ exit 1
126+ }
128127
129128 - name : Check Docker logs on failure
130129 if : failure()
131130 run : |
132131 echo "Checking Docker logs for troubleshooting..."
133132 docker compose logs || echo "Failed to get logs"
134-
133+
135134 - name : Check MCP proxy logs
136135 run : |
137136 echo "MCP proxy logs:"
138- docker logs $(docker ps -a -q --filter name=mcp-proxy) || echo "Failed to get MCP proxy logs"
137+ docker logs $(docker ps -a -q --filter name=mcp-proxy) || echo "Failed to get MCP proxy logs"
0 commit comments