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

# A2A servers

> Public a2a servers signatures and configuration in @agentium/transport 4.0.0.

Import these **9 exports** from `@agentium/transport`. Read the [a2a servers guide](/a2a/v1) for setup and behavior, or return to the [package reference](/api-reference/transport).

A `?` marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.

## A2AServerOptions

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/types.ts)

```typescript theme={null}
export interface A2AServerOptions {
    agents: Record<string, Agent>;
    basePath?: string;
    provider?: {
        organization: string;
        url?: string;
    };
    version?: string;
    /** Maximum process-local tasks, including active work. Default 10000. */
    maxTasks?: number;
}
```

Related: [`Agent`](/api-reference/core/agent#agent).

## A2AV1Identity

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/v1-server.ts)

```typescript theme={null}
export interface A2AV1Identity {
    tenantId: string;
    userId: string;
}
```

## A2AV1ServerOptions

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/v1-server.ts)

```typescript theme={null}
export interface A2AV1ServerOptions {
    agents: Record<string, Pick<Agent, "name" | "run">>;
    /** Absolute URL of this JSON-RPC endpoint. */
    url: string;
    basePath?: string;
    cardPath?: string;
    /** Passed to the host verifier; the verifier must validate token audience. */
    audience: string;
    authenticate: (request: Request, audience: string) => Promise<A2AV1Identity | null>;
    maxTasks?: number;
    /** Local history retention and follow-up admission bound; default 128. */
    maxHistoryMessages?: number;
    /** Domain-specific interrupted results remain distinguishable from success. */
    completionState?: (output: RunOutput) => "TASK_STATE_COMPLETED" | "TASK_STATE_INPUT_REQUIRED" | "TASK_STATE_AUTH_REQUIRED" | "TASK_STATE_FAILED";
}
```

Related: [`A2AV1Identity`](/api-reference/transport/a2a#a2av1identity), [`Agent`](/api-reference/core/agent#agent), [`RunOutput`](/api-reference/core/agent#runoutput).

## createA2AServer

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/a2a-server.ts)

```typescript theme={null}
/**
 * Mount an A2A-compliant server on an Express app.
 *
 * - Serves `/.well-known/agent.json` with the Agent Card
 * - Handles JSON-RPC 2.0 requests at the basePath for message/send, message/stream, tasks/get, tasks/cancel
 */
export declare function createA2AServer(app: any, opts: A2AServerOptions): void;
```

Related: [`A2AServerOptions`](/api-reference/transport/a2a#a2aserveroptions).

## createA2AV1Server

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/v1-server.ts)

```typescript theme={null}
/** A2A 1.0 JSON-RPC using the optional official SDK. Local task state is
 * process-local and ownership-scoped; this adapter does not promise recovery. */
export declare function createA2AV1Server(app: Express, options: A2AV1ServerOptions): Promise<{
    card: A2AV1Card;
}>;
```

Related: [`A2AV1Card`](/api-reference/core/a2a#a2av1card), [`A2AV1ServerOptions`](/api-reference/transport/a2a#a2av1serveroptions).

## createDurableA2AV1Server

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/durable-v1-server.ts)

```typescript theme={null}
/** Optional A2A 1.0 JSON-RPC bridge. Polling only; all state remains in the durable store. */
export declare function createDurableA2AV1Server(options: DurableA2AV1ServerOptions): Promise<Router>;
```

Related: [`DurableA2AV1ServerOptions`](/api-reference/transport/a2a#durablea2av1serveroptions).

## DurableA2AV1ServerOptions

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/durable-v1-server.ts)

```typescript theme={null}
export interface DurableA2AV1ServerOptions extends DurableProtocolHost {
    name: string;
    /** Absolute public JSON-RPC URL; mount the returned router at its origin. */
    url: string;
    audience: string;
    authenticate(request: Request, audience: string): Promise<DurableReader | null>;
    cardPath?: string;
    /** Blocking SendMessage waits only this long; timeout does not cancel admitted work. */
    waitTimeoutMs?: number;
    pollIntervalMs?: number;
}
```

Related: [`DurableProtocolHost`](/api-reference/transport/durable#durableprotocolhost), [`DurableReader`](/api-reference/core/durable#durablereader).

## generateAgentCard

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/agent-card.ts)

```typescript theme={null}
/**
 * Generate an A2A Agent Card from a Agentium Agent.
 * The card is served at /.well-known/agent.json per the A2A spec.
 */
export declare function generateAgentCard(agent: Agent, serverUrl: string, provider?: {
    organization: string;
    url?: string;
}, version?: string): A2AAgentCard;
```

Related: [`A2AAgentCard`](/api-reference/core/a2a#a2aagentcard), [`Agent`](/api-reference/core/agent#agent).

## generateMultiAgentCard

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/transport/src/a2a/agent-card.ts)

```typescript theme={null}
/**
 * Generate a combined Agent Card that lists multiple agents as skills.
 */
export declare function generateMultiAgentCard(agents: Record<string, Agent>, serverUrl: string, provider?: {
    organization: string;
    url?: string;
}, version?: string): A2AAgentCard;
```

Related: [`A2AAgentCard`](/api-reference/core/a2a#a2aagentcard), [`Agent`](/api-reference/core/agent#agent).


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