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

# Integrate an MCP host

> Register Praxa MCP contracts in an agent host while preserving wire names, annotations, JSON Schema, OAuth scopes, and runtime authority.

```mermaid theme={null}
sequenceDiagram
  participant Agent as Agent host
  participant Contracts as @praxa/mcp-contracts
  participant Gateway as Integration Gateway
  Agent->>Contracts: Load 12 tool definitions
  Contracts-->>Agent: Aura-compatible names, schemas, annotations, scopes
  Agent->>Agent: Adapt raw JSON Schema to host API
  Agent->>Gateway: Execute selected route with delegated OAuth token
  Gateway-->>Agent: Governed result or typed error
```

## Inspect the published contracts

```typescript theme={null}
import {
  MCP_PROTOCOL_VERSION,
  MCP_SERVER_NAME,
  MCP_SERVER_VERSION,
  PRAXA_MCP_TOOLS,
} from "@praxa/mcp-contracts";

console.log({
  protocol: MCP_PROTOCOL_VERSION,
  server: MCP_SERVER_NAME,
  serverVersion: MCP_SERVER_VERSION,
  tools: PRAXA_MCP_TOOLS.map((tool) => ({
    name: tool.name,
    scope: tool.requiredScope,
    annotations: tool.annotations,
  })),
});
```

## Register with your host

Host SDKs use different registration APIs and JSON Schema adapters. The
following is intentionally framework-neutral:

```typescript theme={null}
for (const tool of PRAXA_MCP_TOOLS) {
  host.register({
    name: tool.name,
    description: tool.description,
    inputSchema: adaptDraft202012SchemaForHost(tool.inputSchema),
    annotations: tool.annotations,
    execute: async (input) =>
      callGatewayRoute(tool.method, tool.path, input, delegatedToken),
  });
}
```

Do not rename the <code>aura\_\*</code> tool identifiers. They are stable wire
values even when the host displays Praxa branding.

## Preserve the executor boundary

The registration callback should be the only layer that translates an MCP
tool call into a Gateway request. It must:

1. validate the tool input against the published schema;
2. interpolate only the declared `pathArgument`;
3. remove the path field from the JSON body when the route expects it in the URL;
4. attach a short-lived delegated token with the exact `requiredScope`;
5. preserve one idempotency key for an exact mutation replay;
6. map bounded Gateway problems to `isError: true` tool results;
7. return a redacted structured result that the host can verify.

Never accept tenant, token, provider credential, or route override values from
model-generated input.

## Test the adapter itself

Use a fake executor to assert all 12 registrations, exact names, annotations,
schema identity, path interpolation, body projection, idempotency handling, and
error mapping. Then run one read-only authenticated canary against the intended
deployment. See [host-specific setup](/mcp/host-guides) and
[MCP troubleshooting](/mcp/troubleshooting).
