INNER CODE UNIT · Python

handle_request

Arthur-Ficial/apfel · mcp/http-test-server/server.py:138

def handle_request(body):
    method = body.get("method", "")
    req_id = body.get("id")
    params = body.get("params", {})

    if method == "initialize":
        return {
            "jsonrpc": "2.0",
            "id": req_id,
            "result": {
                "protocolVersion": PROTOCOL_VERSION,
                "capabilities": {"tools": {}},
                "serverInfo": {"name": SERVER_NAME, "version": SERVER_VERSION},
            },
        }, 200

    if method in ("notifications/initialized", "initialized"):
        return None, 202

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…