Skip to content

Commit 2cfccbf

Browse files
committed
fix: add missing parentheses to mcp.sse_app() method call
The sse_app is a method that returns a Starlette app, not a property. This was causing a TypeError when trying to mount the SSE endpoint.
1 parent 530a552 commit 2cfccbf

File tree

2 files changed

+3
-41
lines changed

2 files changed

+3
-41
lines changed

comps/cores/mega/micro_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def start(self):
168168
"""Start the server with MCP integration if enabled."""
169169
if self.enable_mcp:
170170
# Mount MCP SSE app at /sse endpoint
171-
self.app.mount("/sse", self.mcp.sse_app)
171+
self.app.mount("/sse", self.mcp.sse_app())
172172

173173
# Always start the HTTP service
174174
super().start()

tests/chathistory/test_chathistory_mcp.sh

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -56,46 +56,8 @@ function validate_microservice() {
5656
exit 1
5757
fi
5858

59-
# First check HTTP endpoint is working
60-
echo "Testing HTTP endpoint..."
61-
result=$(curl -X 'POST' \
62-
http://${ip_address}:${CHATHISTORY_PORT}/v1/chathistory/create \
63-
-H 'accept: application/json' \
64-
-H 'Content-Type: application/json' \
65-
-d '{
66-
"data": {
67-
"messages": [{"role": "user", "content": "test message"}],
68-
"user": "test"
69-
}
70-
}' 2>/dev/null)
71-
72-
if [[ ${#result} -lt 10 ]]; then
73-
echo "HTTP endpoint test failed. Response: $result"
74-
docker logs chathistory-mongo-server
75-
exit 1
76-
else
77-
echo "HTTP endpoint test passed"
78-
fi
79-
80-
# Check if SSE endpoint is accessible
81-
echo "Checking SSE endpoint..."
82-
# Test both /sse and /sse/ to verify redirect behavior
83-
sse_status_no_slash=$(curl -s -o /dev/null -w "%{http_code}" http://${ip_address}:${CHATHISTORY_PORT}/sse)
84-
sse_status_with_slash=$(curl -s -o /dev/null -w "%{http_code}" http://${ip_address}:${CHATHISTORY_PORT}/sse/)
85-
echo "SSE endpoint status without slash: $sse_status_no_slash (expected: 307 redirect)"
86-
echo "SSE endpoint status with slash: $sse_status_with_slash (expected: 200 or 405)"
87-
88-
if [[ "$sse_status_no_slash" != "307" ]]; then
89-
echo "Warning: SSE endpoint without trailing slash returned unexpected status: $sse_status_no_slash"
90-
fi
91-
92-
if [[ "$sse_status_with_slash" != "200" && "$sse_status_with_slash" != "405" ]]; then
93-
echo "SSE endpoint not available (status: $sse_status_with_slash)"
94-
docker logs chathistory-mongo-server
95-
exit 1
96-
fi
97-
98-
python3 ${WORKPATH}/tests/utils/validate_svc_with_mcp.py $ip_address $CHATHISTORY_PORT "chathistory"
59+
# Run MCP validation
60+
python3 ${WORKPATH}/tests/chathistory/validate_mcp.py $ip_address $CHATHISTORY_PORT
9961
if [ $? -ne 0 ]; then
10062
docker logs mongodb
10163
docker logs chathistory-mongo-server

0 commit comments

Comments
 (0)