"""MCP Server plugin — exposes LeoCRM data to external MCP clients (Claude Desktop, etc.)."""

from __future__ import annotations

from app.plugins.base import BasePlugin
from app.plugins.manifest import PluginManifest, PluginRouteDef


class McpServerPlugin(BasePlugin):
    """MCP Server plugin: exposes LeoCRM tools to external AI clients via MCP protocol."""

    manifest = PluginManifest(
        name="mcp_server",
        version="1.0.0",
        display_name="MCP Server",
        description="Exposes LeoCRM data (contacts, calendar, mail, DMS) to external MCP clients via API-token auth.",
        dependencies=["permissions"],
        routes=[
            PluginRouteDef(
                path="/api/v1/mcp",
                module="app.plugins.builtins.mcp_server.routes",
                router_attr="router",
            ),
        ],
        events=[],
        migrations=["0001_initial.sql"],
        permissions=[
            "mcp:read",
            "mcp:write",
        ],
    )
