> ## Documentation Index
> Fetch the complete documentation index at: https://docs.formation.texturehq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect agents to your systems

> Choose how an agent talks with your product, acts in your systems, acts for your users, and runs on your own infrastructure.

An agent can connect to your systems in two directions, and they are set up
separately:

* **Conversation in.** Your product sends people's messages to the agent and
  shows its answers. This is a [connector](https://docs.formation.texturehq.com/connectors/overview.md). For your own
  software it is the [webhooks connector](https://docs.formation.texturehq.com/connectors/generic.md).
* **Capabilities out.** The agent calls your systems while it works: reads
  records, opens tickets, changes settings. These are [tools](https://docs.formation.texturehq.com/runtime/tools.md),
  usually a [remote MCP server](https://docs.formation.texturehq.com/runtime/remote-mcp.md) or a
  [REST API connection](https://docs.formation.texturehq.com/runtime/rest-api-connections.md).

An inbound message never grants a capability, and a tool server never carries
conversation. A product that wants both sets up both. Neither blocks the other.

## Choose a connection

| You want the agent to | Use | Credential | Guide |
| - | - | - | - |
| Live inside your web or mobile app | Webhooks with streaming, conversation history and in-app decisions | A signing secret Formation issues, held by your backend | [Build an agent into your product](https://docs.formation.texturehq.com/connectors/your-application.md) |
| Call your own system's operations as tools | Remote MCP server over Streamable HTTP | The agent's own API key, bearer token or OAuth grant | [Remote MCP](https://docs.formation.texturehq.com/runtime/remote-mcp.md) |
| Use a service that already has a hosted MCP server | **Add tool** library, from bundled entries and an online registry you can replace or turn off | The agent's own account at that service | [Add and manage tools](https://docs.formation.texturehq.com/runtime/capability-setup.md#mcp-servers), [Tool discovery](https://docs.formation.texturehq.com/runtime/tool-discovery.md) |
| Call an HTTP or GraphQL API that has no MCP server | REST API connection | The agent's own token, in a header you choose | [REST API connections](https://docs.formation.texturehq.com/runtime/rest-api-connections.md) |
| Limit a read to what the asking user may see in your app | Delegated MCP queries (`conversation-v1`) | The agent's MCP credential, plus a short-lived grant your system issues per user | [Delegated MCP queries](https://docs.formation.texturehq.com/runtime/delegated-mcp.md) |
| Let Microsoft Teams users link their account in your app | Account linking, optionally with linked-user queries | A broker token for the agent; your service holds the link | [Messaging account linking](https://docs.formation.texturehq.com/runtime/account-linking.md), [Linked messaging users](https://docs.formation.texturehq.com/runtime/delegated-mcp.md#linked-messaging-users) |
| Check out repositories, push branches and open pull requests | GitHub or GitLab, with sandbox delivery | The agent's own personal access token | [Add and manage tools](https://docs.formation.texturehq.com/runtime/capability-setup.md#github-and-gitlab), [Workspace credentials](https://docs.formation.texturehq.com/runtime/workspace-credentials.md) |
| Sign in to a website or use a secret in a command | Agent vault | Secrets a person supplies through a one-time link, or an operator adds | [Agent vault](https://docs.formation.texturehq.com/runtime/agent-vault.md) |
| Recognize one person across their accounts on different connectors | Identity linking | A code the person carries between their own private conversations | [Link accounts across platforms](https://docs.formation.texturehq.com/runtime/identity-linking.md) |
| Configure connections from your own automation | Connection API and operator API | An operator API token | [Manage connections](https://docs.formation.texturehq.com/runtime/connection-management.md), [Operator API](https://docs.formation.texturehq.com/operator-api.md) |

## Whose identity a call uses

Every acting account belongs to one agent: its GitHub account, its MCP account,
its API token, its website logins. Two agents must not act as the same external
account. Model keys, sandbox providers and identity-neutral web services can
have instance defaults; acting identities are never inherited. See
[identity and permissions](https://docs.formation.texturehq.com/runtime/tools.md#identity-and-permissions).

So an MCP or REST API connection authenticates **the agent**, not the person
talking to it. Its results are available across that agent's conversations.
When each user should see only their own data, add these layers on top of the
agent's connection:

1. **Your app decides who the user is.** Your backend sets `actor_id` and
   `session_scopes` on each signed message from its own authenticated session.
   Scopes are context for the agent, not permissions. See
   [sending a message](https://docs.formation.texturehq.com/connectors/generic.md#sending-a-message-to-the-agent).
2. **Your MCP server restricts each read.** A read-only tool that declares
   `conversation-v1` receives execution context naming the agent, actor,
   conversation and run. Your server uses it to look up a short-lived grant
   your system issued for that user, and refuses the call without one. Context
   alone is not authorization. Results and anything derived from them stay in
   that private conversation. See [Delegated MCP queries](https://docs.formation.texturehq.com/runtime/delegated-mcp.md).
3. **For Teams users, your service links the account.** A verified Teams user
   sends `/connect` in a direct message, signs in to your app, and consents.
   For read-only tools that also opt into linked-user queries, Formation asks
   your broker for a one-use grant before each call. See
   [Messaging account linking](https://docs.formation.texturehq.com/runtime/account-linking.md).

Formation never forwards a user's credential to a tool, and a missing grant
never falls back to the agent's broader access.

## A typical product integration

1. Create a **Webhooks** connection with **Stream answers** on. Keep its secret
   in a server-side gateway; your web and mobile clients talk only to that
   gateway.
2. Expose your API as a remote MCP server and connect it on the agent's
   **Tools** page. Mark read-only tools with `readOnlyHint` so Formation can
   classify them as queries.
3. If users must only see their own data, declare `conversation-v1` on those
   read-only tools and check your own grant on every call.
4. Optionally add short public activity labels to tools, so your app can show
   lines such as "Looking up devices" while the agent works. See
   [activity](https://docs.formation.texturehq.com/connectors/application-streaming.md#activity-and-explicit-follow-ups).

The [product guide](https://docs.formation.texturehq.com/connectors/your-application.md) walks through each step with
one worked example. Formation does not publish a client library for this
contract. It is signed HTTP requests and server-sent events, so any HTTP client
in your backend can implement it.

## Run on your own infrastructure

Each runtime dependency is a configurable provider or an open protocol:

| Dependency | Options | Guide |
| - | - | - |
| Model inference | OpenRouter, Ramp Router, OpenAI, Anthropic, Google, or any OpenAI-compatible server such as Ollama, vLLM or llama.cpp | [Model providers](https://docs.formation.texturehq.com/connectors/model.md), [OpenAI and self-hosted models](https://docs.formation.texturehq.com/operations/openai-and-local-models.md) |
| Model choice per turn | Automatic selection within a model family, including an open-weight family when the catalog reports open weights | [Automatic model selection](https://docs.formation.texturehq.com/runtime/adaptive-model-routing.md#configure-automatic-selection-for-an-agent) |
| Agent workspaces | Fly Sprites, Modal, or your own service implementing the execution broker protocol | [Sandboxed execution](https://docs.formation.texturehq.com/runtime/sandboxed-execution.md), [Execution broker protocol](https://docs.formation.texturehq.com/runtime/execution-broker-protocol.md) |
| Web search, reading and browsing | Cloudflare, Brave, Perplexity, Firecrawl, Browserbase, or your own web broker | [Web capabilities](https://docs.formation.texturehq.com/runtime/web-capabilities.md), [Web broker protocol](https://docs.formation.texturehq.com/runtime/web-broker-protocol.md) |
| Memory search | PostgreSQL, pgvector or Qdrant, with a configurable embedding provider | [Memory backends](https://docs.formation.texturehq.com/runtime/memory-backends.md) |
| Durable execution | Temporal Cloud or a self-hosted Temporal cluster | [Temporal](https://docs.formation.texturehq.com/runtime/temporal.md) |
| Operator sign-in | Local accounts, or your identity service through the launch-code protocol | [External authentication](https://docs.formation.texturehq.com/external-authentication.md) |

## Current limits

* MCP servers and REST APIs must be reachable at public HTTPS addresses.
  Private-network destinations, redirects and local stdio MCP servers are
  refused. See [MCP protocol limits](https://docs.formation.texturehq.com/runtime/remote-mcp.md#supported-protocol-and-resource-limits)
  and [REST request boundaries](https://docs.formation.texturehq.com/runtime/rest-api-connections.md#credential-and-request-boundaries).
* A REST API connection does not import OpenAPI schemas or discover endpoints.
  It supports header tokens; OAuth refresh, request signing and cookie
  authentication are not supported.
* Delegated queries apply only to read-only tools, in private conversations
  with one reader and a live run started by a single message. For linked
  messaging users, group, channel, scheduled and ambiguous contexts are refused.
* Account-subject evidence comes from Microsoft Teams only. The account-linking
  broker is configured through the operator API; the dashboard has no editor
  for it yet.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.