Skip to content

v2.0.0: McpServer migration, Zod source-of-truth, xano_ tool namespace

Choose a tag to compare

@xanojustin xanojustin released this 11 May 16:45
· 15 commits to main since this release
2e5d6d3

Highlights

  • Migrated the MCP server from the low-level Server API to McpServer with registerTool / registerResource.
  • Each tool's Zod input/output shape is now the single source of truth — the JSON Schema sent to MCP clients is derived from Zod via z.toJSONSchema, so wire-level schemas and the runtime parser can never drift.
  • All tool names normalized under the xano_ prefix for consistent discoverability.

Breaking Changes

Tool renames (MCP clients)

1.x 2.0
validate_xanoscript xano_validate_xanoscript
xanoscript_docs xano_xanoscript_docs
meta_api_docs xano_meta_api_docs
cli_docs xano_cli_docs
mcp_version xano_version

Library API

  • handleTool(name, args) is now async and returns Promise<ToolResult> — consumers must await it.
  • Individual *ToolDefinition exports removed — use toolSpecs[name].definition instead.
  • High-level standalone functions (validateXanoscript, xanoscriptDocs, metaApiDocs, cliDocs, mcpVersion) are unchanged.

The README "Upgrading from 1.x to 2.0" section has migration snippets for both.

Fixes

  • xano_xanoscript_docs tier and max_tokens parameters now work. They were documented but silently stripped by the hand-maintained Zod schema in 1.x. Now derived from the Zod shape, so they pass through.
  • xano_validate_xanoscript success results now include a warnings count in structuredContent.
  • Handler exceptions in registerTool / registerResource are caught and returned as structured tool errors instead of escaping as transport-level failures.
  • getXanoscriptDocsPath no longer silently swallows non-ENOENT errors; logs every candidate path tried.

New

  • src/tools/define_tool.ts — builds an MCP tool definition from Zod shapes; sanitizes $schema and additionalProperties out of the emitted JSON Schema.
  • toolSpecs library export — exposes each tool's Zod input/output shape.
  • ToolName type enumerates registered names.
  • Typed dispatch table in handleTool — adding to toolSpecs without a handler is a compile error.
  • zod declared in dependencies (was only transitively present via the MCP SDK).
  • 15 new tests: defineTool schema derivation, McpServer InMemoryTransport registration smoke test, warnings count contract, validation field-mention assertions.

Build hygiene

  • Separate tsconfig.build.json excludes **/*.test.ts so test files no longer ship in the npm tarball.
  • Build wipes dist/ first so stale artifacts from older layouts can't leak into the published package.

Install

npm install @xano/developer-mcp@2.0.0
# or
npx -y @xano/developer-mcp

Claude Code:

claude mcp add xano -- npx -y @xano/developer-mcp

Full changelog: v1.0.75...v2.0.0