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

# connectors

> Connect an agent to external services (Google Docs, Slack, GitHub, Notion, …) the way Claude's connectors do: over MCP.

```ts theme={null}
const agent = createAgent({
  model: 'openrouter/openai/gpt-4o-mini',
  mcpServers: {
    slack: { url: 'https://mcp.slack.com/mcp', oauth: { redirectUri } },
  },
});
```

This example runs **fully offline** — `./mock-connectors-server.ts` is a real stdio MCP server (written with the SDK's own `serveMcp`) exposing fake `docs_*`/`slack_*` tools. The agent code is identical to what a real connector needs; only the `mcpServers` entry changes.

## Real connectors

| Service | `mcpServers` entry |
| - | - |
| Google Docs/Drive | `{ url: '<google docs MCP endpoint>', oauth: { redirectUri: '<your callback>' } }` |
| Slack | `{ url: 'https://mcp.slack.com/mcp', oauth: { redirectUri } }` |
| GitHub | `{ url: 'https://api.githubcopilot.com/mcp/', headers: { Authorization: 'Bearer <PAT>' } }` or the community stdio server via `command` |
| Notion | `{ url: 'https://mcp.notion.com/mcp', oauth: { redirectUri } }` |
| Any local connector | `{ command: 'npx', args: ['-y', '<their-mcp-server>'] }` |

OAuth is **app-owned**: one operator signs the agent in once per server via `agent.oauth.mcpSignInUrl('slack')`; every run then reuses the grant. See [docs/oauth.md](/oauth) and [docs/connectors.md](/connectors).

## Write safety

`slack_post_message` carries `destructiveHint`/`readOnlyHint` annotations, and the demo sets `approval: 'never'` only so it runs non-interactively. In production keep the default (`'annotations'`) or an `approval` predicate/permission rules so connector *writes* pause for human approval — see [docs/approvals.md](/approvals).

```bash theme={null}
npm run example:connectors            # offline, real MCP stdio round-trip
OPENROUTER_API_KEY=… npx tsx examples/connectors/index.ts
```


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