AntOS Library — mcp (reference)
The
mcplibrary's design and native core — a Model Context Protocol client, usable with or without AI. The script-facing API is luau_mcp; the model-driven tool-use loop that consumes it is in the AI subsystem.
What it is
A standalone MCP client: connect to an MCP server, list its tools, and call them. It works with no model in the loop — which makes it handy for bringing up or debugging a server — and it is also the bridge the AI subsystem uses to give models tools.
Design notes
- Independent of AI. Connecting and calling tools needs no model.
mcp.tools()returns tool descriptions already shaped forai.ask'soverrides.tools, but nothing requires a model to be present. - The tool-use loop lives in
ai, not here.mcpis just the client — connect, list, call. The loop that lets a model call tools and feeds results back is the AI subsystem. - Configured servers persist in DBFS. Named servers (added via
mcp add/ tested viamcp test) are stored in config, reachable by name withmcp.connect_named.
Native core — libantos_mcp
sys_mcp implements the MCP transport — handshake, tool listing, invocation — over the network; the binding marshals connections, tool lists, and call results to/from Lua. No Luau dependency.
Related
- luau_mcp — the script API · AI subsystem (the tool-use loop) · luau_ai · AntOS Libraries hub