# AI Agents & MCP Server

Carbon DeFi has an MCP (Model Context Protocol) server that allows AI agents to create and manage on-chain trading strategies programmatically.

{% hint style="info" %}
Experimental — still being worked on. Use at your own risk.
{% endhint %}

* MCP endpoint: <https://carbon-mcp.duckdns.org/mcp>
* REST API: <https://carbon-mcp.duckdns.org/tools/:toolName>
* OpenAPI spec: <https://carbon-mcp.duckdns.org/openapi.json>
* Plugin manifest: <https://carbon-mcp.duckdns.org/.well-known/ai-plugin.json>
* Server info: <https://carbon-mcp.duckdns.org/info>

#### Claude Desktop setup

Add this to your Claude Desktop config to connect:

json

```json
{
  "mcpServers": {
    "carbon-defi": {
      "command": "npx",
      "args": ["mcp-remote", "https://carbon-mcp.duckdns.org/mcp"]
    }
  }
}
```

#### Key conventions for agents

* All write operations return unsigned transactions — the user always signs and broadcasts
* Always call get\_strategies first to check existing positions
* Market price is auto-fetched from the Carbon API — no need to provide it manually
* Prices are always in quote token per 1 base token
* buy\_budget is always in quote token; sell\_budget is always in base token
* Check the warnings array in every response before presenting a transaction

<br>
