---
title: "langsight init"
description: "Auto-discover MCP servers and generate .langsight.yaml"
---

## Usage

```bash
langsight init [OPTIONS]
```

## Options

| Option | Default | Description |
|--------|---------|-------------|
| `--output`, `-o` | `.langsight.yaml` | Output path for config file |
| `--slack-webhook` | — | Slack webhook URL for alerts |
| `--yes`, `-y` | false | Skip confirmation prompts |

## What it does

`langsight init` scans well-known MCP config file locations and generates a `.langsight.yaml` in your current directory.

**Auto-discovery sources:**

| Source | Path |
|--------|------|
| Claude Desktop | `~/.config/claude/claude_desktop_config.json` |
| Cursor | `~/.cursor/mcp.json` |
| VS Code | `~/.vscode/mcp.json` |

## Example

```bash
$ langsight init

LangSight Init — scanning for MCP servers...

  ✓ Claude Desktop (~/.config/claude/claude_desktop_config.json) — 4 servers
  ✓ Cursor (~/.cursor/mcp.json) — 2 servers

Discovered 6 MCP servers:
  1. snowflake-mcp    (stdio)
  2. github-mcp       (stdio)
  3. slack-mcp        (sse)
  4. jira-mcp         (stdio)
  5. postgres-mcp     (stdio)
  6. filesystem-mcp   (stdio)

Include all 6 servers? [Y/n]: Y

Slack webhook URL for alerts (leave blank to skip): https://hooks.slack.com/...

✓ Config written to .langsight.yaml
  6 MCP servers configured
  Slack alerts enabled

Next steps:
  langsight mcp-health      Check server health
  langsight security-scan   Run security audit
  langsight monitor         Start continuous monitoring
```

## Generated config

```yaml
servers:
  - name: snowflake-mcp
    transport: stdio
    command: python
    args: [/path/to/snowflake_mcp/server.py]

  - name: slack-mcp
    transport: sse
    url: http://localhost:8080/sse

alerts:
  slack_webhook: https://hooks.slack.com/services/...
```

## Non-interactive mode

```bash
langsight init --yes --slack-webhook https://hooks.slack.com/... --output /etc/langsight.yaml
```
