"""MCP Client plugin — allows LeoCRM agents to use external MCP servers."""

from __future__ import annotations

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


class McpClientPlugin(BasePlugin):
    """MCP Client plugin: integrates external MCP servers into the AI tool registry."""

    manifest = PluginManifest(
        name="mcp_client",
        version="1.0.0",
        display_name="MCP Client",
        description="Allows LeoCRM AI agents to use external MCP servers (web search, code execution, etc.).",
        dependencies=["permissions"],
        routes=[
            PluginRouteDef(
                path="/api/v1/mcp-client",
                module="app.plugins.builtins.mcp_client.routes",
                router_attr="router",
            ),
        ],
        events=[],
        migrations=["0001_initial.sql", "0002_add_deleted_at.sql"],
        permissions=[
            "mcp-client:read",
            "mcp-client:write",
            "mcp-client:admin",
        ],
    )
