Skip to content

smelt.mcp

Tier: Host - Available in every runtime, including headless mode.

Visibility: Public - Stable Lua API intended for user config and plugins.

Config-time MCP server registration. Unknown fields raise errors.

smelt.mcp.list

fun(): table

Snapshot every declared MCP server. Each row is { name, description, server_info, config, status, tool_count, tools } where description is the configured human summary, server_info is { name, version, instructions }?, status is { kind = "disabled"|"connecting"|"connected"|"error", since_ms?, error?, at_ms? }, and tools contains { server, name, qualified_name, description, schema } rows. Lifecycle reads are sync - safe to call from a status renderer or keymap.

smelt.mcp.register

fun(name: string, cfg: smelt.mcp.Config): smelt.Reg

Types: smelt.mcp.Config, smelt.Reg

Declare an MCP server named name. See smelt.mcp.Config. Returns a Reg whose :remove() drops the desired-state entry; the next /reload reconciles it away.

smelt.mcp.status

fun(name: string): string?

Return the lifecycle status for server name: "disabled", "connecting", "connected", or "error". Returns nil when no server with that name is declared.

smelt.mcp.tools

fun(server: string?): table

Snapshot every discovered MCP tool. Each row is { server, name, qualified_name, description, schema }. When server is provided, only that server's tools are returned; otherwise tools from every connected server.