Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@

All notable changes to this project will be documented in this file.

## [0.3.0] - 2026-11-08

### Changed

- **Keychain lookup matches LPM CLI** — The token is read from the registry-scoped account LPM CLI writes, `auth-token:<16 hex>` from SHA-256 of the registry URL without trailing slashes, then from the account earlier CLI releases used for a login made with a trailing slash. `LPM_TOKEN` still comes first. The unscoped `auth-token` account is no longer read, so sign in again with a current LPM CLI if the server finds no token
- **Agent tools pass complete CLI reports through** — Reports keep every field the CLI returns, process failures come back with their output, and `lpm_audit` honors its project path
- **The CLI decides access** — Tools no longer refuse anonymous calls before the CLI applies its own access rules
- **Search takes filters alone** — `lpm_search` accepts the Free distribution and filter-only requests without a query
- The server reports its package version to MCP clients instead of a fixed one

### Fixed

- **Executable discovery** — Absolute paths outside the project are scanned, the Windows npm native package resolves without a shell, and relative overrides are refused, including Windows paths without a drive or UNC share
- A missing optional `keytar` module returns no token instead of failing, and keychain read errors give an actionable message without the token

## [0.2.0] - 2026-03-25

### Added
Expand Down
22 changes: 22 additions & 0 deletions lib/__tests__/server-contract.test.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { readFileSync } from "node:fs"
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { InMemoryTransport } from "@modelcontextprotocol/sdk/inMemory.js"
import { afterEach, expect, it, vi } from "vitest"
Expand All @@ -14,6 +15,27 @@ afterEach(() => vi.unstubAllEnvs())

import { createServer } from "../server.js"

it("tells clients the version it was published as", async () => {
const { version } = JSON.parse(
readFileSync(new URL("../../package.json", import.meta.url), "utf8"),
)
const server = createServer()
const client = new Client({ name: "test", version: "1.0.0" })
const [clientTransport, serverTransport] =
InMemoryTransport.createLinkedPair()
try {
await server.connect(serverTransport)
await client.connect(clientTransport)
expect(client.getServerVersion()).toMatchObject({
name: "lpm-registry",
version,
})
} finally {
await client.close()
await server.close()
}
})

it("offers Free as a registry distribution filter", async () => {
const server = createServer()
const client = new Client({ name: "test", version: "1.0.0" })
Expand Down
5 changes: 4 additions & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { createRequire } from "node:module"
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"
import { z } from "zod"
import { getBaseUrl, getToken } from "./auth.js"
Expand All @@ -20,14 +21,16 @@ import { search } from "./tools/search.js"
import { searchOwners } from "./tools/search-owners.js"
import { userInfo } from "./tools/user-info.js"

const { version } = createRequire(import.meta.url)("../package.json")

/**
* Create and configure the MCP server with all LPM tools.
* @returns {import('@modelcontextprotocol/sdk/server/mcp.js').McpServer}
*/
export function createServer() {
const server = new McpServer({
name: "lpm-registry",
version: "0.2.0",
version,
})

const cache = new MemoryCache()
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lpm-registry/mcp-server",
"version": "0.2.0",
"version": "0.3.0",
"description": "MCP server for the LPM package registry — exposes package info, quality reports, name checks, pool stats, and marketplace search as AI tools",
"author": "LPM <hello@lpm.dev> (https://lpm.dev)",
"repository": {
Expand Down
Loading