Skip to content

v0.1.0 first release

Choose a tag to compare

@leafo leafo released this 02 May 02:01
· 15 commits to master since this release
v0.1.0

A library for building Model Context Protocol (MCP) servers in Lua / MoonScript, plus a bundled MCP server for inspecting and exercising Lapis applications.

Library

  • McpServer base 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 @include for 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_code and client_credentials grants).

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_models
  • simulate — dispatch fake HTTP requests through the loaded app (status, headers, body) with automatic per-session cookie jar
  • list_cookies, clear_cookies
  • schema (optional, requires lapis-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.