npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lithium-ai/mcp

v0.1.1

Published

MCP server for Lithium. Give AI agents tools to navigate, store, and retrieve structured data.

Readme

@lithium-ai/mcp

MCP server for @lithium-ai/core. Give Claude, Cursor, Windsurf, and any MCP client tools to navigate, store, and retrieve structured data.

npm license


Install

npm install @lithium-ai/core @lithium-ai/postgres @lithium-ai/mcp

Quick Start

Create a server file:

// server.ts
import { Lithium } from "@lithium-ai/core";
import { postgresAdapter } from "@lithium-ai/postgres";
import { serveMcp } from "@lithium-ai/mcp";
import postgres from "postgres";

const sql = postgres(process.env.LITHIUM_DATABASE_URL!);

const lithium = new Lithium(postgresAdapter(sql), {
  read: async (versionIds) => {
    const rows = await sql`
      SELECT entry_version_id, data
      FROM content
      WHERE entry_version_id = ANY(${versionIds})
    `;
    return new Map(rows.map((r) => [r.entry_version_id, r.data]));
  },
  write: async (versionId, content) => {
    await sql`INSERT INTO content (entry_version_id, data) VALUES (${versionId}, ${sql.json(content)})`;
    return content;
  },
});

serveMcp(lithium);

Add to your Claude Code config:

{
  "mcpServers": {
    "lithium": {
      "command": "npx",
      "args": ["tsx", "server.ts"]
    }
  }
}

Tools

list_clusters

Lists all clusters in the hierarchy. No parameters.

Returns cluster paths, names, descriptions, and IDs as JSON.

get_context

Get all entries and content under a cluster path. Resolves the full subtree via ltree.

| Parameter | Type | Description | | --------- | -------- | --------------------------------------------------- | | path | string | Dot-separated cluster path, e.g. "infra.database" |

Returns descendant cluster IDs, entries with latest versions, and resolved content as JSON.

create_cluster

Create a knowledge domain. Optionally nest under a parent path.

| Parameter | Type | Description | |---|---|---| | name | string | Name of the cluster | | parentPath | string? | Dot-separated parent path | | description | string? | Description of the cluster |

create_entry

Create a versioned entry in a cluster. Returns the entry and its first version.

| Parameter | Type | Description | |---|---|---| | clusterId | string | ID of the cluster to add the entry to |


API

serveMcp(lithium)

Starts an MCP server with stdio transport. Registers all tools and connects.

import { serveMcp } from "@lithium-ai/mcp";
await serveMcp(lithium);

createMcpServer(lithium)

Creates and returns the MCP server without connecting. Use this if you need a custom transport.

import { createMcpServer } from "@lithium-ai/mcp";
const server = createMcpServer(lithium);
// Connect your own transport

Content

Content callbacks are optional and configured on the Lithium class, not the MCP package.

// Without content callbacks
const lithium = new Lithium(postgresAdapter(sql));
// get_context returns entries without content
// create_entry stores structure only

// With content callbacks
const lithium = new Lithium(postgresAdapter(sql), {
  read: async (versionIds) => new Map(...),
  write: async (versionId, content) => { /* insert */ return content; },
});
// get_context returns entries with content
// create_entry stores structure + content

Requirements

  • Node.js >= 20
  • PostgreSQL with ltree extension
  • MCP-compatible client (Claude Code, etc.)

License

MIT