v2.0.0: McpServer migration, Zod source-of-truth, xano_ tool namespace
Highlights
- Migrated the MCP server from the low-level
ServerAPI toMcpServerwithregisterTool/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 nowasyncand returnsPromise<ToolResult>— consumers mustawaitit.- Individual
*ToolDefinitionexports removed — usetoolSpecs[name].definitioninstead. - 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_docstierandmax_tokensparameters 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_xanoscriptsuccess results now include awarningscount instructuredContent.- Handler exceptions in
registerTool/registerResourceare caught and returned as structured tool errors instead of escaping as transport-level failures. getXanoscriptDocsPathno 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$schemaandadditionalPropertiesout of the emitted JSON Schema.toolSpecslibrary export — exposes each tool's Zod input/output shape.ToolNametype enumerates registered names.- Typed dispatch table in
handleTool— adding totoolSpecswithout a handler is a compile error. zoddeclared independencies(was only transitively present via the MCP SDK).- 15 new tests:
defineToolschema derivation,McpServerInMemoryTransportregistration smoke test, warnings count contract, validation field-mention assertions.
Build hygiene
- Separate
tsconfig.build.jsonexcludes**/*.test.tsso 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-mcpClaude Code:
claude mcp add xano -- npx -y @xano/developer-mcpFull changelog: v1.0.75...v2.0.0