Skip to content

feat: external tool / MCP plugin integration #27

Description

@alpibrupa

Problem

All 44 tools are local Lex CLI commands. There is no way to connect external APIs, CI systems, databases, package registries, or other MCP-compatible servers as tools available to agents.

Design

New module: src/tools/mcp.lex

type McpTool = { name: Str, description: Str, schema: JsonSchema, endpoint: Str }

fn load_mcp_tools(server_url: Str) -> [net] List[t.Tool]
fn call_mcp_tool(tool: McpTool, args: Json) -> [net] Json

Integration points:

  • all_tools() in index.lex should optionally append MCP tools loaded from .lex/mcp.toml
  • Permission rules need an mcp_tool(name) predicate in rules.lex so MCP tools go through the same gate
  • The TUI should accept --mcp <url> to load tools from an MCP server at startup

Configuration (.lex/mcp.toml)

[[servers]]
url = "http://localhost:3000"
allow = ["search_issues", "create_pr"]

Acceptance

  • MCP tools appear in all_tools() and are filterable via permission specs
  • lex check --strict src/ passes
  • Smoke test with a local MCP server stub

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions