Skip to main content
Glama

Kube Core MCP

by Jess321995
test_server.py1.55 kB
import pytest from fastapi.testclient import TestClient from src.server import app, Message client = TestClient(app) def test_root_endpoint(): """Test the root endpoint""" response = client.get("/") assert response.status_code == 200 assert response.json() == {"status": "running", "service": "core-mcp-server"} def test_ping_message(): """Test handling of ping message""" message = { "type": "ping", "payload": {}, "metadata": None } response = client.post("/message", json=message) assert response.status_code == 200 assert response.json() == {"status": "pong"} def test_echo_message(): """Test handling of echo message""" test_data = {"test": "data"} message = { "type": "echo", "payload": test_data, "metadata": None } response = client.post("/message", json=message) assert response.status_code == 200 assert response.json() == {"status": "success", "data": test_data} def test_invalid_message_type(): """Test handling of invalid message type""" message = { "type": "invalid", "payload": {}, "metadata": None } response = client.post("/message", json=message) assert response.status_code == 400 assert "Unknown message type" in response.json()["detail"] def test_health_check(): """Test health check endpoint""" response = client.get("/health") assert response.status_code == 200 assert response.json() == {"status": "running", "service": "kube-core-mcp"}

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Jess321995/kube-core-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server