MCP servers
Connect AI editors to LPM.dev Registry tools through a managed MCP server.
The LPM.dev Registry MCP server gives an AI editor tools to search packages, read package guidance, install dependencies, and audit projects.
Use lpm mcp to configure the editor and manage the server launcher.
lpm mcp setup [name]
lpm mcp serve
lpm mcp remove <name>
lpm mcp statusQuickstart
Enable MCP in your editor so its configuration file exists. Then run:
lpm mcp setup
lpm mcp statusRestart the editor. Ask its agent to find a package on the LPM.dev Registry or read a package's API documentation.
| Mode | Purpose |
|---|---|
setup [name] | Write the Registry server entry into every supported, existing editor configuration. The default name is lpm-registry. |
serve | Run the managed server over stdio. An MCP client starts this mode automatically. |
remove <name> | Remove the named entry from every supported, existing editor configuration. |
status | List configured server names for each supported editor, including servers from other providers. |
The optional name identifies a server entry. It does not select an editor or a different server package.
There is no lpm.json configuration for this workflow.
Examples
# Use a distinct entry name in each existing editor configuration
lpm mcp setup team-registry
# Inspect configuration from a script
lpm mcp status --json
# Configure or remove an entry without prompts
lpm mcp setup --json
lpm mcp remove team-registry --jsonRepeated setup replaces the named entry. It preserves unrelated servers and other configuration keys.
status reports configuration only. It does not check a live server connection.
Supported editors
| Editor | Platform | Configuration file | Server key |
|---|---|---|---|
| Claude Code | All | ~/.claude.json | mcpServers |
| Cursor | All | ~/.cursor/mcp.json | mcpServers |
| Windsurf | All | ~/.codeium/windsurf/mcp_config.json | mcpServers |
| VS Code | macOS | ~/Library/Application Support/Code/User/mcp.json | servers |
| VS Code | Linux | ~/.config/Code/User/mcp.json | servers |
| Claude Desktop | macOS | ~/Library/Application Support/Claude/claude_desktop_config.json | mcpServers |
setup skips missing files. It does not create editor configuration files or discover other editor locations.
For another MCP client, configure the launcher manually through that client's configuration interface.
Existing files must contain valid JSON and fit within the 16 MiB configuration limit. Setup and removal reject configuration files that are symlinks or directory junctions. Each file update is atomic and preserves existing Unix permission bits. An error in a later file does not undo earlier file updates.
What gets written
Setup records the absolute path of the current LPM CLI executable. The same path selects the CLI for tools that run package commands. For example:
{
"mcpServers": {
"lpm-registry": {
"command": "/absolute/path/to/lpm",
"args": ["mcp", "serve"],
"env": {
"LPM_CLI_PATH": "/absolute/path/to/lpm"
}
}
}
}VS Code uses servers instead of mcpServers.
When you configure another client, use the path from lpm mcp setup --json.
After an installation moves or an upgrade removes that executable path, run setup again.
The saved path prevents a project executable named lpm from replacing the launcher through PATH.
For a manually configured server, LPM_CLI_PATH must contain an absolute executable path for CLI tools.
Without that override, the server searches absolute PATH locations outside its working directory, including native Windows and global npm installations.
Available tools
The server connects to LPM.dev Registry APIs. The LPM CLI itself supports other package registries.
| Task | MCP tools |
|---|---|
| Discover packages | lpm_search, lpm_search_owners, lpm_packages_by_owner |
| Read package information | lpm_package_info, lpm_quality_report, lpm_marketplace_info, lpm_pool_stats |
| Read guidance and source | lpm_api_docs, lpm_llm_context, lpm_package_context, lpm_package_skills, lpm_browse_source |
| Read account or CLI information | lpm_user_info, lpm_docs |
| Change or inspect a project | lpm_add, lpm_install, lpm_audit |
Search accepts natural-language queries or structured filters, including free, private, pool, and marketplace distribution modes.
Results still follow the account's package access.
lpm_add and lpm_install run the corresponding CLI commands and can change project files.
lpm_audit audits the requested project path, or the server's working directory if no path is supplied.
These tools return the full CLI report. A failed command marks the MCP response as an error and retains available findings.
Authentication and security policy for these three tools follow the CLI command. A local audit or an anonymous Free package operation does not require a token solely because it comes through MCP.
Managed runtime
The launcher downloads @lpm-registry/mcp-server@latest and selects the newest release allowed by its security policy.
It resolves the runtime independently of the editor project's lockfile and install overrides.
The default runtime location is ~/.lpm/cache/mcp/runtime, under LPM_HOME when configured.
After 24 hours, a subsequent launch refreshes it. An active server can defer that refresh.
A refresh installs into a restricted staging directory and checks the executable before replacing the active runtime.
A failed refresh preserves the previous installation.
A registry transport outage, retryable HTTP failure, or rate limit can fall back to the last verified runtime. Integrity, policy, firewall, provenance, authentication, and approval failures stop startup instead.
The server uses Node.js from outside the caller's working directory, detected project roots, and node_modules directories.
Interpreter lookup excludes relative paths and project-controlled symlinks.
The server retains the caller's working directory for project tools.
lpm cache path mcp
lpm cache clean mcpCache cleanup refuses while an MCP process uses the runtime.
lpm cache prune --apply waits for the server to stop and retains the registered runtime.
Authentication and custom registries
The launcher downloads the public server package anonymously.
The server uses LPM_TOKEN, or an OS keychain credential from lpm login for the effective Registry URL.
Keychain credentials are scoped to that URL.
lpm_docs always reads the LPM.dev Registry documentation at https://lpm.dev/api/docs. It does not use this CLI documentation site or a custom Registry URL.
The default Registry URL is https://lpm.dev.
For another trusted Registry instance, set LPM_REGISTRY_URL in the editor environment or its MCP server entry.
Setup does not copy your shell's token or Registry override into editor configuration.
The server accepts HTTPS URLs and HTTP loopback URLs. It has no remote HTTP exception equivalent to the CLI's --insecure flag.
An invalid or unsupported server URL falls back to the default Registry URL.
The CLI launcher also applies its own Registry transport checks.
Troubleshooting
| Symptom | Recovery |
|---|---|
| Setup reports a skipped editor | Enable MCP in that editor, then check the configuration path in the table. Run setup again. |
| Setup rejects a configuration file | Correct invalid JSON or excessive size. For a linked file, manage its server entry through the editor or its configuration owner. |
| The editor cannot start the executable | Run setup with the current LPM CLI installation, then restart the editor. |
| No suitable Node.js executable | Install Node.js outside the project and expose it to the editor environment. |
| A protected Registry tool needs authentication | Use lpm login for the effective Registry URL, or supply LPM_TOKEN through the editor environment. |
| Runtime refresh fails | Resolve the reported network, integrity, or policy error. Stop the server before removing its MCP cache. |
serve requires an MCP client over stdio. Direct interactive terminal use and --json are rejected because stdout carries MCP JSON-RPC.
Flags and structured output
There are no MCP-specific flags. Global flags apply where supported.
Invalid subcommands, missing required names, and extra positional arguments return usage exit code 2.
--json emits one document for setup, remove, and status.
Setup includes server, configured, package, package_spec, version_policy, command, args, and env.
Removal reports removed_from. Status reports an editors list.
See also
- AI agent skills — package guidance and standalone skills
- lpm skills — manage agent instructions
- lpm audit — project security reports
- lpm cache — inspect or remove the managed runtime
- Model Context Protocol — protocol documentation