@lpm-registry/mcp-server 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +687 -0
- package/bin/mcp-server.js +11 -0
- package/lib/api.js +145 -0
- package/lib/auth.js +42 -0
- package/lib/cache.js +73 -0
- package/lib/cli.js +99 -0
- package/lib/constants.js +35 -0
- package/lib/format.js +67 -0
- package/lib/resolve-version.js +49 -0
- package/lib/server.js +357 -0
- package/lib/tools/add.js +79 -0
- package/lib/tools/api-docs.js +78 -0
- package/lib/tools/browse-source.js +111 -0
- package/lib/tools/get-install-command.js +73 -0
- package/lib/tools/install.js +51 -0
- package/lib/tools/llm-context.js +78 -0
- package/lib/tools/package-context.js +168 -0
- package/lib/tools/package-info.js +156 -0
- package/lib/tools/package-skills.js +100 -0
- package/lib/tools/packages-by-owner.js +66 -0
- package/lib/tools/pool-stats.js +38 -0
- package/lib/tools/quality-report.js +50 -0
- package/lib/tools/search-owners.js +58 -0
- package/lib/tools/search.js +232 -0
- package/lib/tools/user-info.js +38 -0
- package/package.json +52 -0
package/README.md
ADDED
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
# @lpm-registry/mcp-server
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for the [LPM](https://lpm.dev) package registry. Gives AI tools like Claude Code, Cursor, and other MCP-compatible agents access to search, browse source code, install packages, check quality, and more.
|
|
4
|
+
|
|
5
|
+
## Quick Setup
|
|
6
|
+
|
|
7
|
+
If you have the [LPM CLI](https://lpm.dev/docs/cli) installed, one command configures all your editors:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
lpm mcp setup
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This auto-detects Claude Code, Cursor, VS Code, Claude Desktop, and Windsurf, then writes the correct config to each. Authentication is handled via `lpm login` (stored in your OS keychain) — no tokens in config files.
|
|
14
|
+
|
|
15
|
+
If your CLI is configured to use a custom registry URL (for example local dev), `lpm mcp setup` automatically writes `LPM_REGISTRY_URL` into MCP config so editor-launched MCP processes hit the same registry.
|
|
16
|
+
|
|
17
|
+
## Manual Setup
|
|
18
|
+
|
|
19
|
+
If you prefer manual configuration, add to your editor's MCP config:
|
|
20
|
+
|
|
21
|
+
### Claude Code
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"mcpServers": {
|
|
26
|
+
"lpm-registry": {
|
|
27
|
+
"command": "npx",
|
|
28
|
+
"args": ["-y", "@lpm-registry/mcp-server@latest"]
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Cursor (`.cursor/mcp.json`)
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"mcpServers": {
|
|
39
|
+
"lpm-registry": {
|
|
40
|
+
"command": "npx",
|
|
41
|
+
"args": ["-y", "@lpm-registry/mcp-server@latest"]
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### VS Code (`.vscode/mcp.json`)
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"servers": {
|
|
52
|
+
"lpm-registry": {
|
|
53
|
+
"command": "npx",
|
|
54
|
+
"args": ["-y", "@lpm-registry/mcp-server@latest"]
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Claude Desktop (`claude_desktop_config.json`)
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"lpm-registry": {
|
|
66
|
+
"command": "npx",
|
|
67
|
+
"args": ["-y", "@lpm-registry/mcp-server@latest"]
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Authentication
|
|
74
|
+
|
|
75
|
+
The server reads your token from the OS keychain (set by `lpm login`). No token in config files required.
|
|
76
|
+
|
|
77
|
+
Alternatively, set the `LPM_TOKEN` environment variable for environments without keychain access:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
export LPM_TOKEN=lpm_your_token_here
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Registry URL
|
|
84
|
+
|
|
85
|
+
Defaults to `https://lpm.dev`. Override with:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
export LPM_REGISTRY_URL=https://your-registry.dev
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
For local development, copy `.env.example` to `.env.local` and set your local registry URL. These files are gitignored.
|
|
92
|
+
|
|
93
|
+
## Available Tools
|
|
94
|
+
|
|
95
|
+
| Tool | Description | Auth Required |
|
|
96
|
+
| ------------------------- | --------------------------------------------------------------- | ------------- |
|
|
97
|
+
| `lpm_search` | Search packages with natural language or structured filters | Optional |
|
|
98
|
+
| `lpm_package_info` | Get package metadata, install method, access model, and readme | Optional |
|
|
99
|
+
| `lpm_api_docs` | Get structured API docs — functions, classes, types, signatures | Optional |
|
|
100
|
+
| `lpm_llm_context` | Get LLM-optimized usage guide — quickStart, patterns, gotchas | Optional |
|
|
101
|
+
| `lpm_package_context` | Get complete package context in one call — metadata, API docs, and usage guide | Optional |
|
|
102
|
+
| `lpm_browse_source` | Browse package source code — file tree and file contents | Yes |
|
|
103
|
+
| `lpm_add` | Add a package by extracting source files into the project | Yes |
|
|
104
|
+
| `lpm_install` | Install a package as a dependency to node_modules | Yes |
|
|
105
|
+
| `lpm_get_install_command` | Get the correct CLI command (`lpm add` vs `lpm install`) | Optional |
|
|
106
|
+
| `lpm_quality_report` | Get quality score and 28-check breakdown | Optional |
|
|
107
|
+
| `lpm_search_owners` | Search for users or organizations by name | No |
|
|
108
|
+
| `lpm_packages_by_owner` | List packages published by a specific user or org | No |
|
|
109
|
+
| `lpm_package_skills` | Fetch Agent Skills for a package | Optional |
|
|
110
|
+
| `lpm_pool_stats` | Get your Pool revenue earnings for the current month | Yes |
|
|
111
|
+
| `lpm_user_info` | Get authenticated user info, orgs, and usage | Yes |
|
|
112
|
+
|
|
113
|
+
## AI Workflow
|
|
114
|
+
|
|
115
|
+
A typical AI agent workflow for finding and adding a package:
|
|
116
|
+
|
|
117
|
+
1. **Search** — `lpm_search` to find packages matching the need
|
|
118
|
+
2. **Understand** — `lpm_package_context` to get everything in one call: metadata, API docs, and usage guide
|
|
119
|
+
3. **Browse** — `lpm_browse_source` (tree first, then specific files) for deeper code understanding if needed
|
|
120
|
+
4. **Install** — `lpm_add` for components/blocks/Swift or `lpm_install` for dependencies
|
|
121
|
+
|
|
122
|
+
The `lpm_package_context` response includes `package.installMethod.command` (`lpm add` or `lpm install`) so agents know which tool to use.
|
|
123
|
+
|
|
124
|
+
> **Tip:** Use `lpm_package_context` as the default. Fall back to individual tools (`lpm_package_info`, `lpm_api_docs`, `lpm_llm_context`) only when you need the full readme or want to re-check a single aspect.
|
|
125
|
+
|
|
126
|
+
> **Version resolution:** Version-sensitive tools (`lpm_api_docs`, `lpm_llm_context`, `lpm_package_context`, `lpm_package_skills`, `lpm_browse_source`) resolve the version from the local project's package.json dependencies when no explicit version is specified. This ensures you get docs matching the version you actually have installed.
|
|
127
|
+
|
|
128
|
+
### Access Control
|
|
129
|
+
|
|
130
|
+
- **Pool packages** require a Pool subscription ($12/mo). Without one, `lpm_browse_source`, `lpm_add`, and `lpm_install` return an error with subscription info.
|
|
131
|
+
- **Marketplace packages** require a license purchase. Errors include a link to the package page.
|
|
132
|
+
- **Public metadata** (`lpm_package_info`, `lpm_search`, `lpm_quality_report`) works without auth for public packages.
|
|
133
|
+
|
|
134
|
+
## Tool Details
|
|
135
|
+
|
|
136
|
+
### lpm_search
|
|
137
|
+
|
|
138
|
+
Search LPM packages using natural language or structured filters. Uses hybrid semantic search for natural language queries, and the explore API when structured filters are active.
|
|
139
|
+
|
|
140
|
+
**Parameters:**
|
|
141
|
+
|
|
142
|
+
- `query` (string, optional) — Natural language search query (required unless `category` is provided)
|
|
143
|
+
- `category` (string, optional) — Package category filter (e.g., `ui-components`, `tools`)
|
|
144
|
+
- `ecosystem` (enum, optional) — Filter by ecosystem: `js`, `swift`, or `xcframework`
|
|
145
|
+
- `distribution` (enum, optional) — Filter by distribution mode: `marketplace`, `pool`, or `private`
|
|
146
|
+
- `packageType` (enum, optional) — Filter by type: `package`, `source`, `mcp-server`, `vscode-extension`, `cursor-rules`, `github-action`, `xcframework`, `other`
|
|
147
|
+
- `sort` (enum, optional) — Sort order: `newest`, `popular`, or `name`
|
|
148
|
+
- `hasTypes` (boolean, optional) — Filter to packages with TypeScript type definitions
|
|
149
|
+
- `moduleType` (enum, optional) — Filter by module type: `esm`, `cjs`, or `dual`
|
|
150
|
+
- `license` (enum, optional) — Filter by license: `MIT`, `Apache-2.0`, `ISC`, `GPL-3.0`, `BSD-3-Clause`, `Unlicense`
|
|
151
|
+
- `minNodeVersion` (enum, optional) — Filter to packages supporting Node.js `18`, `20`, or `22`+
|
|
152
|
+
- `limit` (number, optional) — Max results, 1-50 (default: 10)
|
|
153
|
+
|
|
154
|
+
At least one of `query` or `category` is required.
|
|
155
|
+
|
|
156
|
+
**Example response:**
|
|
157
|
+
|
|
158
|
+
```
|
|
159
|
+
Found 2 packages:
|
|
160
|
+
|
|
161
|
+
- alice.ui-kit [source] (pool) — React UI components (5,000 downloads)
|
|
162
|
+
Quality: 88 | Category: ui-components | Tags: react, components
|
|
163
|
+
- bob.form-builder (marketplace) — Form builder library (1,200 downloads)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### lpm_package_info
|
|
167
|
+
|
|
168
|
+
Get metadata for an LPM package including versions, description, downloads, install method, access status, and readme.
|
|
169
|
+
|
|
170
|
+
**Parameters:**
|
|
171
|
+
|
|
172
|
+
- `name` (string, required) — Package name in `owner.package-name` or `@lpm.dev/owner.package-name` format
|
|
173
|
+
|
|
174
|
+
**Example response:**
|
|
175
|
+
|
|
176
|
+
```json
|
|
177
|
+
{
|
|
178
|
+
"name": "@lpm.dev/alice.ui-kit",
|
|
179
|
+
"description": "A modern UI component kit for React",
|
|
180
|
+
"ecosystem": "js",
|
|
181
|
+
"latestVersion": "2.1.0",
|
|
182
|
+
"totalVersions": 12,
|
|
183
|
+
"versions": ["2.1.0", "2.0.0", "1.9.0"],
|
|
184
|
+
"downloads": 5400,
|
|
185
|
+
"createdAt": "2024-01-15T10:30:00Z",
|
|
186
|
+
"updatedAt": "2025-11-20T14:00:00Z",
|
|
187
|
+
"dependencies": ["react", "react-dom"],
|
|
188
|
+
"readme": "# UI Kit\n\nA modern component library...",
|
|
189
|
+
"distributionMode": "pool",
|
|
190
|
+
"hasAccess": true,
|
|
191
|
+
"installMethod": {
|
|
192
|
+
"command": "lpm add",
|
|
193
|
+
"description": "Extracts source files into your project for customization."
|
|
194
|
+
},
|
|
195
|
+
"accessInfo": {
|
|
196
|
+
"model": "pool",
|
|
197
|
+
"summary": "Included with Pool subscription ($12/mo)",
|
|
198
|
+
"actionRequired": false
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### lpm_api_docs
|
|
204
|
+
|
|
205
|
+
Get structured API documentation for an LPM package. Returns functions, classes, interfaces, type aliases, enums, and variables with full signatures, parameter types, return types, and descriptions. Use this to understand how to use a package before installing it.
|
|
206
|
+
|
|
207
|
+
API docs are auto-generated during publish from TypeScript definitions, AI analysis, or JSDoc annotations.
|
|
208
|
+
|
|
209
|
+
**Parameters:**
|
|
210
|
+
|
|
211
|
+
- `name` (string, required) — Package name in `owner.package-name` or `@lpm.dev/owner.package-name` format
|
|
212
|
+
- `version` (string, optional) — Specific version to get docs for (defaults to latest)
|
|
213
|
+
|
|
214
|
+
**Example response:**
|
|
215
|
+
|
|
216
|
+
```json
|
|
217
|
+
{
|
|
218
|
+
"name": "@lpm.dev/alice.ui-kit",
|
|
219
|
+
"version": "2.1.0",
|
|
220
|
+
"available": true,
|
|
221
|
+
"docsStatus": "extracted",
|
|
222
|
+
"apiDocs": {
|
|
223
|
+
"version": 1,
|
|
224
|
+
"strategy": "typescript",
|
|
225
|
+
"entryPoint": "dist/index.d.ts",
|
|
226
|
+
"modules": [
|
|
227
|
+
{
|
|
228
|
+
"path": "index",
|
|
229
|
+
"functions": [
|
|
230
|
+
{
|
|
231
|
+
"name": "createTheme",
|
|
232
|
+
"description": "Create a custom theme configuration",
|
|
233
|
+
"signatures": [
|
|
234
|
+
{
|
|
235
|
+
"params": [
|
|
236
|
+
{ "name": "options", "type": "ThemeOptions", "optional": true }
|
|
237
|
+
],
|
|
238
|
+
"returnType": "Theme",
|
|
239
|
+
"typeParams": []
|
|
240
|
+
}
|
|
241
|
+
]
|
|
242
|
+
}
|
|
243
|
+
],
|
|
244
|
+
"interfaces": [
|
|
245
|
+
{
|
|
246
|
+
"name": "ThemeOptions",
|
|
247
|
+
"description": "Configuration for theme creation",
|
|
248
|
+
"properties": [
|
|
249
|
+
{ "name": "colors", "type": "ColorPalette", "optional": true },
|
|
250
|
+
{ "name": "spacing", "type": "SpacingScale", "optional": true }
|
|
251
|
+
]
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"classes": [],
|
|
255
|
+
"typeAliases": [],
|
|
256
|
+
"enums": [],
|
|
257
|
+
"variables": []
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"stats": {
|
|
261
|
+
"functionCount": 5,
|
|
262
|
+
"classCount": 2,
|
|
263
|
+
"interfaceCount": 8,
|
|
264
|
+
"totalExports": 18
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
**When docs aren't available:**
|
|
271
|
+
|
|
272
|
+
```json
|
|
273
|
+
{
|
|
274
|
+
"name": "@lpm.dev/bob.utils",
|
|
275
|
+
"version": "1.0.0",
|
|
276
|
+
"available": false,
|
|
277
|
+
"docsStatus": "pending",
|
|
278
|
+
"message": "API docs are being generated. Try again in a few minutes."
|
|
279
|
+
}
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
### lpm_llm_context
|
|
283
|
+
|
|
284
|
+
Get an LLM-optimized usage guide for an LPM package. Returns a concise cheat sheet with purpose, quickStart code, key exports with signatures, common usage patterns, gotchas, and guidance on when to use the package. Use this to quickly understand how to write correct code with a package.
|
|
285
|
+
|
|
286
|
+
LLM context is auto-generated during publish using AI analysis of the package's API docs, source code, and readme.
|
|
287
|
+
|
|
288
|
+
**Parameters:**
|
|
289
|
+
|
|
290
|
+
- `name` (string, required) — Package name in `owner.package-name` or `@lpm.dev/owner.package-name` format
|
|
291
|
+
- `version` (string, optional) — Specific version to get context for (defaults to latest)
|
|
292
|
+
|
|
293
|
+
**Example response:**
|
|
294
|
+
|
|
295
|
+
```json
|
|
296
|
+
{
|
|
297
|
+
"name": "@lpm.dev/alice.ui-kit",
|
|
298
|
+
"version": "2.1.0",
|
|
299
|
+
"available": true,
|
|
300
|
+
"llmContextStatus": "extracted",
|
|
301
|
+
"llmContext": {
|
|
302
|
+
"version": 1,
|
|
303
|
+
"purpose": "React UI component library with theme support and accessibility built-in",
|
|
304
|
+
"quickStart": "import { Button, Input } from '@lpm.dev/alice.ui-kit'\n\n<Button variant=\"primary\">Click me</Button>",
|
|
305
|
+
"keyExports": [
|
|
306
|
+
{
|
|
307
|
+
"name": "Button",
|
|
308
|
+
"kind": "component",
|
|
309
|
+
"signature": "(props: ButtonProps) => JSX.Element",
|
|
310
|
+
"description": "Primary button component with variants and loading state"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
"name": "createTheme",
|
|
314
|
+
"kind": "function",
|
|
315
|
+
"signature": "(options?: ThemeOptions) => Theme",
|
|
316
|
+
"description": "Create a custom theme configuration"
|
|
317
|
+
}
|
|
318
|
+
],
|
|
319
|
+
"commonPatterns": [
|
|
320
|
+
{
|
|
321
|
+
"title": "Basic button with loading state",
|
|
322
|
+
"code": "<Button isLoading={isPending} onClick={handleSubmit}>Save</Button>",
|
|
323
|
+
"description": "Use isLoading prop to show spinner during async operations"
|
|
324
|
+
}
|
|
325
|
+
],
|
|
326
|
+
"gotchas": [
|
|
327
|
+
"Requires React 18+ as peer dependency",
|
|
328
|
+
"Theme must be wrapped in ThemeProvider at app root"
|
|
329
|
+
],
|
|
330
|
+
"whenToUse": "Building React apps that need consistent, accessible UI components with theme support",
|
|
331
|
+
"whenNotToUse": "Server-rendered pages without React, or when you need only a single component"
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
**When context isn't available:**
|
|
337
|
+
|
|
338
|
+
```json
|
|
339
|
+
{
|
|
340
|
+
"name": "@lpm.dev/bob.utils",
|
|
341
|
+
"version": "1.0.0",
|
|
342
|
+
"available": false,
|
|
343
|
+
"llmContextStatus": "pending",
|
|
344
|
+
"message": "LLM context is being generated. Try again in a few minutes."
|
|
345
|
+
}
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
### lpm_package_context
|
|
349
|
+
|
|
350
|
+
Get complete context for an LPM package in a single call. Combines condensed package metadata, structured API documentation, LLM-optimized usage guide, and Agent Skills. This is the recommended tool when you need to understand a package before using it.
|
|
351
|
+
|
|
352
|
+
Internally makes 4 parallel API calls. If API docs or LLM context aren't available yet (still being generated), they are omitted from the response. Only fails if the package itself is not found or inaccessible.
|
|
353
|
+
|
|
354
|
+
**Parameters:**
|
|
355
|
+
|
|
356
|
+
- `name` (string, required) — Package name in `owner.package-name` or `@lpm.dev/owner.package-name` format
|
|
357
|
+
- `version` (string, optional) — Specific version to get context for (defaults to latest)
|
|
358
|
+
|
|
359
|
+
**Example response (all available):**
|
|
360
|
+
|
|
361
|
+
```json
|
|
362
|
+
{
|
|
363
|
+
"package": {
|
|
364
|
+
"name": "@lpm.dev/alice.ui-kit",
|
|
365
|
+
"description": "A modern UI component kit for React",
|
|
366
|
+
"ecosystem": "js",
|
|
367
|
+
"latestVersion": "2.1.0",
|
|
368
|
+
"license": "MIT",
|
|
369
|
+
"dependencies": ["react", "react-dom"],
|
|
370
|
+
"peerDependencies": [],
|
|
371
|
+
"installMethod": {
|
|
372
|
+
"command": "lpm add",
|
|
373
|
+
"description": "Extracts source files into your project for customization"
|
|
374
|
+
},
|
|
375
|
+
"distributionMode": "pool",
|
|
376
|
+
"readme": "# UI Kit\n\nA modern component library for building..."
|
|
377
|
+
},
|
|
378
|
+
"apiDocs": {
|
|
379
|
+
"version": 1,
|
|
380
|
+
"strategy": "typescript",
|
|
381
|
+
"modules": [
|
|
382
|
+
{
|
|
383
|
+
"path": "index",
|
|
384
|
+
"functions": [{ "name": "createTheme", "description": "Create a custom theme" }]
|
|
385
|
+
}
|
|
386
|
+
]
|
|
387
|
+
},
|
|
388
|
+
"llmContext": {
|
|
389
|
+
"version": 1,
|
|
390
|
+
"purpose": "React UI component library with theme support",
|
|
391
|
+
"quickStart": "import { Button } from '@lpm.dev/alice.ui-kit'",
|
|
392
|
+
"keyExports": [{ "name": "Button", "kind": "component" }],
|
|
393
|
+
"commonPatterns": [],
|
|
394
|
+
"gotchas": ["Requires React 18+"],
|
|
395
|
+
"whenToUse": "Building React apps with consistent UI"
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
When API docs, LLM context, or skills aren't available, those keys are simply omitted. Only the `package` key is always present. The readme is truncated to ~500 characters — use `lpm_package_info` for the full readme.
|
|
401
|
+
|
|
402
|
+
### lpm_package_skills
|
|
403
|
+
|
|
404
|
+
Fetch Agent Skills for an LPM package. Returns approved skills with their name, description, applicable file globs, and content. Skills are markdown files that provide workflow-specific instructions for AI coding assistants.
|
|
405
|
+
|
|
406
|
+
**Parameters:**
|
|
407
|
+
|
|
408
|
+
- `name` (string, required) — Package name in `owner.package-name` or `@lpm.dev/owner.package-name` format
|
|
409
|
+
- `version` (string, optional) — Specific version to get skills for (defaults to latest)
|
|
410
|
+
|
|
411
|
+
**Example response:**
|
|
412
|
+
|
|
413
|
+
```json
|
|
414
|
+
{
|
|
415
|
+
"name": "@lpm.dev/alice.ui-kit",
|
|
416
|
+
"version": "2.1.0",
|
|
417
|
+
"skills": [
|
|
418
|
+
{
|
|
419
|
+
"name": "theming",
|
|
420
|
+
"description": "How to create and apply custom themes",
|
|
421
|
+
"globs": ["**/*.theme.*", "**/*.styles.*"],
|
|
422
|
+
"content": "# Theming\n\nWhen creating a custom theme..."
|
|
423
|
+
}
|
|
424
|
+
]
|
|
425
|
+
}
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### lpm_browse_source
|
|
429
|
+
|
|
430
|
+
Browse source code of an LPM package you have access to. Call without `path` to get the file tree, then request specific files or directories.
|
|
431
|
+
|
|
432
|
+
**Parameters:**
|
|
433
|
+
|
|
434
|
+
- `name` (string, required) — Package name in `owner.package-name` or `@lpm.dev/owner.package-name` format
|
|
435
|
+
- `version` (string, optional) — Specific version to browse (defaults to latest)
|
|
436
|
+
- `path` (string, optional) — File or directory path (e.g., `src/index.js` or `src`). Omit for tree only.
|
|
437
|
+
|
|
438
|
+
**Example response (tree only):**
|
|
439
|
+
|
|
440
|
+
```json
|
|
441
|
+
{
|
|
442
|
+
"package": "alice.ui-kit",
|
|
443
|
+
"version": "2.0.0",
|
|
444
|
+
"ecosystem": "js",
|
|
445
|
+
"tree": ["src/index.js", "src/button.jsx", "src/input.jsx", "package.json"]
|
|
446
|
+
}
|
|
447
|
+
```
|
|
448
|
+
|
|
449
|
+
**Example response (with path):**
|
|
450
|
+
|
|
451
|
+
```json
|
|
452
|
+
{
|
|
453
|
+
"package": "alice.ui-kit",
|
|
454
|
+
"version": "2.0.0",
|
|
455
|
+
"ecosystem": "js",
|
|
456
|
+
"tree": ["src/index.js", "src/button.jsx", "src/input.jsx", "package.json"],
|
|
457
|
+
"files": [
|
|
458
|
+
{ "path": "src/button.jsx", "content": "export function Button() { ... }" }
|
|
459
|
+
]
|
|
460
|
+
}
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
### lpm_add
|
|
464
|
+
|
|
465
|
+
Add an LPM package to the project by extracting source files for customization. Use for UI components, blocks, templates, Swift packages, and MCP servers. Requires LPM CLI installed locally.
|
|
466
|
+
|
|
467
|
+
**Parameters:**
|
|
468
|
+
|
|
469
|
+
- `name` (string, required) — Package name
|
|
470
|
+
- `version` (string, optional) — Specific version (defaults to latest)
|
|
471
|
+
- `path` (string, optional) — Target directory (e.g., `src/components/ui`)
|
|
472
|
+
- `alias` (string, optional) — Import alias prefix (e.g., `@/components/ui`)
|
|
473
|
+
- `target` (string, optional) — Swift SPM target name
|
|
474
|
+
- `force` (boolean, optional) — Overwrite existing files
|
|
475
|
+
- `installDeps` (boolean, optional) — Auto-install npm deps (default: true)
|
|
476
|
+
- `config` (object, optional) — Config schema params (e.g., `{ "styling": "panda" }`)
|
|
477
|
+
|
|
478
|
+
**Example response:**
|
|
479
|
+
|
|
480
|
+
```json
|
|
481
|
+
{
|
|
482
|
+
"success": true,
|
|
483
|
+
"package": { "name": "@lpm.dev/alice.ui-kit", "version": "2.0.0" },
|
|
484
|
+
"installPath": "src/components/ui",
|
|
485
|
+
"files": [
|
|
486
|
+
{ "dest": "src/components/ui/button.jsx", "action": "created" },
|
|
487
|
+
{ "dest": "src/components/ui/input.jsx", "action": "created" }
|
|
488
|
+
],
|
|
489
|
+
"dependencies": { "npm": ["react"], "lpm": [] }
|
|
490
|
+
}
|
|
491
|
+
```
|
|
492
|
+
|
|
493
|
+
### lpm_install
|
|
494
|
+
|
|
495
|
+
Install an LPM package as a dependency to node_modules (like npm install). Use for JS libraries, utilities, and SDKs. Requires LPM CLI installed locally.
|
|
496
|
+
|
|
497
|
+
**Parameters:**
|
|
498
|
+
|
|
499
|
+
- `name` (string, required) — Package name
|
|
500
|
+
- `version` (string, optional) — Specific version (defaults to latest)
|
|
501
|
+
|
|
502
|
+
**Example response:**
|
|
503
|
+
|
|
504
|
+
```json
|
|
505
|
+
{
|
|
506
|
+
"success": true,
|
|
507
|
+
"packages": [{ "name": "@lpm.dev/bob.validate" }],
|
|
508
|
+
"npmOutput": "added 1 package in 1s"
|
|
509
|
+
}
|
|
510
|
+
```
|
|
511
|
+
|
|
512
|
+
### lpm_get_install_command
|
|
513
|
+
|
|
514
|
+
Get the correct CLI command to install an LPM package. Returns `lpm add` (source extraction) or `lpm install` (node_modules) based on the package type and ecosystem.
|
|
515
|
+
|
|
516
|
+
**Parameters:**
|
|
517
|
+
|
|
518
|
+
- `name` (string, required) — Package name
|
|
519
|
+
- `version` (string, optional) — Specific version
|
|
520
|
+
|
|
521
|
+
**Example response:**
|
|
522
|
+
|
|
523
|
+
```json
|
|
524
|
+
{
|
|
525
|
+
"command": "lpm add @lpm.dev/alice.ui-kit",
|
|
526
|
+
"method": "add",
|
|
527
|
+
"explanation": "Extracts source files into your project for customization."
|
|
528
|
+
}
|
|
529
|
+
```
|
|
530
|
+
|
|
531
|
+
### lpm_quality_report
|
|
532
|
+
|
|
533
|
+
Get the quality score and detailed check breakdown for an LPM package. Covers 28 checks across documentation, code quality, testing, and maintenance health.
|
|
534
|
+
|
|
535
|
+
**Parameters:**
|
|
536
|
+
|
|
537
|
+
- `name` (string, required) — Package name in `owner.package-name` format
|
|
538
|
+
|
|
539
|
+
**Example response:**
|
|
540
|
+
|
|
541
|
+
```json
|
|
542
|
+
{
|
|
543
|
+
"name": "@lpm.dev/alice.ui-kit",
|
|
544
|
+
"score": 85,
|
|
545
|
+
"maxScore": 100,
|
|
546
|
+
"tier": "good",
|
|
547
|
+
"categories": [
|
|
548
|
+
{ "name": "documentation", "score": 22, "maxScore": 25 },
|
|
549
|
+
{ "name": "code", "score": 28, "maxScore": 30 }
|
|
550
|
+
],
|
|
551
|
+
"checks": [
|
|
552
|
+
{ "id": "has-readme", "passed": true, "points": 10, "maxPoints": 10 }
|
|
553
|
+
]
|
|
554
|
+
}
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
### lpm_search_owners
|
|
558
|
+
|
|
559
|
+
Search for users or organizations on the LPM registry by name or username.
|
|
560
|
+
|
|
561
|
+
**Parameters:**
|
|
562
|
+
|
|
563
|
+
- `query` (string, required) — Name or username to search for
|
|
564
|
+
- `limit` (number, optional) — Max results, 1-10 (default: 5)
|
|
565
|
+
|
|
566
|
+
**Example response:**
|
|
567
|
+
|
|
568
|
+
```
|
|
569
|
+
Found 2 profiles:
|
|
570
|
+
|
|
571
|
+
- @alice (Alice Smith) [user] — Full-stack developer
|
|
572
|
+
- @acme (Acme Corp) [org] — Open source tools for developers
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
### lpm_packages_by_owner
|
|
576
|
+
|
|
577
|
+
List packages published by a specific user or organization. Shows only public (pool/marketplace) packages.
|
|
578
|
+
|
|
579
|
+
**Parameters:**
|
|
580
|
+
|
|
581
|
+
- `owner` (string, required) — Username or organization slug
|
|
582
|
+
- `limit` (number, optional) — Max results, 1-50 (default: 10)
|
|
583
|
+
|
|
584
|
+
**Example response:**
|
|
585
|
+
|
|
586
|
+
```
|
|
587
|
+
Found 2 packages by alice:
|
|
588
|
+
|
|
589
|
+
- alice.ui-kit [pool] — A modern UI component kit for React (5,400 downloads)
|
|
590
|
+
- alice.form-validator [marketplace] — Form validation utilities (1,200 downloads)
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### lpm_pool_stats
|
|
594
|
+
|
|
595
|
+
Get your Pool revenue sharing earnings estimate for the current month. Shows per-package breakdown with installs, weighted downloads, share percentage, and estimated earnings.
|
|
596
|
+
|
|
597
|
+
**Parameters:** None
|
|
598
|
+
|
|
599
|
+
**Example response:**
|
|
600
|
+
|
|
601
|
+
```json
|
|
602
|
+
{
|
|
603
|
+
"billingPeriod": "2026-02",
|
|
604
|
+
"totalWeightedDownloads": 5000,
|
|
605
|
+
"estimatedEarningsCents": 2450,
|
|
606
|
+
"packages": [
|
|
607
|
+
{
|
|
608
|
+
"name": "@lpm.dev/alice.my-utils",
|
|
609
|
+
"installCount": 120,
|
|
610
|
+
"weightedDownloads": 3200,
|
|
611
|
+
"sharePercentage": 1.85,
|
|
612
|
+
"estimatedEarningsCents": 1800
|
|
613
|
+
}
|
|
614
|
+
]
|
|
615
|
+
}
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
### lpm_user_info
|
|
619
|
+
|
|
620
|
+
Get information about the authenticated LPM user including organizations, plan tier, pool access, and usage limits.
|
|
621
|
+
|
|
622
|
+
**Parameters:** None
|
|
623
|
+
|
|
624
|
+
**Example response:**
|
|
625
|
+
|
|
626
|
+
```json
|
|
627
|
+
{
|
|
628
|
+
"username": "alice@example.com",
|
|
629
|
+
"profile_username": "alice",
|
|
630
|
+
"organizations": [{ "slug": "acme", "name": "Acme Corp", "role": "owner" }],
|
|
631
|
+
"available_scopes": ["@alice", "@acme"],
|
|
632
|
+
"plan_tier": "pro",
|
|
633
|
+
"has_pool_access": true,
|
|
634
|
+
"usage": { "storage_bytes": 50000000, "private_packages": 2 },
|
|
635
|
+
"limits": { "privatePackages": 10, "storageBytes": 524288000 }
|
|
636
|
+
}
|
|
637
|
+
```
|
|
638
|
+
|
|
639
|
+
## Caching
|
|
640
|
+
|
|
641
|
+
Responses are cached in memory to reduce API calls:
|
|
642
|
+
|
|
643
|
+
| Tool | Cache TTL |
|
|
644
|
+
| ------------------------- | --------- |
|
|
645
|
+
| `lpm_search` | 5 minutes |
|
|
646
|
+
| `lpm_package_info` | 5 minutes |
|
|
647
|
+
| `lpm_api_docs` | 5 minutes |
|
|
648
|
+
| `lpm_llm_context` | 5 minutes |
|
|
649
|
+
| `lpm_package_context` | 5 minutes |
|
|
650
|
+
| `lpm_package_skills` | 5 minutes |
|
|
651
|
+
| `lpm_browse_source` | 5 minutes |
|
|
652
|
+
| `lpm_get_install_command` | 5 minutes |
|
|
653
|
+
| `lpm_quality_report` | 5 minutes |
|
|
654
|
+
| `lpm_search_owners` | 5 minutes |
|
|
655
|
+
| `lpm_packages_by_owner` | 5 minutes |
|
|
656
|
+
| `lpm_pool_stats` | 1 hour |
|
|
657
|
+
| `lpm_user_info` | 5 minutes |
|
|
658
|
+
| `lpm_add` | No cache |
|
|
659
|
+
| `lpm_install` | No cache |
|
|
660
|
+
|
|
661
|
+
Cache is in-memory only and resets when the server restarts.
|
|
662
|
+
|
|
663
|
+
## Troubleshooting
|
|
664
|
+
|
|
665
|
+
**"No LPM token found"**
|
|
666
|
+
Set the `LPM_TOKEN` environment variable in your MCP client configuration, or run `lpm login` first.
|
|
667
|
+
|
|
668
|
+
**"Authentication required"**
|
|
669
|
+
Some tools (`lpm_browse_source`, `lpm_add`, `lpm_install`) require authentication. Run `lpm login` or set `LPM_TOKEN`.
|
|
670
|
+
|
|
671
|
+
**"Authentication failed"**
|
|
672
|
+
Your token may be expired or revoked. Generate a new token at https://lpm.dev/dashboard/tokens or run `lpm login`.
|
|
673
|
+
|
|
674
|
+
**"Cannot reach lpm.dev"**
|
|
675
|
+
Check your internet connection. If you're behind a proxy, ensure it allows HTTPS connections to lpm.dev.
|
|
676
|
+
|
|
677
|
+
**"Package not found"**
|
|
678
|
+
Verify the package name format: `owner.package-name` (e.g., `alice.ui-kit`).
|
|
679
|
+
|
|
680
|
+
**"Rate limit exceeded"**
|
|
681
|
+
Source browsing is rate limited to 30 requests per minute. Wait and retry.
|
|
682
|
+
|
|
683
|
+
**"Source browsing is currently disabled"**
|
|
684
|
+
The registry has temporarily disabled source browsing. Try again later.
|
|
685
|
+
|
|
686
|
+
**"Response was truncated"**
|
|
687
|
+
Use the `path` parameter with `lpm_browse_source` to request specific files or directories instead of the entire package.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// CRITICAL: Never use console.log() — stdout is the MCP JSON-RPC transport
|
|
4
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
5
|
+
import { createServer } from "../lib/server.js"
|
|
6
|
+
|
|
7
|
+
const server = createServer()
|
|
8
|
+
const transport = new StdioServerTransport()
|
|
9
|
+
await server.connect(transport)
|
|
10
|
+
|
|
11
|
+
console.error("LPM MCP server started")
|