Xano Backend Builder by djacobsmeyer/claude-skills-engineering
npx skills add https://github.com/djacobsmeyer/claude-skills-engineering --skill 'Xano Backend Builder'通过 MCP(模型上下文协议)服务器集成,使用 Xano 的无代码平台构建无服务器后端基础设施。无需传统编码,即可使用 XanoScript 创建数据库、REST API、自定义函数和业务逻辑。
Xano 账户和工作区 :
MCP 访问令牌和 URL :
https://x8ki-letl-twmt.n7.xano.io/mcp)MCP 服务器配置:此插件包含 MCP 服务器配置,启用时会自动连接。
设置环境变量:
export XANO_MCP_URL="https://your-workspace.xano.io/mcp"
export XANO_MCP_TOKEN="your_access_token_here"
或添加到您的 shell 配置文件(、):
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
~/.zshrc~/.bashrc # Xano MCP 配置
export XANO_MCP_URL="https://your-workspace.xano.io/mcp"
export XANO_MCP_TOKEN="your_access_token_here"
设置环境变量后重启 Claude Code。
启用此插件后,Xano MCP 服务器将自动启动,Xano 工具将在您的 Claude Code 会话中可用。
Xano 组件:
XanoScript 基础:Xano 使用一种名为 XanoScript 的专有语法来定义逻辑。主要特点:
db.query、array.push、var.updateas $variable_name|filter_name:option 转换数据重要:XanoScript 语法是 Xano 独有的。使用 XanoScript 时:
理解需求:
设计数据库模式:
识别实体(表)和关系
使用适当的数据类型定义字段
考虑性能索引
使用 MCP 工具创建表:
使用 Xano MCP 工具创建具有指定字段的表
创建 API 端点:
使用 XanoScript 实现业务逻辑:
db.query table_name { filters } as $resultsvar $my_var { value = "initial" }var.update $my_var { value = "new" }foreach ($items) { each as $item { } }conditional { if ($condition) { } else { } }$data|filter_name:option测试实现:
生成 API 文档:
部署和监控:
1. 用于 CRUD 操作的 REST API:
2. Webhook 接收器:
3. 外部 API 集成:
4. 数据转换管道:
5. 计划后台任务:
注意语法差异:
namespace.function(例如,db.query,而不是 db_query)$ 前缀:$my_variableas 关键字:db.query users {} as $users$users|count,而不是 count($users)不确定语法时:
常见的 XanoScript 错误:
db_query("users") → ✅ db.query users { }var my_var = "value" → ✅ var $my_var { value = "value" }count($array) → ✅ $array|countif (condition) {} → ✅ conditional { if ($condition) { } }启用插件并设置环境变量后,Xano MCP 服务器会自动提供以下工具:
使用 MCP 工具:只需自然地要求 Claude 执行 Xano 操作(例如,“创建一个包含电子邮件和姓名字段的用户表”)。Claude 将自动使用适当的 Xano MCP 工具来执行您的请求。
常见问题:
调试方法:
令牌管理:
API 安全:
数据保护:
用户请求:
我需要一个后端来存储具有姓名、电子邮件和简介的用户资料
您将:
使用 Xano MCP 创建表:
usersname(文本,必需)email(文本,必需,唯一)bio(文本,可选)created_at(时间戳,自动)生成 CRUD API 端点:
/users - 列出所有用户/users/{id} - 获取单个用户/users - 创建用户/users/{id} - 更新用户/users/{id} - 删除用户使用 XanoScript 向 POST 端点添加电子邮件验证:
conditional {
if ($email|is_email|not) {
response.error "Invalid email format"
}
}
测试端点并返回 API 文档 URL
用户请求:
创建一个端点来接收 LinkedIn OAuth 回调并存储访问令牌
您将:
创建数据库表:
oauth_tokensuser_id(文本)provider(文本)- "linkedin"access_token(文本,加密)refresh_token(文本,加密)expires_at(时间戳)创建 API 端点:
POST/oauth/linkedin/callbackcode(文本,必需)- OAuth 授权码user_id(文本,必需)实现函数栈逻辑:
api oauth_callback {
input {
text code filters=required
text user_id filters=required
}
stack {
// 将代码交换为令牌(将调用 LinkedIn API)
http.request {
url = "https://www.linkedin.com/oauth/v2/accessToken"
method = "POST"
body = {
grant_type: "authorization_code",
code: $code,
client_id: env.LINKEDIN_CLIENT_ID,
client_secret: env.LINKEDIN_CLIENT_SECRET
}
} as $token_response
// 将令牌存储在数据库中
db.insert oauth_tokens {
user_id = $user_id,
provider = "linkedin",
access_token = $token_response.access_token,
refresh_token = $token_response.refresh_token,
expires_at = $token_response.expires_in|timestamp_offset
} as $stored_token
response = {
success: true,
token_id: $stored_token.id
}
}
}
使用示例 OAuth 代码测试端点
返回端点 URL 和使用说明
用户请求:
我需要在将用户数据发送到前端之前对其进行格式化
您将:
创建自定义函数:
format_user_data实现 XanoScript 逻辑:
function format_user_data {
input {
object user_data
}
stack {
// 初始化结果变量
var $formatted {
value = {}
}
// 格式化时间戳
var.update $formatted {
value = $user_data|set:"created_at":($user_data.created_at|format_timestamp:"Y-m-d")
}
// 添加全名
var.update $formatted {
value = $formatted|set:"full_name":($user_data.first_name + " " + $user_data.last_name)
}
// 移除敏感字段
var.update $formatted {
value = $formatted|unset:"password_hash"|unset:"internal_notes"
}
response = $formatted
}
}
展示如何在 API 端点中使用该函数
使用示例数据进行测试
用户请求:
创建一个 Webhook 端点以接收来自 Stripe 的通知
您将:
创建 API 端点:
POST/webhooks/stripe实现处理器逻辑:
api stripe_webhook {
input {
text event_type
object data
}
stack {
// 记录 Webhook 事件
db.insert webhook_logs {
source = "stripe",
event_type = $event_type,
payload = $data,
received_at = timestamp.now
}
// 处理不同的事件类型
conditional {
if ($event_type == "payment_intent.succeeded") {
// 更新订单状态
db.update orders {
where = { stripe_payment_id: $data.id },
set = { status: "paid", paid_at: timestamp.now }
}
}
elseif ($event_type == "customer.subscription.deleted") {
// 处理订阅取消
db.update users {
where = { stripe_customer_id: $data.customer },
set = { subscription_status: "cancelled" }
}
}
}
response = { received: true }
}
}
配置 Stripe Webhook URL
使用 Stripe Webhook 测试工具进行测试
用户请求:
设置一个每日任务来清理过期的令牌
您将:
创建后台任务:
cleanup_expired_tokens实现清理逻辑:
task cleanup_expired_tokens {
stack {
// 获取当前时间戳
var $now { value = timestamp.now }
// 查找过期令牌
db.query oauth_tokens {
where = {
expires_at: { $lt: $now }
}
} as $expired_tokens
// 删除过期令牌
foreach ($expired_tokens) {
each as $token {
db.delete oauth_tokens {
where = { id: $token.id }
}
}
}
// 记录清理结果
db.insert task_logs {
task_name = "cleanup_expired_tokens",
tokens_deleted = $expired_tokens|count,
executed_at = $now
}
}
}
设置任务计划
手动测试任务执行
监控任务日志
此技能通过 MCP 集成,能够使用 Xano 的无代码平台构建完整的后端系统。使用 Xano 的自定义语法 XanoScript 创建数据库、API 和业务逻辑。不确定语法时,请始终参考 XanoScript 文档,并逐步测试以确保正确实现。
关键资源:
每周安装
0
仓库
GitHub 星标
2
首次出现
1970年1月1日
安全审计
Build serverless backend infrastructure using Xano's no-code platform through MCP (Model Context Protocol) server integration. Create databases, REST APIs, custom functions, and business logic using XanoScript without traditional coding.
Xano Account and Workspace :
MCP Access Token and URL :
https://x8ki-letl-twmt.n7.xano.io/mcp)MCP Server Configuration : This plugin includes MCP server configuration that connects automatically when enabled.
Set environment variables :
export XANO_MCP_URL="https://your-workspace.xano.io/mcp"
export XANO_MCP_TOKEN="your_access_token_here"
Or add to your shell profile (~/.zshrc, ~/.bashrc):
# Xano MCP Configuration
export XANO_MCP_URL="https://your-workspace.xano.io/mcp"
export XANO_MCP_TOKEN="your_access_token_here"
Restart Claude Code after setting environment variables.
The Xano MCP server will start automatically when this plugin is enabled, and Xano tools will be available in your Claude Code session.
Xano Components :
XanoScript Basics : Xano uses a proprietary syntax called XanoScript for defining logic. Key characteristics:
db.query, array.push, var.updateas $variable_name|filter_name:optionImportant : XanoScript syntax is unique to Xano. When working with XanoScript:
Understand the requirement :
Design the database schema :
Identify entities (tables) and relationships
Define fields with appropriate data types
Consider indexes for performance
Use MCP tools to create tables:
Use Xano MCP tools to create a table with specified fields
Create API endpoints :
Implement business logic with XanoScript :
db.query table_name { filters } as $results1. REST API for CRUD operations :
2. Webhook receiver :
3. External API integration :
4. Data transformation pipeline :
5. Scheduled background tasks :
Be mindful of syntax differences :
namespace.function (e.g., db.query, not db_query)$ prefix: $my_variableas keyword: db.query users {} as $users$users|count, not count($users)When uncertain about syntax :
Common XanoScript mistakes :
db_query("users") → ✅ db.query users { }var my_var = "value" → ✅ var $my_var { value = "value" }count($array) → ✅ $array|countif (condition) {} → ✅ conditional { if ($condition) { } }Once the plugin is enabled and environment variables are set, the Xano MCP server provides these tools automatically:
Using MCP tools : Simply ask Claude to perform Xano operations naturally (e.g., "Create a users table with email and name fields"). Claude will automatically use the appropriate Xano MCP tools to execute your requests.
Common issues :
Debugging approach :
Token management :
API security :
Data protection :
User request :
I need a backend to store user profiles with name, email, and bio
You would :
Use Xano MCP to create a table:
usersname (text, required)email (text, required, unique)bio (text, optional)created_at (timestamp, auto)Generate CRUD API endpoints:
/users - List all users/users/{id} - Get single user/users - Create userUser request :
Create an endpoint to receive LinkedIn OAuth callback and store the access token
You would :
Create database table:
oauth_tokensuser_id (text)provider (text) - "linkedin"access_token (text, encrypted)refresh_token (text, encrypted)expires_at (timestamp)Create API endpoint:
POST/oauth/linkedin/callbackUser request :
I need to format user data from the database before sending it to the frontend
You would :
Create custom function:
format_user_dataImplement XanoScript logic:
function format_user_data {
input {
object user_data
}
stack {
// Initialize result variable
var $formatted {
value = {}
}
// Format timestamp
var.update $formatted {
value = $user_data|set:"created_at":($user_data.created_at|format_timestamp:"Y-m-d")
}
// Add full name
var.update $formatted {
value = $formatted|set:"full_name":($user_data.first_name + " " + $user_data.last_name)
}
// Remove sensitive fields
var.update $formatted {
value = $formatted|unset:"password_hash"|unset:"internal_notes"
}
response = $formatted
}
}
Show how to use the function in API endpoint
Test with sample data
User request :
Create a webhook endpoint to receive notifications from Stripe
You would :
Create API endpoint:
POST/webhooks/stripeImplement handler logic:
api stripe_webhook {
input {
text event_type
object data
}
stack {
// Log the webhook event
db.insert webhook_logs {
source = "stripe",
event_type = $event_type,
payload = $data,
received_at = timestamp.now
}
// Handle different event types
conditional {
if ($event_type == "payment_intent.succeeded") {
// Update order status
db.update orders {
where = { stripe_payment_id: $data.id },
set = { status: "paid", paid_at: timestamp.now }
}
}
elseif ($event_type == "customer.subscription.deleted") {
// Handle subscription cancellation
db.update users {
where = { stripe_customer_id: $data.customer },
set = { subscription_status: "cancelled" }
}
}
}
response = { received: true }
}
}
Configure Stripe webhook URL
User request :
Set up a daily task to clean up expired tokens
You would :
Create background task:
cleanup_expired_tokensImplement cleanup logic:
task cleanup_expired_tokens {
stack {
// Get current timestamp
var $now { value = timestamp.now }
// Find expired tokens
db.query oauth_tokens {
where = {
expires_at: { $lt: $now }
}
} as $expired_tokens
// Delete expired tokens
foreach ($expired_tokens) {
each as $token {
db.delete oauth_tokens {
where = { id: $token.id }
}
}
}
// Log cleanup result
db.insert task_logs {
task_name = "cleanup_expired_tokens",
tokens_deleted = $expired_tokens|count,
executed_at = $now
}
}
}
Set up task schedule
Test task execution manually
Monitor task logs
This skill enables building complete backend systems using Xano's no-code platform through MCP integration. Create databases, APIs, and business logic using XanoScript - Xano's custom syntax. Always reference the XanoScript documentation when uncertain about syntax, and test incrementally to ensure correct implementation.
Key Resources :
Weekly Installs
0
Repository
GitHub Stars
2
First Seen
Jan 1, 1970
Security Audits
agent-browser 浏览器自动化工具 - Vercel Labs 命令行网页操作与测试
147,400 周安装
var $my_var { value = "initial" }var.update $my_var { value = "new" }foreach ($items) { each as $item { } }conditional { if ($condition) { } else { } }$data|filter_name:optionTest the implementation :
Generate API documentation :
Deploy and monitor :
/users/{id} - Update user/users/{id} - Delete userAdd email validation to POST endpoint using XanoScript:
conditional {
if ($email|is_email|not) {
response.error "Invalid email format"
}
}
Test endpoints and return API documentation URLs
code (text, required) - OAuth authorization codeuser_id (text, required)Implement function stack logic:
api oauth_callback {
input {
text code filters=required
text user_id filters=required
}
stack {
// Exchange code for token (would call LinkedIn API)
http.request {
url = "https://www.linkedin.com/oauth/v2/accessToken"
method = "POST"
body = {
grant_type: "authorization_code",
code: $code,
client_id: env.LINKEDIN_CLIENT_ID,
client_secret: env.LINKEDIN_CLIENT_SECRET
}
} as $token_response
// Store token in database
db.insert oauth_tokens {
user_id = $user_id,
provider = "linkedin",
access_token = $token_response.access_token,
refresh_token = $token_response.refresh_token,
expires_at = $token_response.expires_in|timestamp_offset
} as $stored_token
response = {
success: true,
token_id: $stored_token.id
}
}
}
Test the endpoint with sample OAuth code
Return endpoint URL and usage instructions
Test with Stripe webhook testing tool