Introduction
Themcp_server primitive lets you define MCP servers using XanoScript.
Each MCP server corresponds to a collection of tools that an AI agent can access to perform specific tasks with your Xano backend — expressed in code.
MCP servers will typically:
- Declare their name and description
- Include instructions for the AI agent
- Reference existing tools in your workspace
- Support tagging for organization
Anatomy
Every XanoScript MCP server follows a predictable structure. Unlike other primitives, MCP servers are not split into multiple sections. Instead, they have a single block that contains all of the information needed to define the server. Here’s an example of a fully defined MCP server in XanoScript:XanoScript
Parameter definition
What’s Next
Now that you understand how to define MCP servers in XanoScript, here are a few great next steps:Learn about AI Tools
Create the tools that your MCP server will reference and make available to AI agents.
Try it out in VS Code
Use the XanoScript VS Code extension with Copilot to write XanoScript in your favorite IDE.