CLI reference¶
The lcp command-line tool is installed by pip install lcp. All subcommands accept --help for inline documentation.
lcp scan¶
Introspect an installed Python package and emit an LCP manifest.
| Flag | Default | Description |
|---|---|---|
PACKAGE |
— | Importable package name (e.g. requests). |
-o, --output PATH |
stdout | Output file path. |
--include-private |
off | Include private symbols (starting with _). |
--no-recursive |
off | Don't scan submodules recursively. |
--validate / --no-validate |
on | Validate output against LCP schema. |
--indent INTEGER |
2 |
JSON indentation level. |
--coverage PATH |
— | Also generate a documentation coverage report to this path. |
Example:
lcp validate¶
Validate an LCP JSON file against the LCP schema.
| Flag | Default | Description |
|---|---|---|
FILE |
— | Path to an LCP JSON file to validate. |
Example:
lcp serve¶
Start an MCP server (stdio transport) for a single LCP manifest file, exposing tools for exploring and querying the library's API.
| Flag | Default | Description |
|---|---|---|
MANIFEST |
— | Path to an LCP JSON file to serve. |
--name TEXT |
lcp-{library-name} |
Server name for MCP identification. |
Example:
lcp serve-all¶
Start a universal MCP server that resolves any installed Python library on the fly. Unlike lcp serve, no pre-built manifest is required — AI agents call the resolve_library tool to load any pip-installed package. Manifests are cached locally and, when local scanning fails, can be fetched from a remote LCP registry.
Resolution order: local cache → live scan → registry fetch.
| Flag | Default | Description |
|---|---|---|
--cache-dir PATH |
~/.lcp/cache/ |
Cache directory for LCP manifests. |
--name TEXT |
lcp-universal |
Server name for MCP identification. |
--no-cache |
off | Disable reading from and writing to the local cache. |
--registry TEXT |
— | Base URL of an LCP registry used as fallback when local scanning fails. Manifests are fetched from {registry}/manifests/{language}/{name}/{version}.lcp.json. |
Example:
lcp serve-all
lcp serve-all --registry https://raw.githubusercontent.com/zazza123/lcp-registry/refs/heads/main
lcp coverage¶
Generate a documentation coverage report for a Python package, showing which symbols are missing docstrings.
| Flag | Default | Description |
|---|---|---|
PACKAGE |
— | Importable package name to analyze. |
-o, --output PATH |
stdout | Output file path. |
--format [json\|markdown] |
json |
Output format. |
--include-private |
off | Include private symbols (starting with _). |
--no-recursive |
off | Don't scan submodules recursively. |
Example:
lcp publish¶
Publish an LCP manifest to the registry by opening a GitHub Pull Request. The command scans the package (or uses an existing manifest via --file), validates it, then submits the PR to the registry repository.
| Flag | Default | Description |
|---|---|---|
PACKAGE |
— | Importable package name to publish. |
--token TEXT |
— | GitHub personal access token with repo or public_repo scope. Can also be set via LCP_GITHUB_TOKEN or GITHUB_TOKEN env var. |
--registry-repo TEXT |
zazza123/lcp-registry |
Target registry repository in owner/name format. |
--file PATH |
— | Use an existing LCP JSON file instead of scanning the package. |
--include-private |
off | Include private symbols when scanning (starting with _). |
--no-recursive |
off | Don't scan submodules recursively. |
--dry-run |
off | Generate the manifest and show what would be submitted without creating a PR. |
Example:
lcp publish requests --token ghp_xxxx
lcp publish numpy --dry-run
lcp publish mylib --file mylib.lcp.json --token ghp_xxxx
lcp diff¶
Compare two LCP files and detect deprecated symbols. Symbols present in the older file but missing in the newer file are reported as removed. The output includes generated deprecation entries that can be merged into the new manifest.
| Flag | Default | Description |
|---|---|---|
OLD |
— | Path to the earlier LCP JSON file. |
NEW |
— | Path to the later LCP JSON file. |
-o, --output PATH |
stdout | Output file path. |
--indent INTEGER |
2 |
JSON indentation level. |
--update |
off | Write detected deprecations back into the NEW LCP file. |
Example:
See also¶
- Quickstart — first-time usage.
- MCP Server guide — using
lcp serveandlcp serve-allin depth. - Publishing guide — using
lcp publishto submit to the registry.