> For the complete documentation index, see [llms.txt](https://gotts.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gotts.gitbook.io/docs/gotts-safe-mcp-server/mcp-server/13-distribution.md).

# Distribution and Synergies

> **Package**: `packages/safe/` (`@gotts.ai/safe`) | **Prerequisites**: [01-overview.md](/docs/gotts-safe-mcp-server/mcp-server/01-overview.md)
>
> For supported chains reference, see [shared/chains.md](/docs/prd-shared/chains.md). For glossary, see [shared/glossary.md](/docs/prd-shared/glossary.md).

***

## Synergies

### Companion Gotts Skills (Separate PRDs)

Gotts Safe is the execution layer. Gotts Skills provide workflow guidance and best practices. These are authored as separate PRDs (see [Gotts Skills PRD](/docs/skills/skills.md)) and live in `packages/safe/skills/` (or `packages/vault/skills/` for vault skills).

| Skill                | Plugin                  | Status | Relationship to Gotts Safe                                                                                  |
| -------------------- | ----------------------- | ------ | ----------------------------------------------------------------------------------------------------------- |
| `manage-liquidity`   | `packages/safe/skills/` | Spec   | LP guidance and execution skill. Agents use Gotts Safe LP tools for execution.                              |
| `setup-agent-wallet` | `packages/safe/skills/` | Spec   | Wallet setup guidance for agents. Covers all 7 wallet types Gotts Safe supports.                            |
| `build-hook`         | `packages/safe/skills/` | Spec   | V4 hook development guidance. Separate from Gotts Safe (hooks are smart contracts, not runtime operations). |
| `manage-treasury`    | `packages/safe/skills/` | Spec   | Agent treasury management. Uses Gotts Safe swap and LP tools for fee conversion and yield.                  |
| `deploy-agent-token` | `packages/safe/skills/` | Spec   | Agent token deployment. Uses Gotts Safe pool creation and LP tools.                                         |
| `agent-market-maker` | `packages/safe/skills/` | Spec   | Agent market making on own token pairs. Uses Gotts Safe LP tools.                                           |

### Companion Gotts Agents (Separate PRDs)

| Agent                  | Purpose                                                   | Status | Gotts Safe Usage                                                                                                                          |
| ---------------------- | --------------------------------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `lp-strategist`        | Recommends LP ranges and strategies                       | Spec   | Calls `get_pool_info`, `get_tick_data` for analysis                                                                                       |
| `portfolio-analyst`    | Watches positions, alerts when out of range               | Spec   | Calls `get_position`, `get_positions_by_owner`                                                                                            |
| `treasury-manager`     | Autonomous treasury management for self-funding agents    | Spec   | Calls `execute_swap`, `add_liquidity`, `collect_fees` for fee conversion and yield                                                        |
| `token-deployer`       | Automated token pool creation and liquidity bootstrapping | Spec   | Calls `add_liquidity`, `get_pool_info` for V4 pool creation                                                                               |
| `identity-verifier`    | ERC-8004 agent identity verification                      | Spec   | On-chain reads to ERC-8004 registries                                                                                                     |
| `agent-service-broker` | Agent-to-agent service matching and settlement            | Spec   | Calls `execute_swap` for payment settlement                                                                                               |
| `protocol-fee-seeker`  | Autonomous TokenJar monitor and burn executor             | Spec   | Calls `get_tokenjar_balances`, `get_firepit_state`, `execute_burn`, `subscribe_tokenjar`, `get_burn_history`, `get_fee_accumulation_rate` |
| `trade-executor`       | Handles full swap lifecycle with retries                  | Spec   | Calls `get_quote`, `execute_swap`, `check_safety_status`                                                                                  |

### Related Products (Separate PRDs)

| Product                        | Relationship                                                                                                                                           |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Agent Safety Toolkit (library) | Extracted from MCP server's safety middleware as a standalone npm package. Other agent builders can use safety primitives without the full MCP server. |
| Intent-Based Agent Trading SDK | High-level SDK that wraps Gotts Safe's tools into a TypeScript API (`agent.swap()`, `agent.addLiquidity()`).                                           |
| Autonomous LP Manager          | Background service that uses Gotts Safe's LP tools to manage positions autonomously.                                                                   |

### Vault Integration (Unified via Profiles)

The Gotts Vaults (`packages/vault/`) is the primary value-multiplier for Gotts Safe. With the **profile system**, vault tools register directly into the core server when `TOOL_PROFILE` includes `vault` -- no separate server process needed. See [vault synergies](/docs/gotts-vaults/vault/16-synergies.md) for the full analysis.

| Integration                  | How It Works                                                                                             |
| ---------------------------- | -------------------------------------------------------------------------------------------------------- |
| **Profile-based activation** | `TOOL_PROFILE=vault` registers all vault tools inside the core server. One deployment, one health check. |
| **Shared safety pipeline**   | Vault tools use the core server's full 15-layer safety pipeline directly (no optional import needed)     |
| **Pool data delegation**     | `vault-strategist` agent delegates to `pool-researcher` and `risk-assessor` via core MCP tools           |
| **LP composition**           | Vault rebalancing uses `add_liquidity`, `remove_liquidity`, `rebalance_position` from core tools         |
| **Share pool trading**       | Vault share tokens trade on V4 pools via `execute_swap`                                                  |
| **Volume flywheel**          | Vault creation auto-deploys V4 pool -> active management -> LP volume -> share trading -> more volume    |

The standalone vault server (`packages/vault/src/server.ts`) remains available as a fallback for teams requiring complete isolation, but the recommended deployment is the unified server with the `vault` profile.

### Agent Capital Markets Integrations

Gotts Safe should integrate with the emerging Agent Capital Markets stack:

| Integration                      | Purpose                                                                                                                                                                                                 | Priority   |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------- |
| **x402 payment layer**           | Agents pay per MCP request in USDC (\~$0.001-0.01 per call). Eliminates API key onboarding. Revenue from every agent interaction.                                                                       | High (G11) |
| **ERC-8004 identity**            | Verified agents get lower fees, priority execution, access to premium pools. Agent swap history feeds into reputation scores.                                                                           | High (G12) |
| **Agent registry listing**       | Register Gotts Safe as a discoverable service on agent registries. Agent discovery without manual configuration.                                                                                        | Medium     |
| **Clanker/BankrBot integration** | Automated pool creation when agent tokens are deployed. 585K+ tokens deployed through Clanker, all routing through Uniswap V4.                                                                          | Medium     |
| **Agent treasury tools**         | Tools for self-funding agents to auto-convert fees, DCA, and manage operating capital (G13). Serves BankrBot's 220K+ active wallets.                                                                    | Medium     |
| **Vault protocol**               | ERC-4626 agent-gated vaults for collective LP management, am-AMM bidding, and CCA participation. See [Vault PRDs](https://github.com/wpank/gotts.ai-monorepo/blob/main/prd/mcp-server/vault/README.md). | High (G20) |
| **AP2 protocol**                 | Google's Agent Payment Protocol for payment authorization. 60+ partners including Visa, Mastercard. Future consideration.                                                                               | Low        |

### x402 Pricing Model

Tiered pricing for MCP tool access via x402 micropayments (USDC on Base, \~200ms settlement):

| Tier             | Price          | Tools                                                                          |
| ---------------- | -------------- | ------------------------------------------------------------------------------ |
| **Free**         | $0             | All read-only tools: `get_pool_info`, `get_token_price`, `search_tokens`, etc. |
| **Micropayment** | $0.001 - $0.01 | Execution tools: `execute_swap`, `add_liquidity`, `submit_cca_bid`, etc.       |
| **Premium**      | $0.01 - $0.10  | Strategy recommendations, historical analytics, am-AMM bid optimization        |
| **Subscription** | $10 - $100/mo  | Streaming access, priority execution, vault strategy API                       |

Reference implementation: Civic's `@civic/x402-mcp` pattern for Streamable HTTP + per-tool pricing maps via `createPaidMcpHandler()`.

### x402 Outbound Client Infrastructure

Gotts Safe has x402 **inbound** infrastructure (accepting payments from other agents) and x402 **outbound** infrastructure (making payments to external x402-enabled APIs). The outbound client supports multiple providers (CoinGecko, Elsa) through a generic client pattern, enabling agents to acquire external data by paying per-request in USDC on Base.

**Architecture:**

```
MCP Tool (e.g., get_onchain_token_data, get_wallet_portfolio)
    │
    ▼
x402 Outbound Client (src/x402/client.ts)
    │  - Wraps @x402/fetch for automatic 402 payment flow
    │  - Spending tracker enforces hourly/daily limits (shared across providers)
    │  - Response caching prevents duplicate payments
    │
    ├───────────────────────────────┐
    │                               │
    ▼                               ▼
CoinGecko x402 API              Elsa x402 API
(src/providers/coingecko.ts)    (src/providers/elsa.ts)
    │  Token data, trending,        │  Portfolio, wallet analytics,
    │  pool search                  │  yield, P&L, swap quotes
    │  $0.01/req                    │  $0.001-$0.02/req
    │                               │  Supports USDC or ELSA token
    ▼                               ▼
Tool returns enriched data to agent
```

**Components:**

| File                           | Purpose                                                                |
| ------------------------------ | ---------------------------------------------------------------------- |
| `src/x402/client.ts`           | Generic x402 client wrapping `@x402/fetch` for any x402 API            |
| `src/x402/types.ts`            | TypeScript types for x402 configuration, spending, and providers       |
| `src/x402/spending-tracker.ts` | Rolling-window spending tracker with hourly and daily limits           |
| `src/providers/coingecko.ts`   | CoinGecko x402 provider -- token data, trending pools, pool search     |
| `src/providers/elsa.ts`        | Elsa x402 provider -- portfolio, wallet analytics, yield, P\&L, quotes |

**Spending Limits:**

| Limit               | Default | Config Key                      |
| ------------------- | ------- | ------------------------------- |
| Per-hour maximum    | $1.00   | `X402_OUTBOUND_MAX_PER_HOUR`    |
| Per-day maximum     | $10.00  | `X402_OUTBOUND_MAX_PER_DAY`     |
| Per-request maximum | $0.10   | `X402_OUTBOUND_MAX_PER_REQUEST` |

**Configuration:**

```bash
# Enable x402 outbound payments
X402_OUTBOUND_ENABLED=true
X402_OUTBOUND_PRIVATE_KEY=0x...  # Wallet for USDC payments on Base

# Spending limits (optional, defaults shown)
X402_OUTBOUND_MAX_PER_HOUR=1.00
X402_OUTBOUND_MAX_PER_DAY=10.00
X402_OUTBOUND_MAX_PER_REQUEST=0.10
```

Config file schema (add to `x402` section):

```json
{
  "x402": {
    "inbound": { "...existing inbound config..." },
    "outbound": {
      "enabled": true,
      "privateKey": "${X402_OUTBOUND_PRIVATE_KEY}",
      "maxSpendPerHour": 1.00,
      "maxSpendPerDay": 10.00,
      "maxSpendPerRequest": 0.10,
      "providers": {
        "coingecko": {
          "baseUrl": "https://api.coingecko.com",
          "enabled": true
        },
        "elsa": {
          "baseUrl": "https://x402-api.heyelsa.ai",
          "enabled": true,
          "paymentToken": "usdc"
        }
      }
    }
  }
}
```

**Dynamic Import:** The `@x402/fetch` and `@x402/evm` SDKs are imported dynamically so Gotts Safe starts without them when x402 outbound is disabled. When disabled, tools that depend on x402 (e.g., `get_onchain_token_data`, `get_wallet_portfolio`) return a clear `X402_DISABLED` error with instructions to enable. Each provider is independently toggleable via the `providers` config.

**Graceful Degradation:** If x402 payment fails (insufficient USDC, network issue, spending limit hit), tools fall back to existing on-chain data sources where possible. The response includes a `degraded: true` flag and `fallbackReason` field. CoinGecko tools fall back to on-chain RPC reads. Elsa tools fall back to Uniswap-only data (e.g., `get_yield_opportunities` falls back to Uniswap pool APY data; `get_wallet_portfolio` falls back to multi-chain balance reads). Wallet analysis and P\&L have no on-chain fallback and return a clear error.

**Payment Token Note:** Elsa supports payment in USDC (default, via `/api/` path) or ELSA token (via `/api/elsa/` path). Both paths return identical data. Configure via `paymentToken` in the Elsa provider config. CoinGecko only supports USDC.

### Integration with Existing Toolkit Plugins

Gotts Safe will be registered in the toolkit's plugin system:

* **Plugin**: A new plugin (e.g., `uniswap-onchain`) or integration into the existing `uniswap-integrations` plugin
* **MCP config**: Added to the plugin's `.mcp.json` for auto-discovery by Claude Code
* **Skills that invoke the server**: Companion skills use the MCP tools via `allowed-tools` in their frontmatter

### MCP Config Integration

The server can be invoked two ways in `.mcp.json`. The **direct** approach (`@gotts.ai/safe`) is recommended for MCP client configs because it has faster cold-start (single package, no Commander routing overhead). The **unified CLI** approach (`@gotts.ai`) provides subcommand access to all Gotts tools (setup, safe, devenv, portal, etc.) through a single package.

```json
{
  "mcpServers": {
    "uniswap": {
      "type": "stdio",
      // Direct (recommended for MCP configs — faster cold-start):
      "command": "npx",
      "args": ["-y", "@gotts.ai/safe@latest"],
      // Via unified CLI (same server, slightly slower startup):
      // "args": ["-y", "@gotts.ai@latest", "safe"],
      "env": {
        "WALLET_TYPE": "local",
        "PRIVATE_KEY": "${UNISWAP_AGENT_PRIVATE_KEY}",
        "TOKEN_ALLOWLIST_MODE": "strict",
        "SPENDING_LIMIT_PER_TX_USD": "10000",
        "SPENDING_LIMIT_DAILY_USD": "100000"
      }
    }
  }
}
```

> **Note**: JSON does not support comments. The `//` lines above are for illustration only — use one `args` array or the other in actual configs.

After global install (`pnpm add -g @gotts.ai`), the unified CLI is available as `gotts`:

```bash
gotts safe          # Start MCP server (stdio)
gotts safe --http   # Start MCP server (HTTP)
gotts setup         # Interactive install wizard (replaces npx @gotts.ai/create)
gotts portal        # Agent management dashboard (replaces npx @gotts.ai/portal)
gotts devenv        # Start local Uniswap testnet
gotts doctor        # Diagnose configuration issues
```

***

## Competitive Comparison

| Feature                     | This Server | uniswap-trader-mcp | uniswap-poolspy-mcp | uniswap-price-mcp | uniswap-pools-mcp | GOAT Uniswap Plugin |
| --------------------------- | ----------- | ------------------ | ------------------- | ----------------- | ----------------- | ------------------- |
| **Tools**                   | 84 (target) | 2                  | 1                   | 2                 | 2                 | \~3                 |
| **Chains**                  | 11          | 8                  | 9                   | 4                 | Multiple          | EVM                 |
| **Protocol versions**       | V2, V3, V4  | V3 only            | V2, V3              | V3 only           | V2, V3, V4        | V3                  |
| **LP management**           | Full        | No                 | No                  | No                | No                | No                  |
| **UniswapX**                | Yes         | No                 | No                  | No                | No                | No                  |
| **ERC-7683 cross-chain**    | Yes         | No                 | No                  | No                | No                | No                  |
| **Permit2**                 | Yes         | No                 | No                  | No                | No                | No                  |
| **Pre-flight simulation**   | Yes         | No                 | No                  | N/A               | N/A               | No                  |
| **Token allowlist**         | Yes         | No                 | No                  | N/A               | N/A               | No                  |
| **Spending limits**         | Yes         | No                 | N/A                 | N/A               | N/A               | No                  |
| **Rate limiting**           | Yes         | No                 | N/A                 | N/A               | N/A               | No                  |
| **Balance circuit breaker** | Yes         | No                 | N/A                 | N/A               | N/A               | No                  |
| **Nonce management**        | Yes         | No                 | N/A                 | N/A               | N/A               | No                  |
| **Wallet options**          | 7 types     | Raw key only       | N/A                 | N/A               | N/A               | GOAT wallets        |
| **Uses Trading API**        | Yes         | No                 | No                  | No                | No                | No                  |
| **Uses official SDKs**      | Yes         | No                 | No                  | No                | No                | Partial             |
| **Author**                  | Uniswap     | kukapay            | kukapay             | kukapay           | kukapay           | Crossmint           |

## Glossary

> See [shared/glossary.md](/docs/prd-shared/glossary.md) for the full glossary of terms used across all PRDs.

***

## Distribution: Dual Delivery Model

### Why Dual Delivery

OpenClaw (188K+ GitHub stars, 5,705+ community skills on ClawHub) is the dominant agent skills ecosystem but has **no native MCP client support** -- Issue #4834 (Jan 30, 2026) was closed as "not planned." Community bridges exist (`openclaw-mcp` with OAuth 2.1, `openclaw-mcp-plugin` with Streamable HTTP) but native support is absent.

To reach the maximum number of agent frameworks, the Gotts Safe must be delivered in two formats:

1. **Native MCP server** (`@gotts.ai/safe` on npm) -- primary delivery for Claude Code, Cursor, Vercel AI SDK, and any MCP-compatible framework
2. **AgentSkills package** (`packages/safe/skills/` with SKILL.md) -- for OpenClaw/ClawHub, GitHub Copilot, and any AgentSkills-compatible framework

### AgentSkills Wrapping Strategy

Each MCP tool category maps to an AgentSkills skill folder:

| MCP Tool Category    | AgentSkills Skill       | Skill File                                    |
| -------------------- | ----------------------- | --------------------------------------------- |
| Data and Analytics   | `uniswap-pool-analysis` | `packages/safe/skills/uniswap-pool-analysis/` |
| Trading              | `execute-swap`          | `packages/safe/skills/execute-swap/`          |
| Liquidity            | `manage-liquidity`      | `packages/safe/skills/manage-liquidity/`      |
| CCA and Token Launch | `deploy-agent-token`    | `packages/safe/skills/deploy-agent-token/`    |
| Protocol Fees        | `seek-protocol-fees`    | `packages/safe/skills/seek-protocol-fees/`    |

Skills load progressively (name/description at startup, full instructions on demand) following the AgentSkills specification.

### Security Considerations

Given the **ClawHub malicious skills incident** (283-386 malicious entries, ClawHavoc campaign delivering Atomic Stealer malware targeting crypto wallet keys):

* All published AgentSkills packages must be signed and verified
* VirusTotal scanning on every release
* No embedded download instructions in SKILL.md (the "pastebin piping" attack vector)
* Wallet key isolation in TEEs -- skills never have direct key access

***

## Source Repository Reference

This PRD was authored in the `uni-ai` monorepo.

### Repository Structure

```
gotts-monorepo/
├── packages/
│   ├── cli/                     # @gotts.ai — Unified CLI (setup, safe, devenv, portal, etc.)
│   │   └── src/
│   │       ├── cli.ts           # Commander entry point, subcommand registration
│   │       ├── commands/        # One file per subcommand (setup.ts, safe.ts, devenv.ts, etc.)
│   │       └── utils/           # Shared CLI utilities
│   ├── safe/                    # @gotts.ai/safe — Gotts Safe MCP server (standalone)
│   │   └── src/
│   │       ├── index.ts         # Server entry point, tool registration
│   │       ├── tools/           # One file per MCP tool
│   │       ├── providers/       # Chain and subgraph providers
│   │       ├── constants/       # Addresses, ABIs, subgraph URLs
│   │       ├── config.ts        # Configuration management
│   │       ├── cache.ts         # Response caching
│   │       ├── errors.ts        # Structured error types
│   │       └── types.ts         # Shared types
│   ├── vault/                   # @gotts.ai/vault — Gotts Vaults (standalone MCP + SDK + contracts)
│   ├── tui/                     # @gotts.ai/tui — Shared terminal UI primitives
│   ├── shared/                  # @gotts.ai/shared (types, errors, chain utils)
│   └── agent-proxy/             # @gotts.ai/agent-proxy (time-delayed execution)
├── .claude/                     # Claude Code config
│   ├── commands/                # Slash commands (68)
│   └── settings.json
├── prd/                         # Product requirements documents
│   ├── mcp-server/             # Gotts Safe PRD (this directory)
│   ├── agents/                 # Agents PRD
│   ├── skills/                 # Skills PRD
│   ├── shared/                 # Shared references (market context, glossary, chains)
│   └── vault/                   # Vault PRDs (16 files)
├── research/                    # Market research and ecosystem analysis
└── scripts/
```

### Skill File Format

```yaml
---
description: Trigger phrases for auto-activation
allowed-tools: Read, Write, Edit, Task(subagent_type:agent-name)
model: opus
---
# Skill Title
[Markdown instructions, patterns, code examples]
```

### Agent File Format

```yaml
---
description: Agent expertise description
model: opus
allowed-tools: Read, Glob, Grep, WebFetch, WebSearch
---
# Agent Role
You are an expert in [domain].
## Expertise Areas
```

### plugin.json Format

```json
{
  "name": "plugin-name",
  "version": "1.0.0",
  "skills": ["./skills/skill-name"],
  "commands": ["./skills/skill-name/skill-name.md"],
  "agents": ["./agents/agent-name.md"]
}
```

### MCP Server Config (.mcp.json)

```json
{
  "mcpServers": {
    "uniswap": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@gotts.ai/safe"],
      "env": { "WALLET_TYPE": "local", "PRIVATE_KEY": "${KEY}" }
    }
  }
}
```

> **Direct vs CLI**: Use `@gotts.ai/safe` (above) in MCP client configs for faster cold-start. Use `@gotts.ai` with subcommands (`npx @gotts.ai safe`, `npx @gotts.ai setup`, etc.) for interactive CLI usage. See [MCP Config Integration](#mcp-config-integration) for details.

### Naming Conventions

| Component | Format      | Pattern         | Examples                                |
| --------- | ----------- | --------------- | --------------------------------------- |
| Skills    | verb-noun   | Action-oriented | `execute-swap`, `seek-protocol-fees`    |
| Agents    | noun-role   | Entity-oriented | `trade-executor`, `protocol-fee-seeker` |
| MCP Tools | snake\_case | Resource-action | `get_token_price`, `execute_burn`       |

### Uniswap SDK Packages

`@uniswap/sdk-core`, `@uniswap/v3-sdk`, `@uniswap/v4-sdk`, `@uniswap/universal-router-sdk`, `@uniswap/router-sdk`, `@uniswap/permit2-sdk`, `@uniswap/uniswapx-sdk`, `@uniswap/smart-order-router`

### Reference Patterns for Local Testnet & DCA

The local testnet and DCA tools draw on established patterns:

* **Local testnet with mock Uniswap**: Anvil forks with mock V2 routers, test tokens, and whale impersonation for funding test accounts
* **Time-travel testing**: `evm_increaseTime` + `evm_mine` for testing DCA cadences, LP fee accumulation, and governance timelocks without waiting
* **V2/V3 adapter patterns**: Wrapping V3 pools behind V2-compatible interfaces for backward compatibility
* **Permit2 integration**: Universal approval pattern for agents
* **Environment management**: Single manifest → multi-target env generation (frontend, contracts, shell)
* **DCA order lifecycle**: Create → execute → pause → resume → cancel with keeper automation via Gelato
* **On-chain preview helpers**: `previewSwap()`, `previewOrderExecution()` for agent simulation before execution

### Protocol Fee System (Unification Proposal)

The TokenJar/Firepit tools serve the Uniswap Unification proposal:

* **TokenJar**: Central vault accumulating protocol fees from V2, V3, V4, UniswapX, and Unichain native fees
* **Firepit**: Burns UNI tokens (to `0xdead`) in exchange for releasing TokenJar assets
* **Fee source breakdown**: Each fee is attributed to its origin protocol
* **Burn economics**: Threshold (currently 4,000 UNI), nonce for replay protection, profitability calculation
* **Searcher patterns**: Monitor accumulated fees → calculate profit vs. burn cost → execute burn-and-claim

***

## npm Package Distribution

### Package Metadata Requirements

Two npm packages serve different purposes:

| Package          | Purpose                                                    | Path            | `bin`                          |
| ---------------- | ---------------------------------------------------------- | --------------- | ------------------------------ |
| `@gotts.ai/safe` | Standalone MCP server (recommended for MCP client configs) | `packages/safe` | `gotts-safe → ./dist/index.js` |
| `@gotts.ai`      | Unified CLI — Commander subcommands for all Gotts tools    | `packages/cli`  | `gotts → ./dist/cli.js`        |

#### `@gotts.ai/safe` (MCP Server)

For discoverability on npm and validation by the official MCP Registry, `package.json` must include:

```json
{
  "name": "@gotts.ai/safe",
  "mcpName": "io.github.gotts-protocol/safe",
  "bin": { "gotts-safe": "./dist/index.js" },
  "keywords": [
    "mcp",
    "model-context-protocol",
    "uniswap",
    "defi",
    "ai-agent",
    "claude",
    "cursor",
    "llm",
    "erc-4626",
    "base",
    "ethereum"
  ],
  "files": [
    "dist",
    "README.md",
    "INSTALL.md",
    "CHANGELOG.md",
    "LICENSE",
    ".env.example"
  ]
}
```

The `mcpName` field in `io.github.{org}/{repo}` format is **required** for the official MCP Registry. Without it, `mcp-publisher publish` validation fails and the server cannot be listed.

#### `@gotts.ai` (Unified CLI)

The unified CLI wraps all Gotts packages under a single `gotts` command. Subcommands dynamically import their target package to keep cold-start fast for each subcommand.

```json
{
  "name": "@gotts.ai",
  "description": "Gotts — Agent Capital Markets powered by Uniswap. Unified CLI for setup, MCP server, devenv, portal, and more.",
  "bin": { "gotts": "./dist/cli.js" },
  "keywords": [
    "gotts",
    "uniswap",
    "defi",
    "ai-agent",
    "mcp",
    "model-context-protocol",
    "cli",
    "agent-economy",
    "erc-4626",
    "erc-8004"
  ],
  "files": ["dist", "README.md", "LICENSE"],
  "dependencies": {
    "commander": "^13.0.0",
    "@gotts.ai/core": "workspace:*",
    "@gotts.ai/tui": "workspace:*"
  }
}
```

**Subcommands**:

| Subcommand          | Dynamic Import            | Description                            |
| ------------------- | ------------------------- | -------------------------------------- |
| `gotts setup`       | `@gotts.ai/safe` (wizard) | Interactive install wizard             |
| `gotts safe`        | `@gotts.ai/safe`          | Start MCP server (stdio or HTTP)       |
| `gotts devenv`      | `@gotts.ai/devenv`        | Start local Uniswap testnet            |
| `gotts portal`      | `@gotts.ai/portal`        | Agent management dashboard             |
| `gotts testnet`     | `@gotts.ai/testnet`       | Generic EVM test toolkit               |
| `gotts install-mcp` | (built-in)                | Write MCP config to client config file |
| `gotts config`      | (built-in)                | Manage Gotts configuration             |
| `gotts doctor`      | (built-in)                | Diagnose configuration issues          |

Heavy dependencies (`@gotts.ai/safe`, `@gotts.ai/devenv`, `@gotts.ai/portal`, `@gotts.ai/testnet`) are **dynamic imports** — they are only loaded when the subcommand is invoked, not at CLI startup. This keeps `gotts --help` instant. Bundled dependencies (`@gotts.ai/core`, `@gotts.ai/tui`) are lightweight and always available.

**Deprecation mapping**:

| Old Command                   | New Command                  |
| ----------------------------- | ---------------------------- |
| `npx @gotts.ai/create`        | `npx @gotts.ai setup`        |
| `npx @gotts.ai/create --zero` | `npx @gotts.ai setup --zero` |
| `npx @gotts.ai/create --ui`   | `npx @gotts.ai setup --ui`   |
| `npx @gotts.ai/portal`        | `npx @gotts.ai portal`       |

### npm Distribution Tags

Maintain separate npm distribution tags:

| Tag       | Published When             | Config Example                            |
| --------- | -------------------------- | ----------------------------------------- |
| `@latest` | Stable releases            | `"args": ["-y", "@gotts.ai/safe@latest"]` |
| `@beta`   | Preview features           | For adventurous early adopters            |
| `@dev`    | Latest main branch (CI/CD) | Internal testing only                     |

All example configs in documentation use `@latest`. Advanced users can pin: `@gotts.ai/safe@1.0.0`.

### MCP-Specific SemVer Semantics

Because MCP tool schemas are public contracts consumed by LLMs and agent frameworks, standard semver is applied with MCP-specific nuances:

| Change                                   | Version Bump | Reason                                    |
| ---------------------------------------- | ------------ | ----------------------------------------- |
| Remove or rename a tool                  | **MAJOR**    | Agents that depend on the tool will break |
| Change a required parameter name or type | **MAJOR**    | Tool invocations will fail                |
| Add a new tool                           | MINOR        | Additive, backward compatible             |
| Add optional parameter with default      | MINOR        | Backward compatible                       |
| Fix a tool bug without schema change     | PATCH        | No contract change                        |
| Fix tool description                     | PATCH        | No schema change                          |

The `serverInfo.version` in the MCP `initialize` response **must always match `package.json`.** Clients cache tool lists by server name+version.

### `CHANGELOG.md` Format

Maintain a `CHANGELOG.md` following [Keep a Changelog](https://keepachangelog.com) format. Every entry must call out tool-level changes explicitly:

```markdown
## [1.1.0] — 2026-03-01

### Added

- `get_trending_pools` — Top pools by 24h volume across all chains (data profile)

### Fixed

- `get_token_price` handles tokens with no liquidity gracefully

## [1.0.0] — 2026-02-18

### Added

- Initial release: 27 tools across data, trader, lp, vault, fees profiles
```

### Registry Listings

For comprehensive ecosystem listings (official MCP Registry, Smithery, Docker MCP Catalog, mcp.so, PulseMCP, and one-click install deeplinks), see [**16-registries.md**](/docs/gotts-safe-mcp-server/mcp-server/16-registries.md). That document contains:

* The full `server.json` for the official MCP Registry
* The `smithery.yaml` configuration
* The `server.yaml` for Docker MCP Catalog submission
* Cursor and VS Code deeplink install button implementations
* Complete npm package requirements

***

### Companion Research Documents

| Document                                           | Focus                                           |
| -------------------------------------------------- | ----------------------------------------------- |
| `uniswap-agent-ecosystem-ideas.md`                 | Master research, prioritization, open questions |
| `agent-to-agent-economy-2026.md`                   | x402, self-funding agents, value accrual        |
| `defi-agent-infrastructure-feb-2026.md`            | Payment protocols, identity, coordination       |
| `ai-agent-security-safety-trust-2026.md`           | Threats, safety patterns, wallet security       |
| `agent-hackathons-and-competitions-2026.md`        | Hackathons, SKILL.md, launchpads                |
| `agent-economy-opportunities.md`                   | Full skills/agents/MCP roadmap, gap analysis    |
| `erc-8004-defi-agents-research.md`                 | ERC-8004 spec, V4 hooks, vaults                 |
| `privy-agentic-wallets-infrastructure-feb-2026.md` | Privy architecture, policies                    |
| `onchain-ai-agent-ecosystem-feb-2026.md`           | Builder profiles, standards                     |
