Skip to main content

Prerequisites

  • Python 3.11+
  • uv (recommended) or pip
  • At least one MCP server configured (Claude Desktop, Cursor, or VS Code)

Step 1 — Install

uv tool install langsight

Step 2 — Auto-discover your MCP servers

langsight init
LangSight scans your local MCP configs and generates .langsight.yaml:
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)

✓ Config written to .langsight.yaml

Step 3 — Trace your agent sessions

Add two lines to your agent code:
from langsight.sdk import LangSightClient

client = LangSightClient(url="http://localhost:8000")     # line 1
traced = client.wrap(mcp_session, server_name="my-mcp")  # line 2
# All call_tool() calls are now traced automatically
Then view sessions from the CLI:
langsight sessions
Agent Sessions                               last 24 hours
──────────────────────────────────────────────────────────────────────
Session          Agent              Duration   Tools   Failures   Cost
sess-f2a9b1      support-agent      1,482ms       5          1   $0.023
sess-d4c7e8      data-analyst       4,210ms      12          0   $0.089
sess-a0b3f5      orchestrator        890ms        3          0   $0.012
Drill into a session to see the full multi-agent trace:
langsight sessions --id sess-f2a9b1
Session: sess-f2a9b1  |  3 agents  |  7 tool calls  |  1 failure  |  $0.023

Task: "Resolve customer complaint #4821"

├── Agent: orchestrator
│   ├── [MCP]      jira-mcp/get_issue        42ms  ✓  $0.001
│   ├── [HTTP API] stripe-api/get_charges    210ms  ✓  $0.003
│   ├── → Handoff to Agent: research
│   │   ├── [MCP]  confluence-mcp/search    891ms  ✓  $0.001
│   │   └── [HTTP] openai-api/embed         120ms  ✓  $0.004
│   └── → Handoff to Agent: action
│       ├── [MCP]      crm-mcp/update_ticket  89ms  ✓  $0.001
│       └── [MCP]      slack-mcp/notify         —   ✗  connection refused
LangSight traces every call the agent makes — MCP servers, HTTP APIs, and sub-agents — all in one tree. MCP servers (jira-mcp, confluence-mcp, crm-mcp, slack-mcp) are also independently health-checked and security-scanned. HTTP APIs (stripe-api, openai-api) appear in the trace but are observed passively only.

Step 4 — Check MCP server health

langsight mcp-health
MCP Server Health  (6 servers)
──────────────────────────────────────────────────────────────────
Server           Status      Latency   Tools   Schema
snowflake-mcp    ✓ up        142ms     8       bcf0ec26…
github-mcp       ✓ up        89ms      12      d2125e3a…
slack-mcp        ⚠ degraded  1,240ms   4       abc123de…
jira-mcp         ✗ down      —         —       —
postgres-mcp     ✓ up        31ms      5       f4a2b1c9…
filesystem-mcp   ✓ up        12ms      6       8e3d7f2a…

4/6 servers healthy

Step 5 — Run a security scan

langsight security-scan
Security Scan Results  (6 servers, 3 findings)
────────────────────────────────────────────────────────
CRITICAL  jira-mcp      CVE-2025-6514  Remote code execution
HIGH      slack-mcp     OWASP-MCP-01   No authentication configured
MEDIUM    postgres-mcp  OWASP-MCP-05   Tool 'query' has no input schema

Step 6 — Start continuous monitoring

langsight monitor --interval 30
LangSight polls every 30 seconds and fires Slack/webhook alerts on state transitions.

Next steps

CLI Reference

All commands and options.

AI Providers

Set up Claude, Gemini, or Ollama for langsight investigate.

SDK Integration

Add 2-line tracing to your agent code.

Self-Hosting

Production deployment with ClickHouse + PostgreSQL.