Skip to Content
Foir AIConnect an AI agent

Connect an AI agent

Foir speaks the Model Context Protocol (MCP), the open standard that lets AI agents use external tools. Connect an agent, whether that is Claude Code, Claude, Cursor, or any other MCP-capable client, and it can work directly with your Foir workspace. It can browse your models, read and write records, manage media, run operations, and more.

Everything the agent does happens within your own access. It can never see or change anything you could not, and the same drafts and approvals rules apply as when you work in the admin yourself.

The Foir MCP server

The hosted server lives at:

https://mcp.foir.dev/mcp

You do not run anything yourself. Connect your agent to that address and sign in.

Most agents connect with a sign-in flow, so you never paste a key.

For Claude Code:

claude mcp add --transport http foir https://mcp.foir.dev/mcp

The first time the agent uses Foir, your browser opens a Foir consent screen. Sign in and approve, and the connection is ready.

For Claude and Cursor, add a custom connector (Claude) or an MCP server (Cursor) pointing at https://mcp.foir.dev/mcp. Both walk you through the same browser sign-in.

When you approve, you grant the agent access up to your own level, never more. If you only want the agent to look rather than change anything, choose read-only access at the consent screen.

Choose a workspace and project

Your Foir account may span more than one workspace or project, so a fresh connection starts by helping the agent find its footing. Ask the agent to list your workspaces and projects, then tell it which one to work in, for example “use the Marketing project in the Acme workspace.” From then on, everything it does is scoped to that project until you switch. Switching is explicit and logged, so an agent never wanders into a context you did not send it to.

Connect from the command line

If you use the Foir CLI, foir mcp bridges a local agent to the hosted server. It runs a small proxy and defaults to the project configured in your repository, which is handy for local, terminal-based agents.

The proxy authenticates with a secret API key rather than your CLI sign-in. Create one in the admin under your project’s API keys, then:

export FOIR_API_KEY=sk_... foir mcp

A publishable key will not work here, because the agent surface includes tools that change your content.

What an agent can do

Once connected and pointed at a project, an agent can discover your content model by listing models and inspecting their fields, so it writes valid records without you explaining your schema. It can read and write records: search, fetch, create, update, duplicate, and publish. Writes land as drafts, and publishing and deletes are separate, deliberate actions. It can also work with media, operations, schedules, hooks, and settings, the same surface you have in the admin.

A read-only connection sees only the read tools. A full-access connection sees the write tools too. Either way, the agent is bound to your permissions.

A note on trust

Treat content an agent reads as untrusted input to that agent, just as you would anywhere else. Start new or shared connections with read-only access, and only grant write access to agents you trust with your workspace.

Credits

Connecting your own agent does not spend AI credits. Credits pay for the models Foir runs on your behalf, and a connected agent brings its own model, so the tools it calls here are not billed as AI usage. Your agent’s own provider bills you for its model use in the usual way.

Fóir in the admin does run on Foir’s models, so it spends credits from your workspace balance. If a Foir feature ever runs a model for you from a connected agent, that action will draw credits and will say so.

Last updated on