Repository navigation
v0.1.0 first release
A library for building Model Context Protocol (MCP) servers in Lua / MoonScript, plus a bundled MCP server for inspecting and exercising Lapis applications.
Library
McpServerbase class with tool registration, resource listing, prompts, and lifecycle handling against MCP protocol version 2025-11-25.- Stdio transport (default) and a JSON-only Streamable HTTP profile mountable on any Lapis route.
- Server composition via
@includefor combining tools/resources/prompts across classes. - TableShape schema → JSON Schema conversion for typed tool inputs/outputs.
- Tool adapters for converting MCP tool definitions to Anthropic, OpenAI, and Gemini formats.
- Optional OAuth 2.0 shim (RFC 9728 / RFC 8414, PKCE,
authorization_codeandclient_credentialsgrants).
lapis mcp CLI
- Top-level
lapis mcp <module>subcommand that loads any MCP server module and runs it over stdio. Generic launcher — not tied to the bundled server.
Bundled Lapis MCP Server (lapis.mcp.lapis_server)
Read/exercise tools for the current Lapis application:
list_routes,list_modelssimulate— dispatch fake HTTP requests through the loaded app (status, headers, body) with automatic per-session cookie jarlist_cookies,clear_cookiesschema(optional, requireslapis-annotate) — pg_dump live schema for one or more models
User code is reloaded between calls via package.loaded tracking, so source edits are picked up without restarting the server.