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

# MCP

> Hosted Brickken MCP server for API-key and x402 workflows in MCP-compatible AI agents.

## Overview

The Brickken MCP server exposes the Brickken Dapp API and Agentic API as 63 tools for MCP-compatible AI agents.

It is **the client to reach for when an AI agent should drive the full Dapp API with nothing but an API key**, including KYC link creation. If your own code is driving rather than an agent, use the [SDK](https://docs.brickken.com/sdk/introduction.md). See [Choose your surface](https://docs.brickken.com/get-started/choose-your-surface.md).

> [card] [MCP server page](https://mcp.brickken.com/)
>
> Open the official Brickken MCP page.

> [card] [Health check](https://mcp.brickken.com/health)
>
> Check hosted server availability.

## Connect

Use the hosted endpoint in Claude Code, Codex, or any MCP-compatible client. Note the `/mcp` path — the bare host serves an HTML landing page, not the MCP endpoint:

```json theme={null}
{
  "mcpServers": {
    "brickken": {
      "url": "https://mcp.brickken.com/mcp"
    }
  }
}
```

## Session Configuration

Every MCP session is isolated. Configure credentials at runtime with the `configure` tool, then use `get_config` to verify the active environment without exposing secrets.

> [!NOTE]
>
> A session is **either API-key mode or x402 mode, never both.** When an API key is configured the server attaches `x-api-key` to every outbound request and never falls back to the payment handshake. Set `"apiKey": ""` to force x402.

### API-key mode

Use this mode for the [Dapp API](https://docs.brickken.com/api-reference/introduction.md). An API key alone unlocks every Dapp tool listed below — KYC, tokenization, STOs, security-token operations, and all reads.

```json theme={null}
{
  "env": "production",
  "apiKey": "YOUR_BRICKKEN_API_KEY"
}
```

### x402 private-key mode

Use this mode for the [Agentic API](https://docs.brickken.com/api-reference/endpoint/agentic-methods-x402.md). The private key is used by the MCP server session to sign x402 payments and to sign the prepared blockchain transaction.

```json theme={null}
{
  "env": "production",
  "privateKey": "0xYOUR_PRIVATE_KEY",
  "apiKey": ""
}
```

For sandbox:

```json theme={null}
{
  "env": "sandbox",
  "privateKey": "0xYOUR_PRIVATE_KEY",
  "apiKey": ""
}
```

A custom `baseUrl` overrides the selected environment when needed. An internal `forge` environment exists for Brickken pre-release QA — contact `tech@brickken.com` for its base URL.

> [!WARNING]
>
> Only configure a private key in MCP clients and environments you trust. `get_config` returns booleans such as `hasApiKey` and `hasPrivateKey`, never the secret values.
>
> The hosted `/mcp` endpoint has no inbound authentication — anyone can connect, and every credential is supplied by the client per session. Nothing you configure is persisted server-side beyond the life of your session.

## Configuration Tools

| Tool | Purpose |
| - | - |
| `configure` | Set `env`, `baseUrl`, `apiKey`, or `privateKey` for the current session. |
| `get_config` | Inspect `env`, `baseUrl`, `hasApiKey`, and `hasPrivateKey`. |

## BKN Faucet Tool

`request_bkn_faucet` requests 100 BKN on Ethereum Sepolia in Sandbox or Forge. Pass `recipientAddress` and optionally `idempotencyKey` as UUID v4. The tool generates and returns a UUID when omitted; use a new UUID for a new claim and the same UUID for a retry of that claim.

Configure exactly one credential. An API key has 10 dedicated lifetime faucet claims, separate from `mintToken`; private-key mode pays 0.01 USDC through x402. Recipients have a 24-hour cooldown. The public bearer/reCAPTCHA flow is not exposed.

## Transaction Tools

| Tool | Purpose |
| - | - |
| `prepare_transactions` | Prepare unsigned transactions for a backend `method`. |
| `send_transactions` | Submit signed transactions to Brickken. |
| `get_transaction_status` | Poll a transaction hash. |

## Dapp API Tools

These tools map to API-key authenticated dapp flows and are **the legacy Dapp API, reachable from an AI agent with nothing but an API key**. If a private key is also configured, write tools can prepare, sign, and send automatically; otherwise they return prepared transactions for external signing.

The signer wallet must be whitelisted by Brickken before a write is accepted, and your key can only act on token symbols it tokenized. See [Authentication](https://docs.brickken.com/get-started/authentication).

| Area | Tools |
| - | - |
| KYC | `create_kyc_link` |
| BKN faucet | `request_bkn_faucet` |
| Tokenization | `create_tokenization` |
| STOs | `create_sto`, `invest_in_sto`, `claim_sto`, `close_sto` |
| Security-token operations | `mint_tokens`, `whitelist_investor`, `burn_tokens`, `transfer_tokens`, `approve_tokens`, `distribute_dividend` |
| Reads | `get_network_info`, `get_token_info`, `get_tokenizer_info`, `get_stos`, `get_sto_by_id`, `get_investments_by_sto_id`, `get_investor_info`, `get_allowance`, `get_whitelist_status`, `get_balance_whitelist`, `get_sto_balance`, `get_dividend_info` |

> [!WARNING]
>
> `create_kyc_link` can create an investor account and send an invitation email. Treat its returned Sumsub URL as sensitive.

## x402 Agent Tools

These tools map to ERC-8004 and agent-token methods on Base. Relayed preparation is free; client-controlled modes split the x402 USDC payment between prepare and send.

| Area | Tools |
| - | - |
| Agent reads | `get_agents`, `get_agent_info`, `get_agent_transactions` |
| Agent identity | `agent_register`, `agent_set_uri`, `agent_set_metadata`, `agent_set_wallet`, `agent_transfer_ownership` |
| Reputation | `agent_give_feedback`, `agent_revoke_feedback`, `agent_append_feedback_response` |
| Agent-owned tokens | `agent_create_token`, `agent_mint_token`, `agent_burn_token`, `agent_transfer_token`, `agent_transfer_from_token`, `agent_approve_token` |
| RAMS mandates (ERC-8226) | `rams_grant_mandate`, `rams_revoke_mandate`, `rams_extend_mandate`, `rams_set_operator`, `rams_execute`, `rams_set_executor_action`, `rams_freeze_agent`, `rams_unfreeze_agent`, `rams_grant_principal`, `rams_revoke_principal`, `rams_get_mandate`, `rams_can_execute`, `rams_get_status`, `rams_check_compliance`, `rams_get_executor_action`, `rams_get_typed_data` |

RAMS reads and typed-data fetches use the session's API key when one is set, and fall back to x402 when it is not. `rams_get_typed_data` auto-signs when the session has a private key matching the principal; otherwise it returns the envelope with a warning for external signing. Pass the result's signature and deadline to the matching lifecycle tool.

The three agent getters follow the same API-key-or-x402 rule and cost `0.000001 USDC` per x402 call. In x402 mode, `get_agents` requires `chainId` and `ownerWalletAddress`, and the payment signer must match that owner. Detail and transaction reads accept `agentUuid`, or `agentId` together with `chainId`; x402 payment is checked against the stored owner wallet.

## Networks

Use `chainId: "8453"` for Base mainnet and `chainId: "84532"` for Base Sepolia tests (decimal or hex accepted). On Base Sepolia the x402 asset is Circle USDC `0x036CbD53842c5426634e7929541eC2318f3dCF7e` (EIP-3009, 6 decimals). Always fund the payer with the exact asset quoted in `x402Requirements`.

## Execution modes

Agentic tools support both client-controlled modes:

* **`client-signed` (default).** Provide `signerAddress`; the session signs the prepared transaction locally, and Brickken broadcasts it.
* **`client-broadcast`.** The session signs and broadcasts the transaction itself, then confirms it with `txHash`.

Either way the operation price is split evenly between prepare and send. See [Pricing](https://docs.brickken.com/api-reference/endpoint/agentic-pricing.md).

> [!NOTE]
>
> If you would rather not hold an EOA or native gas at all, see [Base MCP](https://docs.brickken.com/mcp/base-mcp.md), where the
> wallet only authorizes the payment and Brickken carries the signing and the gas.

## Example

Configure x402 mode, then register an agent on Base Sepolia:

```json theme={null}
{
  "env": "sandbox",
  "privateKey": "0xYOUR_PRIVATE_KEY",
  "apiKey": ""
}
```

```json theme={null}
{
  "chainId": "84532",
  "signerAddress": "0x1111111111111111111111111111111111111111",
  "name": "Research Agent",
  "description": "On-chain AI research agent",
  "image": "https://example.com/agent.png",
  "serviceName": "A2A",
  "serviceEndpoint": "https://agent.example/.well-known/agent-card.json",
  "aiModelProvider": "OpenAI",
  "aiModelName": "Research Model",
  "x402Support": true,
  "active": true
}
```

The `agent_register` result includes prepared transaction data and, when executed, the send result. Save `prepared.info.agentUuid` for later agent updates, including `agent_transfer_ownership`.


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