🚀 Xano开发人员MCP
用Xano的力量为你的AI充电
](https://www.npmjs.com/package/@xano/developer-mcp) 
______________________________________________________________________
🤖 AI驱动 · 📚 综合文档 · ⚡ 即时设置 · 🔧 内置工具
______________________________________________________________________
MCP服务器和独立库,为人工智能助手提供了在 泽诺 --包括文档、代码验证和工作流程指南。将其用作MCP服务器,或直接将工具导入您自己的应用程序中。
💡 什么是Xano? 为您的应用程序构建可扩展后端的最快方法——无需代码。构建API、管理数据库并立即部署。
🔗 快速链接
概述
此MCP服务器充当AI模型和Xano开发者生态系统之间的桥梁,提供:
- Meta API文档 -以编程方式管理Xano工作区、数据库、API、函数等
- CLI文档 -用于本地开发、代码同步和执行的命令行界面
- XanoScript文档 -基于文件类型的上下文感知文档的语言引用
- 代码验证 -使用官方XanoScript语言服务器进行语法检查
- 工作流程指南 -常见开发任务的分步指南
快速开始
克劳德代码(推荐)
claude mcp add xano -- npx -y @xano/developer-mcp就是这样!MCP服务器将自动安装和配置。
通过npm安装
你也可以从npm全局安装包:
npm install -g @xano/developer-mcp然后添加到克劳德代码中:
claude mcp add xano-developer -- xano-developer-mcp克劳德桌面版
添加到您的Claude Desktop配置文件中:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - 视窗:
%APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"xano-developer": {
"command": "npx",
"args": ["-y", "@xano/developer-mcp"]
}
}
}Xano技能
此仓库提供两种代理技能 skills/:
xano-init--引导式设置,分析Xano工作区并构建沙盒优先的开发剧本xanoscript-docs-expert--深入参考XanoScript文档和此MCP项目的架构
在这个仓库中使用克劳德代码? 你已经具备了这两种技能。他们致力于 .claude/skills/ 当Claude Code在此目录中启动会话时,会自动加载——无需安装步骤。只需调用 xano-init 或 xanoscript-docs-expert 或者用自然语言描述任务。
使用不同的代理,还是希望在其他项目中使用这些技能? 技能通过公开渠道进行分配 代理技能标准 并使用单个 npx 命令--禁止克隆或手动复制文件。
安装 xano-init 全球进入克劳德代码:
npx skills add xano-inc/xano-developer-mcp -s xano-init -a claude-code -g一次安装到多个代理中(Claude Code、Codex、Cursor、OpenCode等):
npx skills add xano-inc/xano-developer-mcp -s xano-init \
-a claude-code -a codex -a cursor -a opencode -g掉落 -s 在repo中安装所有技能,或删除 -g 将安装范围限定到当前项目,而不是用户配置文件。其他受支持的代理包括 gemini-cli, windsurf, continue, cline, github-copilot,以及更多-请参阅 技能CLI 查看完整列表。
安装后启动新的代理会话,以便获取技能清单。
检查您的版本
npx @xano/developer-mcp --version如果从源代码安装:
node dist/index.js --version从源安装
先决条件
- Node.js(兼容ES2022+)
- npm
设置
# Clone the repository
git clone https://github.com/xano-inc/xano-developer-mcp.git
cd xano-developer-mcp
# Install dependencies
npm install
# Build the project
npm run build用法
运行服务器
# Production
npm start
# Development (build + run)
npm run dev服务器使用JSON-RPC协议通过stdio(标准输入/输出)进行通信,该协议是MCP服务器的标准传输。
源安装配置
如果从源代码安装,请将MCP客户端配置为使用本地版本:
克劳德代码:
claude mcp add xano-developer node /path/to/xano-developer-mcp/dist/index.js克劳德桌面:
{
"mcpServers": {
"xano-developer": {
"command": "node",
"args": ["/path/to/xano-developer-mcp/dist/index.js"]
}
}
}图书馆使用情况
除了将此包用作MCP服务器外,您还可以直接在自己的应用程序中导入和使用这些工具。
安装
npm install @xano/developer-mcp导入工具
import {
validateXanoscript,
xanoscriptDocs,
metaApiDocs,
cliDocs,
mcpVersion
} from '@xano/developer-mcp';验证XanoScript代码
import { validateXanoscript } from '@xano/developer-mcp';
// Validate code directly
const result = validateXanoscript({ code: 'var:result = 1 + 2' });
if (result.valid) {
console.log('Code is valid!');
} else {
console.log('Validation errors:');
result.errors.forEach(error => {
console.log(` Line ${error.range.start.line + 1}: ${error.message}`);
});
}
// Validate a file
const fileResult = validateXanoscript({ file_path: './function/utils.xs' });
// Batch validate a directory
const dirResult = validateXanoscript({ directory: './api', pattern: '**/*.xs' });
console.log(`${dirResult.valid_files}/${dirResult.total_files} files valid`);获取XanoScript文档
import { xanoscriptDocs } from '@xano/developer-mcp';
// Get overview (README)
const overview = xanoscriptDocs();
console.log(overview.documentation);
// Get specific topic
const syntaxDocs = xanoscriptDocs({ topic: 'syntax' });
// Get context-aware docs for a file path
const apiDocs = xanoscriptDocs({ file_path: 'api/users/create_post.xs' });
// Get compact quick reference
const quickRef = xanoscriptDocs({ topic: 'database', mode: 'quick_reference' });
// Get topic index with sizes
const index = xanoscriptDocs({ mode: 'index' });获取Meta API文档
import { metaApiDocs } from '@xano/developer-mcp';
// Get overview
const overview = metaApiDocs({ topic: 'start' });
// Get detailed documentation with examples
const workspaceDocs = metaApiDocs({
topic: 'workspace',
detail_level: 'examples',
include_schemas: true
});
console.log(workspaceDocs.documentation);获取CLI文档
import { cliDocs } from '@xano/developer-mcp';
const cliSetup = cliDocs({ topic: 'start' });
console.log(cliSetup.documentation);获取包版本
import { mcpVersion } from '@xano/developer-mcp';
const { version } = mcpVersion();
console.log(`Using version ${version}`);可用出口
| 导出 | 描述 |
|---|---|
validateXanoscript | 验证XanoScript代码并获取详细的错误信息 |
xanoscriptDocs | 获取XanoScript语言文档 |
metaApiDocs | 获取Meta API文档 |
cliDocs | 获取CLI文档 |
mcpVersion | 获取软件包版本 |
toolDefinitions | MCP工具定义(JSON模式,用于构建自定义MCP服务器) |
toolSpecs | 带有Zod输入/输出形状的工具规格(新代码首选)直接与 McpServer.registerTool) |
handleTool | 异步工具调度器(Promise)用于构建自定义MCP服务器 |
TypeScript支持
完全支持TypeScript导出类型:
import type {
ValidateXanoscriptArgs,
ValidationResult,
ParserDiagnostic,
XanoscriptDocsArgs,
MetaApiDocsArgs,
CliDocsArgs,
ToolResult
} from '@xano/developer-mcp';包裹入口点
该软件包提供了多个入口点:
// Main library entry (recommended)
import { validateXanoscript } from '@xano/developer-mcp';
// Tools module directly
import { validateXanoscript } from '@xano/developer-mcp/tools';
// Server module (for extending the MCP server)
import '@xano/developer-mcp/server';可用工具
1. xano_validate_xanoscript
验证XanoScript代码是否存在语法错误。支持多种输入法。语言服务器从代码语法中自动检测对象类型。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
code | string | 否 | 要验证为字符串的XanoScript代码 |
file_path | string | 否 | 单个路径 .xs 要验证的文件 |
file_paths | string\[\] | 否 | 批验证的文件路径数组 |
directory | string | 否 | 要验证所有内容的目录路径 .xs 递归文件 |
pattern | string | 否 | 使用时用于过滤文件的Glob模式 directory (默认值: **/*.xs) |
…之一code,file_path,file_paths,或directory是必需的。
示例:
// Validate code directly
xano_validate_xanoscript({ code: "var:result = 1 + 2" })
// Validate a single file
xano_validate_xanoscript({ file_path: "function/utils/format.xs" })
// Validate multiple files
xano_validate_xanoscript({ file_paths: ["api/users/get.xs", "api/users/create.xs"] })
// Validate all .xs files in a directory
xano_validate_xanoscript({ directory: "api/users" })
// Validate with a specific pattern
xano_validate_xanoscript({ directory: "src", pattern: "api/**/*.xs" })退货: 错误列表,包括行/列位置和有用建议,或有效性确认。
2. xano_xanoscript_docs
检索具有上下文感知支持的XanoScript编程语言文档。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
topic | string | 否 | 要检索的特定文档主题 |
file_path | string | 否 | 正在为上下文感知文档编辑文件路径(例如。, api/users/create_post.xs) |
mode | string | 否 | full (默认), quick_reference 用于紧凑语法参考,或 index 用于按大小列出主题 |
tier | string | 否 | 上下文受限模型的预打包文档层: survival (约800个代币)或 working (约3500个代币)。设置时覆盖主题/文件路径/模式 |
max_tokens | number | 否 | 最大估计代币预算。按优先级顺序加载主题,直到达到预算。有助于防止小窗口模型的上下文溢出 |
exclude_topics | string\[\] | 否 | 要排除的主题名称 file_path 结果(例如,已加载的主题) |
可用主题:
| 主题 | 描述 |
|---|---|
survival | 用于上下文小于16K的模型的最小语法生存工具包(约3KB,约800个令牌) |
working | 具有16-64K上下文的模型的完整工作参考(~12KB,~3500个令牌) |
readme | XanoScript概述、工作区结构和快速参考 |
essentials | 常见模式、快速参考和应避免的常见错误 |
syntax | 所有XanoScript代码的表达式、运算符和过滤器 |
syntax/string-filters | 字符串过滤器、正则表达式、编码、安全过滤器、文本函数 |
syntax/array-filters | 数组过滤器、函数操作和数组函数 |
syntax/functions | 数学过滤器/函数、对象函数、位操作 |
types | 数据类型、输入块和验证 |
tables | 具有索引和关系的数据库模式定义 |
functions | 具有输入和响应的可重用函数栈 |
apis | 具有身份验证和CRUD模式的HTTP端点定义 |
tasks | 计划作业和定时作业 |
triggers | 事件驱动处理程序(表、实时、工作区、代理、MCP) |
database | 所有db.\*操作:查询、获取、添加、编辑、修补、删除 |
agents | 使用LLM提供程序和工具配置AI代理 |
tools | 用于代理和MCP服务器的AI工具 |
mcp-servers | MCP服务器定义公开工具 |
unit-testing | 函数、API和中间件中的单元测试、模拟和断言 |
workflow-tests | 使用数据源和标签的端到端工作流测试 |
integrations | 外部服务集成指数 |
integrations/cloud-storage | AWS S3、Azure Blob和GCP存储 |
integrations/search | Elasticsearch、OpenSearch和Algolia |
integrations/redis | Redis缓存、速率限制和队列 |
integrations/external-apis | 使用api.request的HTTP请求 |
integrations/utilities | 本地存储、电子邮件、zip和Lambda |
frontend | 静态前端开发和部署 |
addons | 用于获取相关数据的可重用子查询 |
debugging | 记录、检查和调试XanoScript执行 |
performance | 性能优化最佳实践 |
realtime | 推送更新的实时渠道和事件 |
security | 身份验证和授权的安全最佳实践 |
streaming | 从文件、请求和响应流式传输数据 |
middleware | 函数、查询、任务和工具的请求/响应拦截器 |
branch | 分支级别设置:中间件、历史保留、视觉样式 |
workspace | 工作空间级别设置:环境变量、首选项、实时 |
示例:
// Get overview
xano_xanoscript_docs()
// Get survival kit for small context models (~800 tokens)
xano_xanoscript_docs({ tier: "survival" })
// Get working reference for medium context models (~3500 tokens)
xano_xanoscript_docs({ tier: "working" })
// Get essentials (recommended first stop)
xano_xanoscript_docs({ topic: "essentials" })
// Get specific topic
xano_xanoscript_docs({ topic: "functions" })
// Discover available topics with sizes
xano_xanoscript_docs({ mode: "index" })
// Budget-aware: load docs up to token limit
xano_xanoscript_docs({ file_path: "api/users/create_post.xs", max_tokens: 2000 })
// Context-aware: get all docs relevant to file being edited
xano_xanoscript_docs({ file_path: "api/users/create_post.xs" })
// Context-aware with exclusions (skip already-loaded topics)
xano_xanoscript_docs({ file_path: "api/users/create_post.xs", exclude_topics: ["syntax", "essentials"] })
// Compact quick reference (uses less context)
xano_xanoscript_docs({ topic: "database", mode: "quick_reference" })3. xano_version
获取Xano Developer MCP服务器的当前版本。
参数: 无
退货: package.json中的版本字符串。
例子:
xano_version()4. xano_meta_api_docs
获取Xano的Meta API文档。使用此内容了解如何以编程方式管理Xano工作区、数据库、API、函数、代理等。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
topic | string | 是 | 要检索的文档主题 |
detail_level | string | 否 | overview, detailed (默认),或 examples |
include_schemas | boolean | 否 | 包含请求/响应的JSON模式(默认值:true) |
可用主题:
| 主题 | 描述 |
|---|---|
start | 开始使用Meta API |
authentication | API认证和授权 |
workspace | 工作区管理端点 |
apigroup | API集团运营 |
api | API端点管理 |
table | 数据库表操作 |
function | 功能管理 |
task | 计划任务操作 |
agent | AI代理配置 |
tool | AI工具管理 |
mcp_server | MCP服务器端点 |
middleware | 中间件配置 |
branch | 分行管理 |
realtime | 实时通道操作 |
file | 档案管理 |
history | 版本历史 |
workflows | 分步工作流程指南 |
示例:
// Get overview of Meta API
xano_meta_api_docs({ topic: "start" })
// Get detailed table documentation
xano_meta_api_docs({ topic: "table", detail_level: "detailed" })
// Get examples without schemas (smaller context)
xano_meta_api_docs({ topic: "api", detail_level: "examples", include_schemas: false })
// Step-by-step workflow guides
xano_meta_api_docs({ topic: "workflows" })5. xano_cli_docs
获取Xano CLI的文档。CLI是 可选但推荐 用于本地开发工作流程。并非所有用户都会安装它。
- npm: https://www.npmjs.com/package/@xano/cli
- github: https://github.com/xano-inc/cli
使用此工具了解用于本地开发、代码同步和XanoScript执行的CLI命令。
参数:
| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
topic | string | 是 | 要检索的文档主题 |
detail_level | string | 否 | overview, detailed (默认),或 examples |
可用主题:
| 主题 | 描述 |
|---|---|
start | CLI入门-安装和设置 |
auth | 基于浏览器的OAuth身份验证 |
profile | 配置文件管理-凭据和多环境设置 |
workspace | 工作区操作-拉/推代码同步、git集成 |
sandbox | 个人自动配置的开发环境(对免费层友好) |
branch | 分支管理-列出、切换、创建和删除分支 |
function | 功能管理-列表、获取、创建、编辑 |
release | 发布管理-创建、导出、导入、拉取、推送 |
tenant | 租户管理-CRUD、部署、环境变量、备份、集群 |
unit_test | 单元测试管理-列出并运行单元测试 |
workflow_test | 工作流测试管理-列出、运行和管理工作流测试 |
platform | 平台管理-列出和查看平台版本 |
static_host | 静态托管-部署前端构建 |
update | 将CLI更新到最新版本 |
integration | CLI+Meta API集成指南-何时使用每个 |
示例:
// Get CLI setup guide
xano_cli_docs({ topic: "start" })
// Learn when to use CLI vs Meta API
xano_cli_docs({ topic: "integration" })
// Get workspace sync commands
xano_cli_docs({ topic: "workspace", detail_level: "detailed" })
// Profile management with examples
xano_cli_docs({ topic: "profile", detail_level: "examples" })MCP资源
服务器还将XanoScript文档作为MCP资源公开,以便直接访问:
| 资源URI | 描述 |
|---|---|
xanoscript://docs/survival | 最小语法生存工具包(约800个令牌) |
xanoscript://docs/working | 完整的工作参考(约3500个代币) |
xanoscript://docs/readme | 概述和快速参考 |
xanoscript://docs/essentials | 常见模式、快速参考和应避免的常见错误 |
xanoscript://docs/syntax | 表达式、运算符和过滤器 |
xanoscript://docs/syntax/string-filters | 字符串过滤器、正则表达式、编码、安全过滤器 |
xanoscript://docs/syntax/array-filters | 阵列过滤器,功能操作 |
xanoscript://docs/syntax/functions | 数学过滤器/函数、对象函数、位 |
xanoscript://docs/types | 数据类型和验证 |
xanoscript://docs/tables | 数据库架构定义 |
xanoscript://docs/functions | 可重用的函数栈 |
xanoscript://docs/apis | HTTP端点定义 |
xanoscript://docs/tasks | 计划作业和定时作业 |
xanoscript://docs/triggers | 事件驱动处理程序 |
xanoscript://docs/database | 数据库操作 |
xanoscript://docs/agents | AI代理配置 |
xanoscript://docs/tools | 面向代理的AI工具 |
xanoscript://docs/mcp-servers | MCP服务器定义 |
xanoscript://docs/unit-testing | 单元测试和模拟 |
xanoscript://docs/workflow-tests | 端到端工作流测试 |
xanoscript://docs/integrations | 外部服务集成指数 |
xanoscript://docs/integrations/cloud-storage | AWS S3、Azure Blob、GCP存储 |
xanoscript://docs/integrations/search | Elasticsearch、OpenSearch、Algolia |
xanoscript://docs/integrations/redis | Redis缓存和队列 |
xanoscript://docs/integrations/external-apis | 使用api.request的HTTP请求 |
xanoscript://docs/integrations/utilities | 电子邮件、zip、Lambda实用程序 |
xanoscript://docs/frontend | 静态前端开发 |
xanoscript://docs/addons | 相关数据的可重用子查询 |
xanoscript://docs/debugging | 日志记录和调试工具 |
xanoscript://docs/performance | 性能优化 |
xanoscript://docs/realtime | 实时频道和事件 |
xanoscript://docs/security | 安全最佳实践 |
xanoscript://docs/streaming | 数据流操作 |
xanoscript://docs/middleware | 请求/响应拦截器 |
xanoscript://docs/branch | 分支级别设置 |
xanoscript://docs/workspace | 工作空间级别设置 |
npm脚本
| 脚本 | 命令 | 描述 |
|---|---|---|
build | tsc && cp -r src/xanoscript_docs dist/ | 编译TypeScript并复制文档 |
start | node dist/index.js | 运行MCP服务器 |
dev | tsc && node dist/index.js | 在开发中构建和运行 |
test | vitest run | 运行单元测试 |
test:watch | vitest | 在监视模式下运行测试 |
test:coverage | vitest run --coverage | 使用覆盖率报告运行测试 |
项目结构
xano-developer-mcp/
├── src/
│ ├── index.ts # MCP server entry point
│ ├── lib.ts # Library entry point (for npm imports)
│ ├── xanoscript.ts # XanoScript documentation logic
│ ├── xanoscript.test.ts # Tests for xanoscript module
│ ├── xanoscript-language-server.d.ts # TypeScript declarations
│ ├── tools/ # Standalone tool modules
│ │ ├── index.ts # Unified tool exports & handler
│ │ ├── index.test.ts # Tests for tool handler
│ │ ├── types.ts # Common types (ToolResult)
│ │ ├── validate_xanoscript.ts # XanoScript validation tool
│ │ ├── xanoscript_docs.ts # XanoScript docs tool
│ │ ├── xanoscript_docs.test.ts # Tests for xanoscript docs tool
│ │ ├── mcp_version.ts # Version tool
│ │ ├── meta_api_docs.ts # Meta API docs tool wrapper
│ │ └── cli_docs.ts # CLI docs tool wrapper
│ ├── meta_api_docs/ # Meta API documentation
│ │ ├── index.ts # API docs handler
│ │ ├── index.test.ts # Tests for index
│ │ ├── types.ts # Type definitions
│ │ ├── types.test.ts # Tests for types
│ │ ├── format.ts # Documentation formatter
│ │ ├── format.test.ts # Tests for formatter
│ │ └── topics/ # Individual topic modules
│ ├── cli_docs/ # Xano CLI documentation
│ │ ├── index.ts # CLI docs handler
│ │ ├── types.ts # Type definitions
│ │ ├── format.ts # Documentation formatter
│ │ └── topics/ # Individual topic modules
│ └── xanoscript_docs/ # XanoScript language documentation
│ ├── docs_index.json # Machine-readable topic registry
│ ├── version.json
│ ├── README.md
│ ├── essentials.md
│ ├── syntax.md
│ ├── syntax/ # Syntax sub-topics
│ │ ├── string-filters.md
│ │ ├── array-filters.md
│ │ └── functions.md
│ └── ...
├── dist/ # Compiled JavaScript output
├── vitest.config.ts # Test configuration
├── package.json
└── tsconfig.json依赖项
| 包装 | 版本 | 用途 |
|---|---|---|
@modelcontextprotocol/sdk | ^1.26.0 | MCP官方SDK |
@xano/xanoscript-language-server | ^11.6.5 | XanoScript解析器和验证 |
minimatch | ^10.1.2 | 上下文感知文档的全局模式匹配 |
开发依赖关系
| 包装 | 版本 | 用途 |
|---|---|---|
typescript | ^5.9.0 | TypeScript编译器 |
vitest | ^3.0.0 | 快速单元测试框架 |
@types/node | ^22.0.0 | Node.js类型定义 |
@types/minimatch | ^5.1.2 | 最小匹配类型定义 |
运作原理
AI Client
│
▼
MCP Protocol (JSON-RPC over stdio)
│
▼
Xano Developer MCP Server
│
├─► xano_validate_xanoscript → Parses code with XanoScript language server
│
├─► xano_xanoscript_docs → Context-aware docs from /xanoscript_docs/*.md
│
├─► xano_meta_api_docs → Meta API documentation with detail levels
│
├─► xano_cli_docs → CLI documentation for local development workflows
│
├─► xano_version → Returns server version from package.json
│
└─► MCP Resources → Direct access to XanoScript documentation认证
MCP服务器和库函数不需要身份验证。但是,当使用文档化的API(Meta API)与实际的Xano服务交互时,您将需要适当的Xano API凭据。看 xano_meta_api_docs 用于身份验证详细信息的工具。
发展
建筑
npm run build将TypeScript编译为JavaScript dist/ 目录。
文档结构
XanoScript文档 (src/xanoscript_docs/):
- XanoScript语言参考的Markdown文件
- 配置于
src/xanoscript_docs/docs_index.json与:
- 文件:包含文档的markdown文件 - applyTo:用于上下文感知匹配的全局模式(例如。, api/**/*.xs) - 描述:主题的人类可读描述 - 别名:主题查找的替代名称 - 优先级:文件路径匹配的排序权重
Meta API文档 (src/meta_api_docs/):
- 带有结构化文档的TypeScript模块
- 支持参数化输出(详细级别、模式包含)
- 由于上下文效率,更适合人工智能消费
测试
该项目使用 维测试 作为其具有全面单元测试的测试框架。
运行测试
# Run all tests
npm test
# Run tests in watch mode (re-runs on file changes)
npm run test:watch
# Run tests with coverage report
npm run test:coverage测试覆盖率
| 模块 | 测试文件 | 描述 |
|---|---|---|
xanoscript.ts | xanoscript.test.ts | 核心XanoScript文档逻辑,包括文件路径匹配和快速引用提取 |
tools/index.ts | tools/index.test.ts | 工具处理程序调度和参数验证 |
tools/xanoscript_docs.ts | tools/xanoscript_docs.test.ts | XanoScript文档工具和路径解析 |
meta_api_docs/index.ts | meta_api_docs/index.test.ts | Meta API文档处理程序和主题管理 |
meta_api_docs/format.ts | meta_api_docs/format.test.ts | 端点、示例和模式的文档格式 |
meta_api_docs/types.ts | meta_api_docs/types.test.ts | 类型结构验证 |
测试结构
使用 .test.ts 后缀:
src/
├── xanoscript.ts
├── xanoscript.test.ts # Tests for xanoscript.ts
├── tools/
│ ├── index.ts
│ ├── index.test.ts # Tests for tool handler
│ ├── xanoscript_docs.ts
│ ├── xanoscript_docs.test.ts # Tests for xanoscript docs tool
│ └── ...
├── meta_api_docs/
│ ├── index.ts
│ ├── index.test.ts # Tests for index.ts
│ ├── format.ts
│ ├── format.test.ts # Tests for format.ts
│ └── ...写作测试
测试使用Vitest的API,该API与Jest兼容:
import { describe, it, expect } from "vitest";
import { myFunction } from "./myModule.js";
describe("myFunction", () => {
it("should return expected result", () => {
expect(myFunction("input")).toBe("expected");
});
});从1.x升级到2.0
版本2使MCP服务器内部现代化,并使所有工具名称标准化 在单一 xano_ 命名空间。高级独立库函数 (validateXanoscript, xanoscriptDocs, metaApiDocs, cliDocs, mcpVersion) 没有变化。
工具重命名(MCP客户端)
如果您的代理或MCP客户端配置按名称引用工具,请更新它们:
| 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 |
唯一 xano_ 前缀提高了多个MCP服务器时的可发现性 已安装,并允许客户端按名称模式过滤Xano工具。
库API
handleTool(name, args) 现在是 async 并返回 Promise 而不是 ToolResult.更新要使用的呼叫站点 await 以及新工具 姓名:
// 1.x
const result = handleTool("xanoscript_docs", { topic: "syntax" });
// 2.0
const result = await handleTool("xano_xanoscript_docs", { topic: "syntax" });个体 *ToolDefinition 出口(validateXanoscriptToolDefinition, xanoscriptDocsToolDefinition, mcpVersionToolDefinition, metaApiDocsToolDefinition, cliDocsToolDefinition)被撤职以示支持 一个单一的真理来源。使用 toolSpecs[name].definition 相反:
// 1.x
import { validateXanoscriptToolDefinition } from "@xano/developer-mcp";
// 2.0
import { toolSpecs } from "@xano/developer-mcp";
const validateXanoscriptToolDefinition =
toolSpecs.xano_validate_xanoscript.definition;新的 ToolName 类型导出枚举每个注册的工具名称。
值得注意的修复和添加
xano_xanoscript_docs现在正确接受记录tier和
max_tokens 参数——之前它们被默默地删除了 到达处理程序。
- 服务器建立在现代
McpServer具有Zod-derived模式的API,
因此,通过网络发布的JSON模式不能再偏离 运行时解析器。
- 新
toolSpecsexport公开了每个工具的Zod输入/输出形状——使用它
在自定义中注册工具时 McpServer.
xano_validate_xanoscript结果现在包括awarnings计入
structuredContent 关于成功。
许可证
看 许可证 了解详情。
