ObjectOS
Configure

Connect AI Tools (MCP)

Point Claude Code, Claude Desktop, or any MCP client at your ObjectOS app and let agents work with your data under your permission model.

Every ObjectOS deployment is already an MCP server. The runtime serves the Model Context Protocol at /api/v1/mcp — on by default, no plugin to install, no configuration step. Your objects and exposed actions become typed tools the moment you define them; the only thing left to do is connect a client and prove it works.

To turn the surface off, set OS_MCP_SERVER_ENABLED=false — the endpoint then returns 404 and the Setup → Connect an Agent page disappears with it.

On ObjectOS Cloud each environment has its own switch: a new environment's MCP endpoint starts on, an owner or admin can turn it off at any time, and every plan has a request limit. See On ObjectOS Cloud.

This page is about connecting external AI tools to your app. For the server-side AI stack — chat providers, embedders, RAG, and registering the MCP server plugin explicitly in code — see AI Service.

Claude Code (one command)

Interactive clients use OAuth — each deployment is its own OAuth 2.1 authorization server, so there are no admin-minted credentials to pass around. The first tool call opens a browser login and you connect as yourself:

# local dev server
claude mcp add --transport http my-app http://localhost:3000/api/v1/mcp

# a deployed instance
claude mcp add --transport http my-app https://your-deployment.example.com/api/v1/mcp

On a local dev server you don't even have to type this: since 16.0 the os dev startup banner prints the MCP endpoint, the agent-skill URL, and a ready-to-paste claude mcp add command.

For headless use (CI, containers) skip OAuth and attach an API key instead:

claude mcp add --transport http my-app https://your-deployment.example.com/api/v1/mcp \
  --header "x-api-key: osk_..."

Claude Desktop and claude.ai

Settings → Connectors → Add custom connector, then paste the MCP URL (https://your-deployment.example.com/api/v1/mcp). The first use walks through the same browser login.

Any MCP client (.mcp.json)

Clients that read an mcpServers map connect the same way. With an API key:

{
  "mcpServers": {
    "objectstack": {
      "type": "http",
      "url": "https://your-deployment.example.com/api/v1/mcp",
      "headers": { "x-api-key": "osk_..." }
    }
  }
}

Headless: API keys

Mint a key from Setup → Connect an Agent (which also shows copy-paste-ready connect snippets per client), or over REST:

curl -b cookies.txt -X POST https://your-deployment.example.com/api/v1/keys
# → { "key": "osk_..." }  — shown once; store it in your secret manager

Send it on every request in any of three equivalent forms:

HeaderExample
x-api-keyx-api-key: osk_...
Authorization: ApiKeyAuthorization: ApiKey osk_...
Authorization: BearerAuthorization: Bearer osk_... (recognized by the osk_ prefix)

OAuth requires TLS — plain-HTTP deployments (except localhost) fall back to API-key-only: the browser-login track is disabled rather than allowed to run insecurely.

For a long-lived integration, bind the key to a dedicated service user with a minimal permission set — see Service accounts & API keys.

The stdio transport (16.0)

Besides HTTP, the runtime can serve MCP over stdio for hosts that spawn the server as a child process. Since 16.0 (ADR-0101) stdio has its own switch and always runs under a real identity:

  • OS_MCP_STDIO_ENABLED=true turns stdio auto-start on (default off). OS_MCP_SERVER_ENABLED now governs only the HTTP surface — the legacy behavior where OS_MCP_SERVER_ENABLED=true also started stdio still works for one release, with a deprecation warning.
  • Stdio requires OS_MCP_STDIO_API_KEY=osk_.... The key is resolved through the same verify + authorization chain as HTTP and REST, so object permissions, record access, field-level security, and tenant scoping apply to stdio calls exactly as on /api/v1/mcp — and the key is re-resolved per read, so revoking it takes effect immediately.
  • The transport is fail-closed: enabling auto-start without a resolvable key refuses to boot, and there is deliberately no unscoped fallback and no system bypass. For full authority, mint the key on a platform-admin or dedicated service identity.

What the agent gets

Eleven data, action, and authoring tools, generated from your metadata:

ToolWhat it does
list_objects / describe_objectDiscover which objects exist and their fields
query_records / get_recordRead data (list queries are capped at 50 rows per page by default)
validate_expressionLint a formula against the real object schema before saving it (16.0): errors (bare field refs, unknown fields with did-you-mean), warnings (type-soundness, date-equality pitfalls), the in-scope field/function inventory, and the inferred result type. Read-only, data:read-scoped, fail-closed on sys_*
aggregate_recordsGrouped aggregation (registered when the active driver supports it)
create_record / update_record / delete_recordWrite data
list_actions / run_actionDiscover and invoke your business actions by name

Two exposure rules to know:

  • Objects are exposed automatically — except sys_* system objects, which are blocked fail-closed.
  • Actions require the author's opt-in: ai: { exposed: true } plus an ai.description of at least 40 characters, and the action must be callable without a UI (script with a body or registered handler, or flow).

Permission enforcement

  • Every call runs as the caller. The MCP bridge resolves the same execution context as a REST request, so object permissions, record access, and field-level security apply to the agent exactly as they do to a person in the UI. Sparse results or denied writes usually mean governance is working, not that the connection is broken.
  • OAuth scopes narrow the toolset. Tokens carry data:read, data:write, and actions:execute scopes — tools outside the granted scopes are not even registered for that session. API-key and session callers get the full set, still permission-checked per call. A fourth scope, metadata:write, serves build tools only where the deployment provides them: on ObjectOS Cloud, see Build with an agent.
  • Action bodies run as trusted app code once invoked (the ai.exposed gate and requiredPermissions are checked at invoke time). Treat writing an action as a code-review-worthy act — that's the real security boundary.
  • An action can also declare ai.requiresConfirmation; destructive-looking actions default to requiring it.

Verify the connection

Ask the agent something only the live schema can answer:

What objects does this app have, and what fields does the main one carry?

You should see list_objects and describe_object fire. The natural working pattern for an agent is list_objects → describe_object → query_records → run_action — if all four work, the connection is fully operational.

Agents work noticeably better with the app's skill file: download it from GET /api/v1/mcp/skill, or install the official Claude plugin (claude plugin marketplace add objectstack-ai/claude-plugin), which bundles the skill and a guided /objectstack:connect command.

On ObjectOS Cloud

Everything above applies to an ObjectOS Cloud environment once its endpoint is on. Four things differ: the switch, the limits, where the connection details live, and that an agent can build the app as drafts.

Turn on AI agent access

Exposing an environment's data to an outside AI client is the organization's decision, so each environment has its own switch, on every plan (ruled on cloud#1248). A new environment starts with it on, and an owner or admin can turn it off at any time (ruled on cloud#3628). An environment created before that keeps the switch it had, so an older environment may still be off.

The steps below are needed only for an environment whose endpoint is off: an older one, or one that was turned off.

  1. In the cloud console, open the environment's page and its Settings tab. Under Access and sign-in, the AI agent access (MCP) row reads Now: off.
  2. Choose Enable AI Agent Access and confirm. Only the organization's owners and admins are offered it.
  3. Give it a few seconds: the environment picks up the change on its own, with no redeploy. The row then reads Now: on, and the environment's Overview shows the same state.

Once it is on, Connect an Agent appears inside the environment's own console, in two places that open the same page: Account → Developer, for every signed-in user, and Setup → Integrations, for users with Manage Platform Settings. That page shows the environment's endpoint URL — its address followed by /api/v1/mcp — a connect card per client, the skill file, and the API-key minter.

Connect

Interactive clients use the browser sign-in described above: the agent then acts as you, inside your own permissions, row-level security and field access. Headless clients — CI, scripts — use an API key minted on Connect an Agent in the card API keys · headless; a key acts as the person who minted it and can never be minted for someone else.

Build with an agent

An agent can also build the app: create and change its objects, fields, views, pages, dashboards, flows and actions, not only its records. Everything it builds is a draft until a person publishes it.

Ask for metadata:write. The build tools are served only to a browser sign-in whose grant includes the metadata:write scope. The environment advertises it beside data:read, data:write and actions:execute, so a client that asks for the scopes an environment advertises gets it when you sign in. If your client asks for scopes by name, add metadata:write; if you signed in without it, reconnect. An API key never opens the build tools. The scope opens the tools and nothing more: every call runs as you, and needs the manage_metadata or studio.access permission in that environment, the same as the AI Builder.

What the tools do.

ToolsWhat they do
get_authoring_rules, get_metadata_schemaThe rules this environment builds by, and the shape of a metadata type
list_metadata, describe_metadata, list_packages, get_packageWhat the environment holds now
propose_blueprint, apply_blueprintDesign an app or a feature from a description, then stage the whole design
create_object, add_field, modify_field, delete_fieldChange objects and fields
create_metadata, update_metadata, apply_editCreate any type the environment builds, change one, or apply a structured edit to an existing app
create_seedAdd sample data
create_packageCreate a package to build in
verify_buildCheck the drafts against the platform's rules and report what it refuses

Each call names its package (packageId or targetApp); nothing carries a working package from one call to the next. toggle_flow and test_flow are not served here, because a flow an agent stages is a draft that does not run.

Every write is a draft, in every environment. That includes production. No tool publishes and no tool discards. Each write's result says the change is not live and carries a staged block naming the drafts and the address where they are published.

A person publishes in Studio → Changes. Open the package in Studio and its Changes view (/_console/studio/<package>/data in the environment), review what the agent staged, and publish or discard it. An agent that tells you it has created something has drafted it; the app shows it once it is published.

Removing or narrowing needs confirm: true. delete_field, modify_field, apply_edit and update_metadata take a confirm argument. A call that would remove a field, change a field's type or drop a step from a flow stages nothing without confirm: true, and the answer names what publishing it would lose. A change that only adds never needs it.

How much an agent can build. Build calls are MCP requests, so the request limits apply to them. Two more limits count building (Storage and Limits):

FreeTeam and above
Build writes through MCP, per environment per UTC day2002,000
Unpublished drafts per environment, made any way500500

Reads and verify_build do not count as writes. Past either limit the tool call is refused with RATE_LIMIT_EXCEEDED, the count, and what resets it: the next UTC day for writes, a publish or a discard for drafts.

Why is my flow refused? It uses something an agent cannot build here, and the refusal names which: a scheduled or time-relative flow on Free, an approval step on Free, or a kind that is built in source and published as a package.

An agent builds flows started by a record change or a button, from create, update and delete record, assignment, decision, loop and wait steps. Scheduled and time-relative flows are built on Team and above, and approval steps on Team and above (plans). Scripts, webhooks, API-triggered and screen flows, and the types script, webhook, API, job, email template, translation, theme, plugin, agent, skill and data source are built in source on any plan.

Limits

Each environment's endpoint accepts a set number of requests, shared by every agent connected to it (ruled on cloud#3203):

PlanPer minutePer UTC day
Free201,000
Team and above120No daily cap

Past a limit the endpoint answers 429 with Retry-After and the code RATE_LIMIT_EXCEEDED; the message says which limit was hit and when it resets. What counts as a request, and the draft and authoring-write limits beside it, are on Storage and Limits. The switch is kept across a plan change, so a downgrade or upgrade never turns it on or off.

Turn it off

In the same row, Disable AI Agent Access stops the environment serving the endpoint within seconds, cutting off every connected agent — browser sign-ins and API keys alike. It does not revoke anything else:

  • API keys keep working for the REST API. To retire a key itself, delete it from Account → Developer → API Keys (your own) or Setup → Access Control → API Keys (everyone's, with Manage Platform Settings).
  • Browser sign-ins are not revoked, but their tokens are accepted only by the MCP endpoint, so while it is off they reach nothing.

On ObjectOS Cloud: troubleshooting

SymptomCause
No AI agent access (MCP) row on the environment's SettingsOnly owners and admins of the organization see it
Connect an Agent is in neither Account → Developer nor Setup → IntegrationsAI agent access is off (an older environment, or one that was turned off) — turn it on; if it was turned on a moment ago, reload
Connect an Agent is under Account → Developer onlyYou lack Manage Platform Settings in that environment; the Account entry opens the same page
429 from the clientThe environment's agents went past its limit; wait the Retry-After seconds, and look for an agent repeating the same call
No build tools on the connectionThe sign-in did not grant metadata:write, or the client uses an API key; reconnect with the browser sign-in and grant it
A build tool answers PERMISSION_DENIEDYou lack manage_metadata and studio.access in that environment
The agent built something the app does not showIt is a draft; publish it in Studio → Changes
A build tool answers RATE_LIMIT_EXCEEDED naming build writes or draftsThe day's build writes or the draft limit is used up; wait for the next UTC day, or publish or discard drafts

Troubleshooting

SymptomCause → fix
404 on /api/v1/mcpThe surface is disabled — unset OS_MCP_SERVER_ENABLED (default is on)
501 Not ImplementedThe MCP plugin isn't part of this build — check your stack's plugins
Boot refuses with stdio enabledStdio is fail-closed (16.0) — set OS_MCP_STDIO_API_KEY to a resolvable osk_ key, or turn OS_MCP_STDIO_ENABLED off
401 on every callAnonymous or invalid credentials. Interactive clients: complete the browser login. Headless: check the osk_ key and header spelling
403 insufficient_scopeThe OAuth token lacks the scope for that tool family (e.g. writes without data:write) — reconnect and grant the scope
An action is missing from list_actionsai.exposed is not true, ai.description is shorter than 40 characters, the type isn't headless-callable (url / modal / form never appear), it targets a sys_* object, or the caller fails its requiredPermissions
Reads return few rows / writes deniedWorking as designed — the caller's permissions and record access apply. Verify with the same user in the UI

Where to go next

TaskPage
Configure AI providers, embedders, and the MCP server pluginAI Service
Create service users and API keysUsers & Organization
Understand what the agent is allowed to seePermissions
REST API and key managementAPI Access
Verify a specific user's accessManaging Access

On this page