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

# Claude Code Plugin

> Use Station with Claude Code via the official plugin and MCP integration

Station provides two [Claude Code plugins](https://github.com/cloudshipai/station/tree/main/claude-code-plugin) that give Claude Code access to 55+ MCP tools for agent orchestration. Choose the integration style that fits your workflow.

## Choose Your Plugin

Station offers two plugin options:

| Plugin              | Best For                                   | What's Included                      |
| ------------------- | ------------------------------------------ | ------------------------------------ |
| **`station`**       | Users who want lightweight guidance        | Skills + Slash Commands + MCP Server |
| **`station-agent`** | Power users who want autonomous operations | Pre-configured Subagent + MCP Server |

<Tabs>
  <Tab title="station (Skills-based)">
    **Lightweight integration** - Claude learns Station via skills that inject knowledge into your conversation.

    * **Skills**: `station`, `station-agents`, `station-mcp`, `station-deploy`, `station-benchmark`, `station-workflows`
    * **Slash Commands**: `/station`, `/station-agent`, `/station-workflow`, `/station-bundle`
    * **MCP Server**: 55+ tools for agent management, execution, and workflows

    Best when you want direct control over Station operations in your main conversation.
  </Tab>

  <Tab title="station-agent (Subagent-based)">
    **Full integration** - A dedicated Station expert subagent that Claude can delegate to.

    * **Subagent**: `station-operator` - autonomous Station operations
    * **MCP Server**: 55+ tools pre-configured for the subagent
    * **Tracing**: Reminds you to start Jaeger for observability

    Best when you want Claude to handle Station tasks autonomously with cleaner context separation.
  </Tab>
</Tabs>

## Quick Start

### Option 1: Install from Marketplace (Recommended)

```bash theme={null}
# Add the Station marketplace
/plugin marketplace add cloudshipai/station

# Choose ONE of these plugins:
/plugin install station@cloudshipai-station        # Skills-based (lightweight)
/plugin install station-agent@cloudshipai-station  # Subagent-based (full integration)
```

### Option 2: Direct GitHub Install

```bash theme={null}
# Skills-based plugin
/plugin install cloudshipai/station/claude-code-plugin

# Subagent-based plugin
/plugin install cloudshipai/station/claude-code-plugin-agent
```

### Option 3: Local Installation

If you've cloned the Station repository locally:

```bash theme={null}
# Skills-based plugin
/plugin install ./station/claude-code-plugin

# Subagent-based plugin
/plugin install ./station/claude-code-plugin-agent
```

### Option 4: Manual MCP Configuration

Add Station directly to your `.mcp.json` (MCP tools only, no skills or subagent):

```json theme={null}
{
  "mcpServers": {
    "station": {
      "command": "stn",
      "args": ["stdio"],
      "env": {
        "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4318"
      }
    }
  }
}
```

<Tip>
  The `OTEL_EXPORTER_OTLP_ENDPOINT` enables distributed tracing. Start Jaeger with `stn jaeger up` to view traces at [http://localhost:16686](http://localhost:16686).
</Tip>

## Prerequisites

Before using the plugin:

1. **Station CLI installed**: See [Installation](/station/installation)
2. **Station initialized**: Run `stn init` to set up your workspace
3. **At least one agent**: Create an agent or install a bundle

```bash theme={null}
# Verify installation
stn --version

# Initialize Station
stn init

# Create a simple agent
stn agent create --name "Hello Agent" --model gpt-4o-mini
```

## Skills

Skills are comprehensive guides that teach Claude Code how to use Station. Load them with `/skill <name>`:

### Available Skills

| Skill              | Command                 | Description                                            |
| ------------------ | ----------------------- | ------------------------------------------------------ |
| **station**        | `/skill station`        | Core CLI reference - commands, agent format, workflows |
| **station-config** | `/skill station-config` | Configuration deep-dive - all config options explained |

### Using Skills

```
# Load the core Station skill before working with agents
/skill station

# Now ask questions or give commands
Create an agent that monitors Kubernetes pods and alerts on failures
```

Skills provide Claude with:

* Complete command reference with examples
* Agent format (Dotprompt) specification
* Workflow state machine patterns
* MCP tool usage patterns
* Best practices and common patterns

<Tip>
  Load `/skill station` at the start of a session when doing significant Station work. It gives Claude comprehensive context to help you more effectively.
</Tip>

<Note>
  Skills are only available in the `station` plugin. The `station-agent` plugin uses a dedicated subagent instead.
</Note>

### Skill Contents

<Tabs>
  <Tab title="station">
    The core Station skill covers:

    * Agent lifecycle (create, run, list, update, delete)
    * Dotprompt format with YAML frontmatter
    * MCP server tools and configuration
    * Workflow state machines
    * Environment management
    * Bundle creation and installation
  </Tab>

  <Tab title="station-config">
    The configuration skill covers:

    * Global config (`~/.config/station/config.yaml`)
    * AI provider setup (OpenAI, Anthropic, etc.)
    * Coding backend configuration
    * CloudShip platform integration
    * Environment variables
    * OAuth authentication
  </Tab>
</Tabs>

## Station Operator Subagent

<Note>
  The `station-operator` subagent is only available in the `station-agent` plugin.
</Note>

When you install the `station-agent` plugin, you get a dedicated **Station Operator** subagent that Claude can delegate to for autonomous Station operations.

### Capabilities

The `station-operator` subagent can:

| Capability                 | Description                                                        |
| -------------------------- | ------------------------------------------------------------------ |
| **Create & Manage Agents** | Uses `create_agent`, `update_agent`, `delete_agent`, `list_agents` |
| **Execute Agents**         | Uses `call_agent`, `list_runs`, `inspect_run`                      |
| **Configure MCP Servers**  | Uses `add_mcp_server_to_environment`, `discover_tools`             |
| **Handle Workflows**       | Uses `execute_workflow`, `list_approvals`, `approve_step`          |
| **Debug Runs**             | Analyzes execution history, tool calls, and costs                  |

### How It Works

Claude automatically delegates Station tasks to the subagent when appropriate:

```
User: Create a Station agent that monitors Kubernetes pods

Claude: [Invokes station-operator subagent]
[Subagent creates agent using create_agent tool]
[Subagent returns result with agent details]

Claude: I've created your Kubernetes pod monitor agent...
```

You can also invoke it explicitly:

```
Use the station-operator subagent to debug my last failed agent run
```

### Tracing Setup

The subagent reminds you to set up Jaeger for observability on first interaction:

```bash theme={null}
# Start Jaeger for distributed tracing
stn jaeger up

# View traces at http://localhost:16686
```

### Skills vs Subagent: When to Use Each

| Scenario                       | Recommended                       |
| ------------------------------ | --------------------------------- |
| Learning Station commands      | `station` plugin (skills)         |
| Step-by-step guidance          | `station` plugin (skills)         |
| Quick autonomous tasks         | `station-agent` plugin (subagent) |
| Complex multi-step operations  | `station-agent` plugin (subagent) |
| Keeping main context clean     | `station-agent` plugin (subagent) |
| Direct control over operations | `station` plugin (skills)         |

## Available Slash Commands

The plugin provides four slash commands that teach Claude Code how to work with Station:

| Command             | Purpose                                        |
| ------------------- | ---------------------------------------------- |
| `/station`          | Core Station concepts and MCP tools overview   |
| `/station-agent`    | Create and manage AI agents                    |
| `/station-workflow` | Build multi-step workflows with state machines |
| `/station-bundle`   | Package and distribute agent bundles           |

### Using Commands

```
# Get Station overview
/station

# Create an agent
/station-agent

# Build a workflow
/station-workflow

# Package agents
/station-bundle
```

## MCP Tools

After installation, Claude Code has access to Station's MCP tools:

### Agent Management

| Tool                   | Description                              |
| ---------------------- | ---------------------------------------- |
| `station_create_agent` | Create a new agent with prompt and model |
| `station_list_agents`  | List all agents in an environment        |
| `station_call_agent`   | Execute an agent with a task             |
| `station_update_agent` | Modify agent configuration               |
| `station_delete_agent` | Remove an agent                          |

### Execution & Monitoring

| Tool                   | Description                  |
| ---------------------- | ---------------------------- |
| `station_list_runs`    | View execution history       |
| `station_inspect_run`  | Get detailed run information |
| `station_get_run_logs` | Retrieve execution logs      |

### Environment & Configuration

| Tool                         | Description                 |
| ---------------------------- | --------------------------- |
| `station_list_environments`  | List available environments |
| `station_create_environment` | Create a new environment    |
| `station_get_config`         | View Station configuration  |

### Workflows

| Tool                      | Description                     |
| ------------------------- | ------------------------------- |
| `station_create_workflow` | Create a state machine workflow |
| `station_run_workflow`    | Execute a workflow              |
| `station_list_workflows`  | List available workflows        |

<Note>
  Use `/station` to see the full list of 55+ available MCP tools.
</Note>

## Usage Examples

### Creating an Agent

Ask Claude Code directly:

```
Create a Station agent that monitors Kubernetes pod health 
and alerts on failures. Use gpt-4o-mini model.
```

Claude will use `station_create_agent` with the appropriate configuration.

### Running an Agent

```
Run my "Pod Monitor" agent with the task "Check all pods in production namespace"
```

### Building Multi-Agent Teams

```
Create an incident response team with:
1. An "Incident Coordinator" that delegates to specialists
2. A "Kubernetes Expert" for K8s troubleshooting  
3. A "Log Analyzer" for log pattern analysis

Set up the coordinator to call the specialists as tools.
```

### Creating Workflows

```
Create a workflow that:
1. Triages incoming alerts by severity
2. Investigates high-severity issues automatically
3. Requires human approval before remediation
4. Documents the resolution
```

## Agent Format (Dotprompt)

Station agents use the [Dotprompt format](https://firebase.google.com/docs/genkit/dotprompt) - YAML frontmatter with Handlebars templates:

```yaml theme={null}
---
metadata:
  name: "My Agent"
  description: "What this agent does"
model: gpt-4o-mini
max_steps: 8
tools:
  - "__tool_name"
---
{{role "system"}}
You are an expert assistant that...

{{role "user"}}
{{userInput}}
```

<Tip>
  The `{{userInput}}` variable is populated with the task when running the agent. Always include it in your prompt.
</Tip>

## MCP Configuration Options

### Basic stdio Mode

```json theme={null}
{
  "mcpServers": {
    "station": {
      "command": "stn",
      "args": ["stdio"]
    }
  }
}
```

### With Custom Config

```json theme={null}
{
  "mcpServers": {
    "station": {
      "command": "stn",
      "args": ["--config", "/path/to/config.yaml", "stdio"]
    }
  }
}
```

### HTTP Mode (Remote Station)

Connect to a running Station server:

```json theme={null}
{
  "mcpServers": {
    "station": {
      "type": "http",
      "url": "http://localhost:8586/mcp"
    }
  }
}
```

### Multiple Environments

```json theme={null}
{
  "mcpServers": {
    "station-dev": {
      "command": "stn",
      "args": ["--config", "~/.station/dev.yaml", "stdio"]
    },
    "station-prod": {
      "command": "stn",
      "args": ["--config", "~/.station/prod.yaml", "stdio"]
    }
  }
}
```

### With Telemetry

```json theme={null}
{
  "mcpServers": {
    "station": {
      "command": "stn",
      "args": ["stdio"],
      "env": {
        "OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4318"
      }
    }
  }
}
```

## Troubleshooting

### Plugin Not Working

1. Verify Station is installed:

```bash theme={null}
stn --version
```

2. Test MCP manually:

```bash theme={null}
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | stn stdio
```

3. Reinstall the plugin:

```bash theme={null}
/plugin uninstall station
/plugin install cloudshipai/station
```

### MCP Tools Not Available

1. Check `.mcp.json` exists in your project root
2. Restart Claude Code after configuration changes
3. Ask Claude: "List available Station MCP tools"

### Agent Creation Failing

1. Check environment exists:

```bash theme={null}
stn env list
```

2. Verify AI provider is configured:

```bash theme={null}
stn provider status
```

3. Check MCP tools are available:

```bash theme={null}
stn mcp tools
```

## Best Practices

### 1. Choose the Right Plugin

| If you want...                            | Use                         |
| ----------------------------------------- | --------------------------- |
| Lightweight guidance in your conversation | `station` plugin            |
| Autonomous Station operations             | `station-agent` plugin      |
| Both (learning + automation)              | Install both, use as needed |

### 2. Enable Tracing

Always start Jaeger for observability when debugging:

```bash theme={null}
stn jaeger up
# View traces at http://localhost:16686
```

### 3. Use MCP Over CLI

Prefer MCP tools for structured responses:

```
# Good - Claude uses MCP tool with structured response
"Create an agent called 'Cost Analyzer' that..."

# Avoid - asking Claude to run CLI commands
"Run: stn agent create --name 'Cost Analyzer'..."
```

### 4. Use Slash Commands for Context (Skills Plugin)

Start complex tasks with the relevant slash command:

```
/station-workflow

Now create a workflow that handles deployment approvals...
```

### 5. Organize by Environment

Use separate MCP entries for different environments to avoid mistakes:

```json theme={null}
{
  "mcpServers": {
    "station-dev": { "command": "stn", "args": ["--config", "~/.station/dev.yaml", "stdio"] },
    "station-prod": { "command": "stn", "args": ["--config", "~/.station/prod.yaml", "stdio"] }
  }
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Agent Development" icon="robot" href="/station/agents">
    Create custom AI agents
  </Card>

  <Card title="MCP Tools" icon="wrench" href="/station/mcp-tools">
    Full MCP tools reference
  </Card>

  <Card title="Workflows" icon="diagram-project" href="/station/workflows">
    Multi-step orchestration
  </Card>

  <Card title="Bundles" icon="package" href="/station/bundles">
    Package and distribute agents
  </Card>
</CardGroup>
