INNER CODE UNIT · Python
_handle_initialize
stevesolun/ctx · src/ctx/mcp_server/server.py:142
def _handle_initialize(state: _ServerState, params: dict[str, Any]) -> dict[str, Any]:
"""Respond to the client's initialize handshake.
We accept any ``protocolVersion`` string the client sends — MCP
versions are date-stamped so a mismatch isn't inherently fatal,
and our tool catalogue uses only the stable tools/* API.
"""
state.initialized = True
return {
"protocolVersion": _PROTOCOL_VERSION,
"capabilities": {
# We advertise tools but not resources / prompts / sampling.
"tools": {},
},
"serverInfo": {
"name": _SERVER_NAME,
"version": _SERVER_VERSION,
},