MCP Server
The LPM MCP Server connects AI coding agents to the LPM registry using the Model Context Protocol. It gives tools like Claude Code, Codex, VSCode, Cursor, and other MCP-compatible agents direct access to package info, quality reports, owner and marketplace search, and Pool earnings - all without leaving your editor.
When to Use It
The MCP server is useful when you want your AI coding agent to:
- Look up packages - ask "What does
acme.ui-kitdo and is it compatible with React 19?" and it pulls metadata, AI analysis, compatibility, access model, and readme - Search by intent - ask "Find me a lightweight date formatting library with TypeScript support" and it runs semantic search across all packages
- Filter and browse - ask "Show me MIT-licensed ESM packages in the tools category" or "What Swift packages are in the Pool?" to filter by category, distribution mode, ecosystem, license, and more
- Find people and orgs - ask "Who is
acme?" or "Find organizations related to 'design systems'" to search the registry by name or username - Browse packages by owner - ask "What has the
acmeorg published?" or "Show all public packages fromalice" to list what someone has released - Check quality - ask "Which quality checks is
acme.ui-kitfailing?" and it returns the full 28-check breakdown with suggestions - Browse source code - ask "Show me the source code for
acme.ui-kit" to browse file trees and read individual files or directories - Install packages - ask "Add
acme.ui-kitto my project" and it runs the correct install command (lpm addfor components,lpm installfor dependencies) - View Pool earnings - ask "Which of my packages earned the most from the Pool this month?" for your per-package revenue breakdown
- Check account info - ask "What plan am I on and how many packages can I still publish?" for your user info, orgs, and usage limits
Without the MCP server, your AI agent would have to ask you to run CLI commands and paste the output. With it, the agent calls the registry directly and gets structured data.
Quick Setup
The fastest way to get started - one command configures all your editors:
lpm mcp setup
This detects which AI editors you have installed (Claude Code, Cursor, VS Code, Claude Desktop, Windsurf), shows them as a checklist, and writes the correct config to each one. If you're not logged in yet, it'll offer to log you in first.
No separate install step needed - the MCP server downloads automatically via non-interactive npx -y when your editor starts.
Options:
lpm mcp setup # Configure globally (all projects)
lpm mcp setup --project # Configure for current project only
lpm mcp status # See where it's currently configured
lpm mcp status --verbose # Show command/args diagnostics per editor
lpm mcp remove # Remove from all editors
Manual Setup
If you prefer to configure editors individually, add the following to each editor's MCP config. No token needed in the config - the server reads your lpm login token from the OS keychain automatically.
Claude Code
Add to your project's .mcp.json or global ~/.claude.json:
{
"mcpServers": {
"lpm-registry": {
"command": "npx",
"args": ["-y", "@lpm-registry/mcp-server@latest"]
}
}
}
Or use the Claude Code CLI:
claude mcp add --transport stdio lpm-registry -- npx -y @lpm-registry/mcp-server@latest
Cursor
Add to .cursor/mcp.json in your project or ~/.cursor/mcp.json globally:
{
"mcpServers": {
"lpm-registry": {
"command": "npx",
"args": ["-y", "@lpm-registry/mcp-server@latest"]
}
}
}
GitHub Copilot (VS Code)
Add to .vscode/mcp.json in your project:
{
"servers": {
"lpm-registry": {
"command": "npx",
"args": ["-y", "@lpm-registry/mcp-server@latest"]
}
}
}
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"lpm-registry": {
"command": "npx",
"args": ["-y", "@lpm-registry/mcp-server@latest"]
}
}
}
After adding, restart your editor or start a new session.
Authentication
The MCP server reads your token from the OS keychain - the same token stored by lpm login. No need to put tokens in config files.
lpm login # stores token in OS keychain (one time)
lpm mcp setup # writes config, server reads token from keychain at runtime
If you haven't run lpm login, public tools (search, package info, quality reports) still work. Authenticated tools (name checks, Pool earnings, user info) require a token.
Alternative: You can set LPM_TOKEN as an environment variable in your MCP config for environments where keychain isn't available (CI, containers):
{
"mcpServers": {
"lpm-registry": {
"command": "npx",
"args": ["-y", "@lpm-registry/mcp-server@latest"],
"env": {
"LPM_TOKEN": "lpm_your_token_here"
}
}
}
}
Generate a token at Dashboard > Settings > Tokens.
Available Tools
| Tool | Description | Auth |
|---|---|---|
lpm_search | Search packages using natural language or structured filters (category, distribution, ecosystem, license, and more) | Optional |
lpm_package_info | Get package metadata, AI analysis, access model, compatibility, and readme | Optional |
lpm_api_docs | Get structured API docs - functions, classes, types, signatures | Optional |
lpm_llm_context | Get LLM-optimized usage guide - quickStart, patterns, gotchas | Optional |
lpm_package_context | Get complete package context in one call - metadata, API docs, usage guide, and skills | Optional |
lpm_package_skills | Get Agent Skills that teach AI assistants how to use the package | Optional |
lpm_browse_source | Browse package source code - file tree and file contents | Required |
lpm_add | Add a package by extracting source files into the project | Required |
lpm_install | Install a package as a dependency to node_modules | Required |
lpm_get_install_command | Get the correct CLI command (lpm add vs lpm install) | Optional |
lpm_quality_report | Get quality score and 28-check breakdown | Optional |
lpm_search_owners | Search for users or organizations by name | No |
lpm_packages_by_owner | List packages published by a specific user or org | No |
lpm_pool_stats | Get your Pool revenue earnings for the current month | Required |
lpm_user_info | Get your user info, orgs, plan, and usage | Required |
Version resolution from local project: All version-sensitive tools (lpm_api_docs, lpm_llm_context, lpm_package_context, lpm_package_skills) resolve the version from the local project's package.json when not explicitly specified, falling back to the latest version if no local dependency is found.
lpm_package_info
Get package metadata including versions, downloads, AI-generated analysis, compatibility data, access model, and readme. The response tells your AI agent everything it needs to evaluate a package - what it does, how to use it, whether it's compatible, and how to get access.
Parameters:
name(required) - package name inowner.package-nameor@lpm.dev/owner.package-nameformat
Example prompts:
- "Tell me about
acme.ui-kit" - "What does
acme.form-validatordo and is it compatible with React?" - "Show me the quick-start code for
acme.date-utils" - "How do I get access to
acme.premium-grid?"
Access model in response:
Every package includes distribution and access information:
{
"distributionMode": "pool",
"accessInfo": {
"model": "pool",
"summary": "Included with Pool subscription ($12/mo)",
"actionRequired": false
}
}
The three distribution modes:
- private - only the owner/org members can access
- pool - included with a Pool subscription ($12/mo), like npm for subscribers
- marketplace - requires a separate license purchase per package
AI metadata in response:
When AI analysis is available, the response includes:
{
"ai": {
"description": "Type-safe form validation with Zod schemas and React hook integration",
"capabilities": "Form validation. Schema-based validation. React hook integration",
"tags": ["validation", "forms", "react", "zod", "typescript"],
"bestFor": "React apps that need schema-driven form validation with TypeScript support",
"notFor": "Server-side data validation without React — use Zod directly instead",
"quickStart": "import { useFormValidation } from '@lpm.dev/acme.form-validator'\nconst { errors, validate } = useFormValidation(mySchema)",
"compatibility": {
"hasTypes": true,
"moduleType": "esm",
"treeShakeable": true,
"frameworks": ["react"],
"runtime": ["node", "browser"],
"minNodeVersion": "18"
},
"qualityScore": 87
}
}
This metadata is generated automatically when a package is published. See AI Metadata for details.
lpm_api_docs
Get structured API documentation for a package - functions, classes, interfaces, type aliases, enums, and variables with full signatures, parameter types, return types, and descriptions. Auto-generated from TypeScript definitions, JSDoc annotations, or AI source analysis during publish.
Parameters:
name(required) - package name inowner.package-nameor@lpm.dev/owner.package-nameformatversion(optional) - specific version (defaults to latest)
Example prompts:
- "Show me the API for
acme.ui-kit" - "What functions does
acme.validateexport?" - "Get the type signatures for
acme.date-utils"
lpm_llm_context
Get an LLM-optimized usage guide for a package - purpose, quick-start code, key exports with signatures, common usage patterns, gotchas, and guidance on when to use or avoid the package. Auto-generated during publish from the package's API docs, README, and source code.
Parameters:
name(required) - package name inowner.package-nameor@lpm.dev/owner.package-nameformatversion(optional) - specific version (defaults to latest)
Example prompts:
- "How do I use
acme.form-validator?" - "What are the common patterns for
acme.ui-kit?" - "What gotchas should I know about
acme.date-utils?"
lpm_package_context
Get complete context for a package in a single call. Combines condensed package metadata (name, version, description, install method, dependencies), structured API docs, LLM usage guide, and Agent Skills. This is the recommended tool when you need to understand a package before using it.
If API docs, LLM context, or skills aren't available yet (still being generated), they're omitted from the response. The readme is truncated - use lpm_package_info for the full readme.
Parameters:
name(required) - package name inowner.package-nameor@lpm.dev/owner.package-nameformatversion(optional) - specific version (defaults to latest)
Example prompts:
- "Tell me everything about
acme.ui-kit" - "I need to understand
acme.validatebefore installing it" - "What is
acme.date-utilsand how do I use it?"
lpm_package_skills
Fetch Agent Skills for a package. Skills are markdown files that teach AI coding assistants how to use a package effectively.
Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
| name | string | Yes | Package name (e.g., "owner.package-name") |
| version | string | No | Specific version. If omitted, resolves from local package.json or uses latest |
Returns: Array of approved skill objects with name, description, globs, and content.
lpm_search
Search LPM packages using natural language or structured filters. For natural language queries, it uses hybrid keyword + semantic search that understands intent - searching for "validate user input" finds form validation libraries even if they don't use the word "validate" in their name. When structured filters are provided (category, distribution mode, etc.), it uses filtered search with full faceting support.
Parameters:
query(optional) - natural language search query (required unlesscategoryis provided)category(optional) - package category filter (e.g.,ui-components,tools)ecosystem(optional) - filter by ecosystem:js,swift, orxcframeworkdistribution(optional) - filter by distribution mode:marketplace,pool, orprivatepackageType(optional) - filter by type:package,source,mcp-server,vscode-extension,cursor-rules,github-action,xcframework,othersort(optional) - sort order:newest,popular, ornamehasTypes(optional) - filter to packages with TypeScript type definitionsmoduleType(optional) - filter by module type:esm,cjs, orduallicense(optional) - filter by license:MIT,Apache-2.0,ISC,GPL-3.0,BSD-3-Clause,UnlicenseminNodeVersion(optional) - filter to packages supporting Node.js18,20, or22+limit(optional) - max results, 1-50 (default 10)
At least one of query or category is required.
Example prompts:
- "Find a lightweight date formatting library" (semantic search)
- "What packages are there for building CLI tools?" (semantic search)
- "Show me MIT-licensed ESM packages" (filtered search)
- "Find Swift packages in the Pool" (filtered by ecosystem + distribution)
- "What UI component packages are on the marketplace?" (filtered by category + distribution)
- "Search my private packages" (filtered by distribution=private, requires auth)
lpm_quality_report
Get the quality score and detailed check breakdown for a package. Covers 28 checks across documentation, code quality, testing, and maintenance.
Parameters:
name(required) - package name inowner.package-nameformat
Example prompts:
- "What's the quality score for
acme.ui-kit?" - "How can I improve my package's quality score?"
- "Which quality checks is
acme.utilsfailing?"
lpm_search_owners
Search for users or organizations on the LPM registry by name or username.
Parameters:
query(required) - name or username to search forlimit(optional) - max results, 1-10
Example prompts:
- "Who is
acme?" - "Find organizations related to 'design'"
- "Search for user
alice"
lpm_packages_by_owner
List packages published by a specific user or organization. Shows only public (pool/marketplace) packages with their distribution mode.
Parameters:
owner(required) - username or organization sluglimit(optional) - max results, 1-50
Example prompts:
- "Show packages by
alice" - "What has the
acmeorganization published?" - "List all packages from
lpm-dev"
lpm_browse_source
Browse source code of a package you have access to. Call without path to get the file tree, then request specific files or directories with path. Prefer fetching directory paths (e.g., src) to get all files under that directory in a single request.
Parameters:
name(required) - package name inowner.package-nameor@lpm.dev/owner.package-nameformatversion(optional) - specific version to browse (defaults to latest)path(optional) - file or directory path (e.g.,src/index.jsorsrc). Omit for tree only.
Example prompts:
- "Show me the source code for
acme.ui-kit" - "What files are in
acme.form-validator?" - "Show me the src directory of
acme.date-utils"
lpm_add
Add a package to your project by extracting source files for customization. Use for UI components, blocks, templates, Swift packages, and MCP servers. Requires LPM CLI installed.
Parameters:
name(required) - package nameversion(optional) - specific version (defaults to latest)path(optional) - target directory (e.g.,src/components/ui)force(optional) - overwrite existing files
Example prompts:
- "Add
acme.ui-kitto my project" - "Install
acme.buttoninto src/components"
lpm_install
Install a package as a dependency to node_modules (like npm install). Use for JS libraries, utilities, and SDKs. Requires LPM CLI installed.
Parameters:
name(required) - package nameversion(optional) - specific version (defaults to latest)
Example prompts:
- "Install
acme.validateas a dependency" - "Add
acme.date-utilsto my node_modules"
lpm_get_install_command
Get the correct CLI command to install a package. Returns lpm add (source extraction for components) or lpm install (node_modules for libraries) based on the package type.
Parameters:
name(required) - package nameversion(optional) - specific version
lpm_pool_stats
Get your Pool earnings estimate for the current billing period. Shows per-package breakdown with install counts, weighted downloads, share percentage, and estimated earnings.
Example prompts:
- "How are my Pool earnings this month?"
- "Which of my packages earns the most from the Pool?"
- "Show my Pool revenue breakdown"
lpm_user_info
Get information about the authenticated user including organizations, plan tier, pool access, and usage limits.
Example prompts:
- "What plan am I on?"
- "Show my organizations and usage"
Caching
Responses are cached in memory to reduce API calls and speed up repeated questions:
| Tool | Cache Duration |
|---|---|
lpm_search | 5 minutes |
lpm_package_info | 5 minutes |
lpm_api_docs | 5 minutes |
lpm_llm_context | 5 minutes |
lpm_package_context | 5 minutes |
lpm_package_skills | 5 minutes |
lpm_browse_source | 5 minutes |
lpm_get_install_command | 5 minutes |
lpm_quality_report | 5 minutes |
lpm_search_owners | 5 minutes |
lpm_packages_by_owner | 5 minutes |
lpm_user_info | 5 minutes |
lpm_pool_stats | 1 hour |
lpm_add | No cache |
lpm_install | No cache |
Cache resets when the MCP server restarts (e.g., when you start a new coding session).
Troubleshooting
"No LPM token found"
Set the LPM_TOKEN environment variable in your MCP client config, or run lpm login first.
"Authentication failed"
Your token may be expired or revoked. Generate a new one at Dashboard > Settings > Tokens or run lpm login.
"Cannot reach lpm.dev" Check your internet connection. If you're behind a proxy, ensure it allows HTTPS connections to lpm.dev.
"Package not found"
Verify the package name format: owner.package-name (e.g., alice.ui-kit).
"Rate limit exceeded" Source browsing is rate limited to 30 requests per minute. Wait and retry.
MCP server not appearing in your agent Make sure you've restarted your editor or started a new session after adding the config. In Claude Code, click the + button to start a new session.