---
name: install-skill
description: Install AgentRoot records — skills, MCP servers, or agents — from any domain to your local environment. Use when a user wants to install, add, or set up a capability from the registry or directly from a domain.
auth: none
cost: free
endpoints:
  - method: GET
    url: https://agentroot.io/api/skills/{domain}/item/{skill_id}
    description: Get skill metadata and SKILL.md URL (registry fallback)
    params:
      domain: Publisher domain (e.g. stripe.com)
      skill_id: Skill identifier (e.g. payments)
---

# Install Record

Install AgentRoot records to your local environment. The CLI resolves capabilities protocol-first via DNS, falling back to the registry API.

## When to use

- The user wants to install a skill, MCP server, or agent they found
- The user says "install X" or "add the Y skill"
- After discovering a capability via search, the user wants to use it

## How it works

The install command uses a **protocol-first approach**:

1. **DNS resolution** — looks up `_agentroot.<domain>` to find the manifest
2. **Manifest lookup** — fetches the manifest and finds the matching record by ID
3. **Registry fallback** — if DNS resolution fails, queries the AgentRoot API
4. **Type-specific install** — handles each record type differently:
   - **skill** — downloads SKILL.md to the correct tool directory
   - **mcp** — shows connection config (endpoint, transport, tools)
   - **agent/a2a** — shows endpoint and protocol info

## Usage

### Via CLI (preferred)

```bash
# Install a skill (auto-detects your AI tools)
npx agent-root install stripe.com/payments

# Install to a specific tool
npx agent-root install stripe.com/payments --tool claude

# Install to project directory (not global)
npx agent-root install stripe.com/payments --project

# Install all records from a domain
npx agent-root install stripe.com --all
```

### Via MCP

If the `agentroot` MCP server is connected, use its `install_skill` tool:

```
install_skill({ domain: "stripe.com", skill_id: "payments" })
install_skill({ domain: "stripe.com", skill_id: "payments", tool: "claude" })
```

### Via HTTP (manual fallback)

1. Resolve the domain: look up `_agentroot.<domain>` DNS TXT record
2. Fetch the manifest from the `manifest=` URL
3. Find the record with matching `id`
4. For skills: download the SKILL.md and save to the tool directory
5. For MCP: use the endpoint and transport to configure your MCP client

## What gets installed where

### Skills

Skills are installed as directories with `SKILL.md` + `.agentroot-manifest.json`:

| Tool | Global directory | Project directory |
|------|-----------------|-------------------|
| Claude Code | `~/.claude/skills/` | `.claude/skills/` |
| Codex CLI | `~/.codex/skills/` | `.agents/skills/` |
| Gemini CLI | `~/.gemini/skills/` | `.agents/skills/` |
| Cursor | — | `.cursor/skills/` |
| Cross-tool | `~/.agents/skills/` | `.agents/skills/` |

### MCP servers

MCP records are not written to disk — the CLI shows the connection config to add to your MCP settings:

```json
{
  "domain/record-id": {
    "url": "https://example.com/mcp"
  }
}
```

Add this to:
- Claude Code: `.claude/settings.json` under `mcpServers`
- Cursor: `.cursor/mcp.json` under `mcpServers`

### Agents / A2A

Agent and A2A records show connection info (endpoint, protocol, capabilities) for direct integration.

## Instructions

1. Run `npx agent-root install <domain>/<record-id>` or use the MCP tool
2. The CLI auto-detects installed AI tools; override with `--tool` if needed
3. For skills: confirm the install path
4. For MCP servers: help the user add the config to their MCP settings
5. For agents: show the endpoint and how to connect

## Example

User: "Install the payments skill from stripe.com"

1. Run `npx agent-root install stripe.com/payments`
2. Report: "Installed `payments` to `~/.claude/skills/payments/SKILL.md`"
