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

# Foundations

> AdCP integration foundations: choose between MCP and A2A protocols, set up authentication, manage context and sessions, and configure accounts and agents.

This section covers the foundational technical concepts for building any AdCP implementation - whether you're building a client, a server, or an orchestrator.

## Choose Your Protocol

<CardGroup cols={2}>
  <Card title="MCP Guide" icon="message-bot" href="/dist/docs/3.0.0-rc.2/building/integration/mcp-guide">
    For Claude, AI assistants, and MCP-compatible tools. Tool-based, request/response pattern.
  </Card>

  <Card title="A2A Guide" icon="robot" href="/dist/docs/3.0.0-rc.2/building/integration/a2a-guide">
    For Google AI agents and A2A workflows. Task-based, message/artifact pattern with SSE streaming.
  </Card>
</CardGroup>

Not sure which to choose? See [Protocol Comparison](/dist/docs/3.0.0-rc.2/building/understanding/protocol-comparison).

## Core Concepts

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/dist/docs/3.0.0-rc.2/building/integration/authentication">
    How to authenticate with AdCP agents. Bearer tokens, agents, and accounts.
  </Card>

  <Card title="Context & Sessions" icon="link" href="/dist/docs/3.0.0-rc.2/building/integration/context-sessions">
    Managing conversation state with context\_id vs task\_id. Extension fields and opaque context.
  </Card>

  <Card title="Schemas and SDKs" icon="code" href="/dist/docs/3.0.0-rc.2/building/schemas-and-sdks">
    Access schemas and official client libraries for JavaScript and Python.
  </Card>
</CardGroup>

## Getting Started

### 1. Choose a Protocol

* **MCP** for tool-based integrations (Claude, MCP-compatible systems)
* **A2A** for task-based integrations (Google AI, agent-to-agent workflows)

### 2. Understand Authentication

* How agents and accounts are identified
* Bearer token patterns
* See [Authentication](/dist/docs/3.0.0-rc.2/building/integration/authentication)

### 3. Handle Context

* `context_id` for conversation continuity
* `task_id` for tracking async operations
* See [Context & Sessions](/dist/docs/3.0.0-rc.2/building/integration/context-sessions)

## What Both Protocols Provide

Regardless of protocol choice, you get:

| Feature               | Support                                                  |
| --------------------- | -------------------------------------------------------- |
| All AdCP tasks        | Same tasks, same capabilities                            |
| Unified status system | `completed`, `working`, `input-required`, `failed`, etc. |
| Context management    | Session continuity across requests                       |
| Async operations      | Long-running tasks with webhooks or polling              |
| Human-in-the-loop     | Approval workflows for sensitive operations              |
| Error handling        | Consistent error codes and recovery patterns             |

## Next Steps

* **Ready to connect?** Start with [MCP Guide](/dist/docs/3.0.0-rc.2/building/integration/mcp-guide) or [A2A Guide](/dist/docs/3.0.0-rc.2/building/integration/a2a-guide)
* **Need to authenticate?** See [Authentication](/dist/docs/3.0.0-rc.2/building/integration/authentication)
* **Building production systems?** Continue to [Implementation Patterns](/dist/docs/3.0.0-rc.2/building/implementation)
