Skip to content

yggdrasil.loki.mcp

mcp

Loki as an MCP server — expose the agent to any MCP client.

ygg loki mcp runs a Model Context Protocol <https://modelcontextprotocol.io>_ server (stdio) that surfaces Loki to editors/clients like Claude Desktop. The agent's whole surface is available as MCP tools: reason with the best engine, skills/run (dispatch any skill — databricks-sql, aws-s3, genie, …), web, guide (the optimized yggdrasil way), tabular (read any source → cached frame), engines, usage (token KPIs), setup (a free local model), and capabilities. Requires the optional mcp package (auto-installed on first use).

from yggdrasil.loki.mcp import build_server
build_server().run()        # stdio transport

build_server

build_server(loki: 'Optional[Loki]' = None) -> 'FastMCP'

Build the Loki MCP server (does not run it). Registers the agent's tools.

main

main(argv: 'list[str] | None' = None) -> int

Run the Loki MCP server over stdio.