Connect AI agents to your app
Your app's users can connect Claude or OpenAI's Codex CLI to your application. The agent signs in as the user, to one of their app-tenants, and can then read and, unless the user turned off Allow changes, change the records that user can, as the app's API allows. There is nothing to build or register: every application has an MCP URL, and MultiPaaS handles the agent's sign-in.
Get your app's MCP URL
The URL for your application's default environment is:
https://api.multipaas.com/mcp/app/APP_ID
Another environment has its own URL, ending in /env/ENV_ID. Agents connected to it see only that environment's app-tenants and records.
You can copy the URL from your application's API page in the console. It shows the default environment's URL and, when you're working in another environment, that environment's too. Or print it with the CLI, version 1.13.0 or later:
multipaas apps mcp-url --app APP_ID
multipaas apps mcp-url --app APP_ID --env ENV_ID
In your app's directory, --app defaults to multipaas.json's application, and --env to its environment when the file is for the application --app names. That environment is often a test environment, so pass --env with the id of the environment your app's users work in. The default environment's id prints the URL without /env/.
What the agent can do
For each entity in your model, the agent gets a tool to list records, with filters and paging, and one to get a record by id. It acts as the signed-in user in the app-tenant they chose, so it reads exactly what that user can read, and nothing from other app-tenants. It always uses your model's newest API version. An application with no model gives the agent no tools.
Where your generated API offers it, the agent also gets tools to create, update, delete and restore each entity's records. They follow the same rules as the API: the agent can change only what the signed-in user could change, an update can pass the record's version to refuse the change if the record changed since it was read, when your newest API version has record versions (make a newer version if it was made before they were added), and delete retires a record, which restore brings back. Each tool that changes or deletes a record is marked as one. Whether Claude asks the user before such a call depends on how the user has set Claude up: on claude.ai and in the desktop app, on the tool's permission setting and the mode Claude is working in, and in Claude Code, on its permission mode and permission rules. A refused or invalid change comes back to the agent with the reason, and the connection keeps working. If the user turned off Allow changes when they connected, the agent gets only the list and get tools.
The agent sees the descriptions you gave your model: an entity's description is in its tools' descriptions, a field's is on that field's input, and an enum input carries the enum's own description and lists the values you described. Claude Code 2.1.331 or later can also get a skill for your app, with your entities, fields and descriptions, and guidance on using the tools. Not every Claude Code setup offers MCP skills yet: see which ones do.
Connect from Claude
In Claude on the web or in the desktop app:
- Open Customize, then Connectors, choose + Add, and then Add custom connector.
- Give it a name and paste the MCP URL, then add it.
- Connect it. Claude opens MultiPaaS's sign-in. Sign in, pick the app-tenant, choose whether to allow changes, and approve.
On a Team or Enterprise plan, your app's users usually can't add the connector themselves: they ask their organization's owner, who adds it for the organization first, in Organization settings, then Connectors. Members then connect to it individually.
In Claude Code:
claude mcp add --transport http my-app MCP_URL
Use the MCP URL you got in Get your app's MCP URL for MCP_URL, so an environment's /env/ENV_ID carries through. This adds the server to the current project only. To make it available in every project, add --scope user:
claude mcp add --transport http --scope user my-app MCP_URL
Then run /mcp in Claude Code, choose the server, and sign in in the browser it opens.
Connect from Codex
In OpenAI's Codex CLI, version 0.172.0 or later:
codex mcp add my-app --url MCP_URL
Use the MCP URL you got in Get your app's MCP URL for MCP_URL. Codex sees that the server needs sign-in and opens MultiPaaS's sign-in in your browser. Sign in, pick the app-tenant, choose whether to allow changes, and approve. The server is added for every project. my-app is a name you choose. Give each server you add its own name, such as one for each app, environment or app-tenant you connect, because adding a server under a name that is already in use replaces that server. To sign in again later, use the same name:
codex mcp login my-app
Signing in
The sign-in page is the same one your app's own users see, and it names the agent that's asking, such as Claude or Codex. The user picks one of their app-tenants in that environment. They also choose whether the agent may change records: Allow changes is on by default, and with it off the agent can only read. The user can disconnect the agent in Claude, or sign it out in Codex with codex mcp logout my-app, to end its access.
More
- Add end-user sign-in covers sign-in for your own app.
- Using Claude Code to build your app? The MultiPaaS plugin can print the MCP URL for you.