Skip to main content
MCP — the Model Context Protocol — is a standard way for AI models to interact with services outside of themselves, like your Xano database. Each individual action you expose to a model is called a tool. Xano’s MCP Builder lets you build those tools exactly the way you build any other function stack, and expose them to any client that supports MCP — Claude, Cursor, ChatGPT, or one you build yourself.

Why build MCP servers in Xano?

Instead of being limited to REST APIs designed for web and mobile apps, you can build AI-native functionality: function stacks meant to be called by an AI model in response to a request like “Check the user table for any admins that haven’t logged in since the first of the month, and send them a reminder about our activity policies.” That means you can create tools for your AI to:
  • Retrieve specific data from your Xano database based on natural language queries
  • Perform complex data manipulations and calculations triggered by AI insights
  • Write data back to your Xano database based on AI-driven decisions or user requests interpreted by the AI
  • Interact with external APIs and services through your Xano function stacks, orchestrated by the AI
  • Interact with the APIs and services you’ve already built in Xano
Not building for MCP specifically, and just want a chatbot or a connection to a model like ChatGPT? See Chatbots instead.

What’s supported with Xano’s MCP Builder?

Servers you build in Xano speak Streamable HTTP, the transport the official MCP SDK has standardized on — that’s the connection URL to hand your clients, and the one to build against. Both Tool and Resource tool types are available, and you can use any available function we have today in your MCP servers.
The older SSE transport is deprecated and will be sunset in v2.6. If you’re still on an /sse connection URL, switch to the streaming one — it’s under Connect this backendMCP Server URLs. See the v2.5 release notes for the full deprecation notice.
As MCP is an evolving protocol, we aim to continue to expand the functionality as it develops. If you are utilizing MCP in Xano and have any feedback or questions, please reach out to our support team.

Getting Started with MCP Builder

First, create an MCP Server.

To build MCP servers in Xano, we’ll first need to create a server that will house some tools.
1

From the sidebar, click Agents & MCP

2

Click + Add MCP Server to create your first MCP server

3

Fill out the necessary information

  • Name - Give your server a name that clearly indicates its purpose.
  • Description - This is an internal field just for you to expand on the purpose of the MCP server.
  • Allow Connections - Choose whether or not to allow connections to this MCP server
  • Add Tag - Tag your MCP servers for easier search throughout your Xano workspace.
  • MCP Instructions - These instructions are what your clients will look at to understand the purpose of the MCP server. Markdown format is recommended for easy readability for your LLMs and clients. These instructions apply to the server as a whole, and are not used for individual tool instructions.

After you’ve created a server, add some tools.

What is a tool?

Tools are essentially individual actions that your MCP server can perform, such as querying a database, adding new records, or calling an external API. You’ll build tools just like you build any other function stack. Most of the time you already have the logic — an API endpoint or a function stack you built for your app. Exposing one of those as a tool is a couple of clicks and leaves you with one stack to maintain, so start there. Build a tool from scratch when there’s nothing to reuse.

Tool Types

You’ll select your tool type when connecting a tool to your MCP server, after it’s been created.

Tool

A tool is an action that your MCP server can perform. Each tool has its own set of logic that defines its behavior, such as querying a database, adding new records, or calling an external API. Usually that logic is an API endpoint or a function stack you already built — you expose it as a tool rather than rewriting it.

Resource

Resources allow servers to share data that provides context to language models, such as files, database schemas, or application-specific information. Each resource is uniquely identified by a URI.
From your MCP server, click the icon next to the tool you want to change the type on, and select Connection Settings. From there, you can change the tool type. For resource tools, make sure to specify a URI, which is what clients will use to reference the resource.

Using Existing Function Stacks as Tools

1

In the existing function stack, click the ⋮ settings icon in the upper-right corner and click Use As AI Tool

2

Choose the MCP Server you'd like to add the tool to, and give it a name. This name is what the command will be, so make sure it's understandable

3

Navigate to your MCP Server and check for the newly created tool

Xano will not make a copy of your existing function stack; instead, it will use a Run Endpoint function and call that API internally. This is ideal so you only have to maintain one function stack.

A tool created from an existing API endpoint

4

Adjust the settings for your newly created tool and add instructions

Instructions are important to have so the AI models and clients interacting with this tool understand how to use it.

Creating Tools from Scratch

1

In your MCP Server, click + Add Tool

2

Fill out the required information

  • Name
    • Give your tool a recognizable name. This is also the command that will be used to execute your tool.
  • Description
    • This is an internal-only field just for you to describe the purpose of the tool.
  • Allow Connections
    • Enable or disable connection to this specific tool
  • Add Tag
    • Tag your tools for easier search across your Xano workspace
  • Authentication
    • Determine if this tool requires an authentication token
  • Tool Instructions
    • These instructions are what your clients will use to understand how to send requests to the tool, and what the expected result will be. Markdown format is recommended.
3

Build your tool's function stack

If you haven’t already, make sure you’re familiar with Xano’s visual builder.We also have some specific functions that may be useful to you when building tools that allow you to interact with existing function stacks.MCP Functions
4

When you're ready, publish your changes

Building an app to run right inside of ChatGPT? That’s what the Resource tool type is for — see Build apps in ChatGPT with Xano.

MCP Authentication

Your MCP tools can require authentication, and there are two ways a client can satisfy it.

A bearer token on the Authorization header

Set a tool’s Authentication on, and Xano validates the token the same way it does for the secure APIs you’re already building. You paste that token into your client’s config and it rides along with every request. This is the quick path, and it’s all most header-capable clients need — Claude Code, Cursor, VS Code, Windsurf, Antigravity, Raycast, Warp, Gemini CLI, Codex CLI. See Connecting Clients for the per-client setup.
A header token is shared, not per-user. Every client configured with it sends the same credential, so Xano sees one identity no matter who is asking. $auth can’t tell your users apart, tools can’t scope data to the caller, and revoking access for one person means rotating the token for everyone.That’s a reasonable gate for you and your team on your own machines. It stops being one the moment you ship an MCP server to people who should each see only their own data.

OAuth, for per-user identity and OAuth-only clients

Xano MCP servers don’t expose an OAuth authorization server of their own — no /authorize, no /token, no discovery document for a client to find. You can supply that missing front end with a small Cloudflare Worker that sits in front of your server: it speaks OAuth to the client, exchanges the sign-in for that user’s own Xano user-table JWT, and forwards that JWT upstream. Every request then arrives as the person who made it, and $auth scopes data per user natively. You need this when:
  • Your client can’t send a header at all. Claude Web, Claude mobile, Claude Desktop’s Add custom connector dialog, ChatGPT developer mode, and Microsoft 365 Copilot are OAuth-only.
  • You need per-user identity — on any client, including the header-capable ones.
A token in the connection URL isn’t a third option. The MCP spec has prohibited access tokens in the URI query string since its 2025-06-18 revision, and the Claude surfaces run an OAuth handshake for every custom connector — so a URL token sends you to a consent page that can’t complete. Use it only as a shared gate on clients you control, validated in a trigger.
The guide below walks the whole build — four small files, a few wrangler commands, and the log-reading to verify it. Each step ships a ready-made prompt you can hand to a coding agent, and it all runs on Cloudflare’s free plan.

Add OAuth to a Xano MCP server

The agent-driven path: what OAuth buys you, how the pieces fit, and a prompt per step.

Manual setup

Every command and expected response written out, plus the full spec detail — RFC 9728 discovery, PKCE, DCR vs. CIMD.

MCP Variables

When working with data as part of an MCP tool function stack, you have access to two special variables.
The example connection URLs below use the /sse endpoint, which is being deprecated in v2.6 — see the deprecation notice above.

token

The Token variable contains a token that is passed as part of the connection URL. This token can be used for building custom authentication, or any other purpose that you see fit. https://your-xano-instance.xano.io/x2/mcp/67Dx5RNL/``token_here``/sse

params

You can also pass URL parameters as a part of your connection URL, such as ?beta=true https://yourxano.stage.xano.io/x2/mcp/67Dx5RNL/token_here/sse``?beta=true¶m=here You can use the URL parameters in your tool function stacks to determine the behavior of the tool(s).

Hint

Use the token and / or params in combination with Triggers for building powerful and complex MCP logic. One common use: validating the URL token in an MCP server trigger, as a shared gate on clients you control. Note that Claude Desktop, Claude Web, and Claude mobile can’t use a token in the URL — they need OAuth in front of your server.

Connecting to your MCP Server

Now that you’ve built an MCP server and added some tools to it, you can connect with your client of choice. Choose from the list below for a quick getting started guide. If you’re new to MCP servers, we recommend starting with Cursor.

Cursor

Claude Code


Video walkthroughs

70212fa8-image
Introduction to MCP
d15b18c8-image
Build an MCP Server in 10min or Less
cbf3184d-image
MCP Tools and Functions
01921a63-image
Building an MCP Server & Client

Best Practices

There are some best practices when building tools that we recommend following for the best experience.
  1. Use enum inputs wherever possible so the AI model understands what options are available for your inputs.
  2. Use clear naming conventions and instructions.
  3. Try to find a balance when writing instructions between being clear and descriptive, but also concise. Reducing the amount of tokens sent to an AI model will reduce token cost, improve speed, and improve responses.
  4. Use error handling with clear error messages. If an AI model fails to use a tool, clear error messages will allow it to retry the tool successfully.

FAQ

  • Standardization: MCP provides a common way for different applications and LLMs to interact, reducing the need for custom integrations.
  • Interoperability: MCP enables different LLMs and applications to work together more easily.
  • Flexibility: MCP allows developers to connect LLMs to a wide range of external resources.
  • Efficiency: MCP streamlines the process of building AI agents and applications.
No, MCP is designed to be an open and vendor-neutral protocol, allowing it to be used with various LLMs and platforms.
While APIs provide access to specific functions, MCP provides a standardized way for LLMs to discover and use those functions in a context-aware manner.
Context is crucial in MCP. It provides the LLM with the necessary information about the user’s request, the available tools, and the overall environment, enabling the LLM to make more informed decisions.
MCP emphasizes secure communication between clients and servers. Mechanisms like authentication, authorization, and secure data transfer are important considerations in MCP implementations.
Yes, in Xano you can build multiple MCP servers and they can all have their own tools available.