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

# AgentKit for builders

> Generate the code for your own yield.xyz integration with the AgentKit builder plugin.

The `yield-xyz-agentkit-builder` plugin turns an MCP-compatible coding agent into a yield.xyz integration builder. Instead of running yields conversationally, it scaffolds projects and generates the code you ship: REST calls or `@yieldxyz/sdk` against your own API key, with transaction signing wired for your stack.

<Note>
  The code this plugin generates always calls `https://api.yield.xyz` directly. Nothing it ships calls the MCP server: the MCP is only a build-time reference the agent uses to ground field names against the live API spec while it writes your code.
</Note>

## What it generates

The builder picks an approach based on what you're building, then writes the code:

| Situation | What it generates |
| - | - |
| Existing app (most integrations) | A component, route, or endpoints wired into your codebase with typed `@yieldxyz/sdk` calls or REST, matching your stack. It does not scaffold a new project. |
| New project, staking UI or unspecified | A Vite + React + TypeScript app using `@stakekit/widget` |
| New project needing custom UI | A Next.js (App Router) app using `@yieldxyz/sdk` |
| New non-JS backend (Python, Go, …) | Plain REST calls against the Yield API, illustrated with a Python FastAPI scaffold |

Every path follows the same transaction lifecycle: discover a yield, read its schema for required arguments, build the enter/exit/manage action, sign and broadcast each returned transaction in order, then submit the broadcast hash so yield.xyz can track it through confirmation. Generated code never modifies an `unsignedTransaction` and never hardcodes field names. It fetches the live OpenAPI spec (`https://api.yield.xyz/docs.json`) before writing request or response handling.

Once a project is running, the agent installs dependencies, starts the dev server(s) itself, and reports back the working URLs rather than leaving you to run and verify it.

## Prerequisites

* **A yield.xyz API key.** Every generated integration uses your own key against `https://api.yield.xyz`; the agent asks for it before writing code. Get one from [Projects & API keys](/documentation/get-started/projects-api-keys).
* **An MCP-compatible coding agent.** Claude Code is the primary target; the plugin also ships a Codex plugin manifest, and the skill installs standalone for other MCP-compatible agents (Gemini CLI, etc.).
* **The AgentKit marketplace**, added once per machine:

```bash theme={null}
/plugin marketplace add stakekit/agentkit
```

## Install

```bash theme={null}
/plugin install yield-xyz-agentkit-builder@agentkit
```

This installs from the `agentkit` marketplace registered above. The plugin is independent of the base `yield-xyz-agentkit` plugin: it does not require it installed.

## What happens after installation

The plugin bundles two pieces and wires them together in one step:

* **The builder skill**: the instruction layer that tells the agent how to scope your integration, which reference file to read for your stack and chain, and the rules it must follow (API key handling, live-spec grounding, never modifying an unsigned transaction, pagination on every yield list).
* **An MCP connection** (`.mcp.json`): registers the `yield-xyz-agentkit` MCP server (`https://mcp.yield.xyz/mcp`) so the agent can call its read-only doc tools (fetching the live API spec, looking up reference repos) while it generates code. This registration is a build-time convenience. If the MCP is unavailable, the agent falls back to fetching `https://api.yield.xyz/docs.json` directly, so it never blocks the build.

Once installed, ask the agent to build something, for example "build a React component that shows a user's yield portfolio", and it activates the skill automatically.

For a walkthrough of scaffolding a project end to end, see the [AgentKit builder guide](/guides/ai/agentkit-builder).

## Next steps

<Columns cols={2}>
  <Card title="AgentKit builder guide" icon="book-open" href="/guides/ai/agentkit-builder">
    Walk through scaffolding a project with the builder step by step.
  </Card>

  <Card title="AgentKit for Claude Code" icon="plug" href="/documentation/ai-agents/agentkit/claude-code">
    Run yields conversationally instead of generating integration code.
  </Card>

  <Card title="MCP tool reference" icon="wrench" href="/documentation/ai-agents/mcp-server#tool-reference">
    The full set of tools the MCP server exposes.
  </Card>

  <Card title="Guardrails" icon="shield" href="/documentation/ai-agents/agentkit/guardrails">
    Safety rules generated code and agents must follow.
  </Card>
</Columns>


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