> ## 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.

# Running Station

> Start and manage the Station server

## Running Modes

Station can run in three different modes:

| Mode       | Command     | Best For                         |
| ---------- | ----------- | -------------------------------- |
| **Server** | `stn serve` | Local development, direct access |
| **Docker** | `stn up`    | Isolated deployment, CI/CD       |
| **stdio**  | `stn stdio` | Direct MCP integration           |

## Server Mode

Start Station directly on your machine:

```bash theme={null}
stn serve
```

This starts all Station services:

| Service   | Default Port | Description                           |
| --------- | ------------ | ------------------------------------- |
| API/UI    | 8585         | REST API and Web management interface |
| MCP       | 8586         | Model Context Protocol server         |
| Agent MCP | 8587         | OAuth-protected dynamic agent MCP     |
| SSH       | 2222         | SSH admin interface                   |

### Custom Ports

```bash theme={null}
stn serve --api-port 9000 --mcp-port 9001 --ssh-port 2223
```

### With Telemetry

```bash theme={null}
# Start Jaeger first
stn jaeger up

# Start Station with telemetry enabled
stn serve --enable-telemetry
```

View traces at [http://localhost:16686](http://localhost:16686)

## Docker Mode

Start Station in an isolated Docker container:

```bash theme={null}
stn up
```

### What `stn up` Does

1. **Builds/pulls** the Station container image
2. **Creates** Docker volume for configuration persistence
3. **Mounts** your current directory as `/workspace`
4. **Starts** the container with all services
5. **Updates** `.mcp.json` for Claude Desktop integration

### With Bundle

Install a CloudShip bundle on startup:

```bash theme={null}
stn up --bundle e26b414a-f076-4135-927f-810bc1dc892a
```

### With Custom Workspace

```bash theme={null}
stn up --workspace ~/projects/my-project
```

### Development Mode

Enable Genkit Developer UI for debugging:

```bash theme={null}
stn up --develop
```

Access Genkit UI at [http://localhost:4000](http://localhost:4000)

### Stopping

```bash theme={null}
# Stop container (data preserved)
stn down

# Stop and delete all data
stn down --remove-volume
```

## stdio Mode

For direct MCP integration with AI editors:

```bash theme={null}
stn stdio
```

This mode:

* Runs MCP server over stdin/stdout
* Used by Claude Desktop, Cursor, etc.
* No network ports exposed

### Claude Desktop Integration

Add to your Claude Desktop config:

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

## Telemetry

Station supports OpenTelemetry for distributed tracing.

### Quick Setup

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

# Verify it's running
stn jaeger status

# Start Station with telemetry
stn serve --enable-telemetry
```

### Manual Configuration

Set in `config.yaml`:

```yaml theme={null}
telemetry_enabled: true
otel_endpoint: http://localhost:4318
```

Or via environment:

```bash theme={null}
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318
export OTEL_SERVICE_NAME=station
stn serve
```

### Viewing Traces

Open Jaeger UI at [http://localhost:16686](http://localhost:16686) and search for service `station`.

## Health Checks

Check if Station is running:

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

Or via API:

```bash theme={null}
curl http://localhost:8585/api/v1/health
```

## Logs

View server logs:

```bash theme={null}
# For stn up (Docker mode)
stn logs

# Follow logs
stn logs --follow
```

## Auto-Sync on Startup

When Station starts, it automatically syncs configurations from file-based configs:

```
📁 Syncing environment: default
   ✓ Loaded 3 MCP servers from template.json
   ✓ Loaded 2 agents from agents/*.prompt
   ✓ Synced 15 tools
```

To skip auto-sync:

```bash theme={null}
stn serve --skip-sync
```
