#!/usr/bin/env python3
"""Launch MONIKA as an MCP server.

This script starts MONIKA in MCP server mode, exposing its runtime,
memory, introspection, and training capabilities through the Model Context Protocol.

Usage:
    # Start fresh server
    python start_mcp_server.py

    # Attach to existing conversation state
    python start_mcp_server.py --state storage/conversation_state.json

    # Load specific checkpoint
    python start_mcp_server.py --checkpoint storage/proto_lm/model.pt

    # Combine state and checkpoint
    python start_mcp_server.py --state storage/conversation_state.json --checkpoint storage/proto_lm/model.pt

The server communicates over stdio following the MCP protocol.
Connect to it from Claude Desktop or any MCP client.

Example MCP client configuration (claude_desktop_config.json):
{
  "mcpServers": {
    "monika": {
      "command": "python",
      "args": ["C:\\MONIKA\\start_mcp_server.py", "--state", "storage/conversation_state.json"]
    }
  }
}
"""

import sys
from pathlib import Path

# Add the project root to the path so we can import salience_os_seed
project_root = Path(__file__).parent
sys.path.insert(0, str(project_root))

from salience_os_seed.runtime.mcp_server import main

if __name__ == "__main__":
    main()
