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

> ## Agent Instructions
> Tribridge is a crypto payment gateway for Solana and Sui (TON is coming soon). API base URL is https://api.tribridge.xyz. The API Reference documents ONLY the public endpoint surface: checkout sessions (create/get/generate-wallet/customer/simulate/verify/cancel), the two public payment-link endpoints, health probes, and the changelog. Server-side calls that create payments authenticate with the x-api-key header using a tri_test_... key (fully simulated test mode, no real funds) or tri_live_... key (real mainnet payments) - never expose keys client-side; all other documented endpoints are public with no auth. API keys are scoped and capped: payments:create, payments:read, payment_links:create, payment_links:read, webhooks:read, webhooks:write, webhooks:replay. The Tribridge MCP is available at https://mcp.tribridge.xyz/mcp; MCP access is opt-in per key and the MCP exposes no refunds, payouts or sweeps. Dashboard, admin, OTP/auth, payouts, wallets, and webhook-management endpoints are intentionally NOT part of the public docs - they are dashboard-only and must not be presented as public API. Merchant test mode is simulated, not testnet. Refunds are automatic only (underpaid/overpaid), there is no manual refund endpoint. Always verify webhook HMAC-SHA256 signatures from the X-Tribridge-Signature header before trusting payloads, and deduplicate on event_id because events may be retried or replayed. Replays reuse the original event_id and set replay: true plus X-Tribridge-Replay: true. If you are an AI agent: fetch https://docs.tribridge.xyz/llms-full.txt for all documentation in one file, https://docs.tribridge.xyz/openapi/openapi.json for the machine-readable OpenAPI spec, or connect to the read-only MCP server at https://docs.tribridge.xyz/mcp. Any page is available as Markdown by appending .md to its URL. Use only the documented endpoints and fields; do not invent SDK packages or endpoints.

# Tribridge MCP (remote)

> Connect Claude, ChatGPT or any MCP-capable agent to Tribridge over a public HTTPS endpoint with OAuth 2.1 or an API key.

The Tribridge MCP is available as a **remote MCP server**, so cloud assistants can use it
without installing anything locally.

```
https://mcp.tribridge.xyz/mcp
```

It exposes the same scoped tools as the local server: create and read payments, create payment
links, read webhooks, and replay deliveries. It **cannot** refund, pay out, sweep wallets or change
account settings. See [Using Tribridge with AI agents](https://docs.tribridge.xyz/ai-agents.md) for the full tool list.

## Authentication

The MCP verifies **you** (the caller) on every request; the MCP protocol itself has no identity.
There are two supported methods.

### 1. Tribridge API key

Send a scoped key as a bearer token or an `x-api-key` header:

```
Authorization: Bearer tri_test_...
```

This is the simplest option for Claude Code, the OpenAI Responses API, and agent platforms that
support remote MCP servers with custom headers.

### 2. Sign in with Tribridge (OAuth 2.1)

claude.ai custom connectors and ChatGPT use OAuth. The MCP redirects you to Tribridge, where you
sign in with your normal account (email + code) and approve the connection. Tribridge creates a
scoped **Agent (safe)** key for that assistant automatically.

## Connect Claude

**Claude Code:**

```bash theme={null}
claude mcp add --transport http tribridge https://mcp.tribridge.xyz/mcp \
  --header "Authorization: Bearer tri_test_..."
```

**claude.ai custom connector:**

1. Customize → Connectors → Add custom connector.
2. URL: `https://mcp.tribridge.xyz/mcp`.
3. Choose **Sign in** to complete the Tribridge consent page.
4. If your organization has the beta **Request headers** option, you can instead choose
   **No sign-in** and add `Authorization: Bearer tri_test_...`.

## Connect ChatGPT

1. Open [Plugins](https://chatgpt.com/plugins) in ChatGPT on the web.
2. Select **Add custom MCP server**.
3. URL: `https://mcp.tribridge.xyz/mcp`.
4. Authentication: **OAuth**.
5. Create the plugin, install it, start a conversation, type `@`, and choose Tribridge.

ChatGPT registers itself automatically (Dynamic Client Registration) and uses PKCE S256. ChatGPT
does not support static API-key headers for custom connectors.

## Connect any other agent platform

If the platform supports **remote MCP with headers**, use the URL plus:

```json theme={null}
{
  "mcpServers": {
    "tribridge": {
      "url": "https://mcp.tribridge.xyz/mcp",
      "headers": {
        "Authorization": "Bearer tri_test_..."
      }
    }
  }
}
```

If it only supports **stdio**, run the MCP locally:

```bash theme={null}
git clone https://github.com/code-ninjax/tribridge.git
cd tribridge/tribridge-mcp
npm install --legacy-peer-deps

TRIBRIDGE_API_KEY=tri_test_... node dist/index.js
```

Or build it first with `npm run build`. Full local setup is in the
[AI agent guide](https://docs.tribridge.xyz/ai-agents.md#install-and-connect).

## Recommended key

Create a key in Dashboard → API keys → **Create key** → preset **Agent (safe)**:

* `payments:create`, `payments:read`, `webhooks:read`
* **Allow MCP access** enabled
* $100 per-payment cap, $500 daily cap
* Optional expiry

Use a separate key per assistant. Add `webhooks:write` or `webhooks:replay` only if the task needs
them.

## Test vs live

The key prefix decides the mode:

* `tri_test_...` — simulated payments, no real funds.
* `tri_live_...` — real mainnet payments.

Every authenticated tool result includes `mode`, and live-mode results carry a warning. Confirm the
amount and mode with the user before a live payment.

## Troubleshooting

| Symptom | Cause | Fix |
| - | - | - |
| `401 Unauthorized` / `invalid_api_key` | Key missing, revoked or mistyped | Create a new key and reconnect |
| `api_key_expired` | Key passed its expiry | Create or rotate the key |
| `mcp_not_allowed` | **Allow MCP access** is off | Enable it on the key |
| `insufficient_scope` | Key lacks the tool's permission | Add the named scope or use a wider key |
| `payment_cap_exceeded` / `daily_cap_exceeded` | Key caps reached | Lower the amount or raise the cap |
| `rate_limited` | Too many requests | Respect `Retry-After` and slow down |
| OAuth sign-in fails | Tribridge session missing or onboarding/wallet gate | Sign in at tribridge.xyz, complete onboarding, link a payout wallet, retry |
| No tools after connecting | URL missing `/mcp` or auth failed | Recheck the URL and authentication |

## Public discovery endpoints

These are standard OAuth/MCP discovery documents and contain no merchant data:

* `https://mcp.tribridge.xyz/.well-known/oauth-protected-resource`
* `https://mcp.tribridge.xyz/.well-known/oauth-authorization-server`
* `https://mcp.tribridge.xyz/healthz`

Do not share API keys in prompts, screenshots or support tickets.


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