Connect your app to AI agents (MCP and OpenAPI)
Turn on Agent access and your app's backend becomes a set of tools that Claude, Cursor, and other agents can use.
4 分钟阅读Every full-stack app you build has a typed backend: queries that read data, mutations that change it, and actions that talk to other services. With one switch, that backend can also be used by AI agents and by other programs. Your app becomes agent-ready without any extra code.
What you get
- An MCP server at https://your-app.ayospeedide.app/api/mcp. MCP is the standard way agents like Claude Desktop, Claude Code, and Cursor discover and call tools. Each public function in your backend becomes one tool.
- An OpenAPI document at https://your-app.ayospeedide.app/api/openapi.json, which describes every public function for API clients, code generators, and tools like Postman.
- One address per function, for example POST /api/query/notes:list, that takes the function's arguments as JSON. This is what the OpenAPI document describes.
Turning it on
- 1
Open the Backend panel
Inside your project, open Backend from the top toolbar and find the Agent access card.
- 2
Flip the switch
Only the project owner can change this. The card shows your MCP and OpenAPI addresses as soon as it is on.
- 3
Publish
The setting takes effect the next time you publish. Your preview stays private to your team, so agents can use your tools once your app is live.
Connecting Claude Desktop or Cursor
Copy the config snippet from the Agent access card into your agent's MCP settings. It names your app's MCP address and, optionally, a sign-in token:
{
"mcpServers": {
"your-app": {
"url": "https://your-app.ayospeedide.app/api/mcp",
"headers": { "Authorization": "Bearer <your token>" }
}
}
}The token is the same sign-in token your app uses in the browser. If your app has sign-in connected, sign in and use your session token; the agent then acts as you, and sees exactly what you would see. Without a token, the agent can only call functions that work for signed-out visitors.
What agents can and cannot do
- Only public functions are listed. Internal functions, the ones your app keeps for its own use, are never exposed.
- The same checks apply as in the app: a function that needs sign-in still needs it, and arguments are validated before anything runs. An agent that sends the wrong arguments gets a clear error instead of a crash.
- Tools are named after their module and function, like notes__add for the add function in notes. A short description you give a function (its description field) is what the agent reads, so clear names and descriptions help agents use your app well.
Agent access only changes who can discover your backend, not what it allows. Anything a signed-out visitor could already call from the app can also be called by an agent, so make sure your functions check who is asking.
Ask AyoWizzy to give your backend functions clear descriptions. A line like 'Adds a note for the signed-in user' helps an agent pick the right tool.