Skip to content

Commit 42ee929

Browse files
bcherryclaude
andauthored
feat: add lk docs commands for searching and browsing LiveKit documentation (#774)
* search * refactor: use official MCP Go SDK, add missing submit-feedback params Replace hand-rolled MCP streamable HTTP client (~230 lines) with the official modelcontextprotocol/go-sdk. Also add missing --agent and --model flags to submit-feedback to match the server's full schema. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: warn when docs MCP server is newer than expected Check the server's reported version after connecting. If the major or minor version is newer than what this CLI was built against (currently 1.2.x), print a warning to stderr suggesting the user update lk. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add hidden --server-url and --vercel-header flags for docs dev Add hidden flags to `lk docs` for development against staging or preview deployments of the docs MCP server. Also add a README section documenting the docs feature and its development options. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: send lk_cli_version and project_id with docs MCP tool calls Injects lightweight telemetry params into every MCP tool call so the docs server can track CLI version and optionally the Cloud project ID. The project ID is resolved silently from the --project flag or default project config and omitted when no project is configured. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add request timeout, unit tests, fix hits-per-page default - Add 30s timeout to all docs MCP requests to prevent hanging if the server is unresponsive. - Remove hardcoded hits-per-page default of 10; let the server default to 20 instead. - Add unit tests for parseMajorMinor, isNotFoundErr, and headerTransport. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: add --json flag to docs commands Adds a --json / -j flag on the docs parent command so all tool-based subcommands can request JSON output from the MCP server. When set, sends format: "json" in the tool call arguments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * feat: switch list-sdks to get_sdks tool, bump expected server to 1.3 Replace the livekit://sdks resource read with the new get_sdks tool call, which supports all standard params (format, telemetry). Remove the now-unused callDocsResourceAndPrint helper and encoding/json import. Bump expectedServerVersion to 1.3. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: use camelCase for telemetry params (lkCliVersion, projectId) Match the server-side naming convention. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent f680f7f commit 42ee929

6 files changed

Lines changed: 771 additions & 0 deletions

File tree

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,50 @@ The above simulates 5 concurrent rooms, where each room has:
437437
Once the specified duration is over (or if the load test is manually stopped), the load test statistics will be displayed in the form of a table.
438438
439439
440+
## Browsing documentation
441+
442+
The CLI includes a built-in `lk docs` command that lets you search and browse the LiveKit documentation directly from the terminal. It's powered by the [LiveKit docs MCP server](https://docs.livekit.io/mcp) using the official [MCP Go SDK](https://github.com/modelcontextprotocol/go-sdk).
443+
444+
```shell
445+
# Get a complete overview of the docs site
446+
lk docs overview
447+
448+
# Search the docs
449+
lk docs search "voice agents"
450+
451+
# Fetch a specific page as markdown
452+
lk docs get-page /agents/start/voice-ai-quickstart
453+
454+
# Search code across LiveKit GitHub repos
455+
lk docs code-search "class AgentSession" --repo livekit/agents
456+
457+
# Get recent releases for an SDK
458+
lk docs changelog pypi:livekit-agents
459+
460+
# List all LiveKit SDKs
461+
lk docs list-sdks
462+
463+
# Submit feedback on the docs
464+
lk docs submit-feedback --page /agents/build/tools "Missing info about error handling"
465+
```
466+
467+
Run `lk docs --help` for full details on each subcommand.
468+
469+
### Development options
470+
471+
For development against staging or preview deployments of the docs MCP server, two hidden flags are available on the `lk docs` command:
472+
473+
- `--server-url URL`: Override the MCP server endpoint (default: `https://docs.livekit.io/mcp/`)
474+
- `--vercel-header VALUE`: Set the `x-vercel-protection-bypass` header, required for accessing private Vercel preview deployments
475+
476+
```shell
477+
# Use a staging server
478+
lk docs --server-url https://docs-staging.example.com/mcp/ search "agents"
479+
480+
# Access a private Vercel preview deploy
481+
lk docs --server-url https://docs-abc123.vercel.app/mcp/ --vercel-header <token> overview
482+
```
483+
440484
## Additional notes
441485

442486
### Parameter precedence

0 commit comments

Comments
 (0)