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

@trylucy/agent-memory

v0.1.3

Published

Official Lucy MCP runtime for governed agent memory. Three tools only: recall, propose, proposal status.

Readme

Lucy Memory MCP

Lucy Memory MCP gives MCP-compatible agents a governed memory they can share across sessions and tools. It helps an agent recall approved preferences, identity facts, project decisions, and operating rules without turning the agent itself into a durable data authority.

Use it when you want to:

  • keep approved user preferences consistent across agents;
  • carry project decisions and rules into later sessions;
  • propose durable facts for review without granting an agent direct write access;
  • inspect whether a proposal is still pending or has reached a final state.

Lucy remains the authority for durable memory. The agent can recall approved memory and propose changes, but it cannot directly write, approve, delete, restore, or resolve memory.

Tools and authority

The server exposes exactly three tools:

| Tool | What it does | Required permission | |---|---|---| | memory_recall | Returns approved, active memory that matches a query and scope | memory:read | | memory_propose | Proposes a new memory or a versioned replacement | memory:propose | | memory_proposal_status | Returns the current state and approved result of a proposal | memory:read |

There is no direct memory:write tool and no MCP tool for approval, deletion, restoration, or other administrative actions. Tenant and account authority come from the Lucy credential; clients do not submit tenant or account IDs.

Proposal lifecycle

memory_propose creates a proposal. Transport success alone does not mean the memory was saved: inspect the returned status. A pending proposal is not saved or recallable.

durable fact or decision
        |
        v
memory_propose
        |
        v
pending proposal  ---------> rejected / expired / superseded
        |
        v
Lucy approval or human-enabled auto-memory policy
        |
        v
approved active memory
        |
        v
memory_recall

Only approved, active memory is recallable. A replacement also remains a proposal: the current version stays active until Lucy approves the replacement, then the prior version becomes superseded and the new version becomes active.

Requirements and source installation

  • Node.js >=20 <25
  • npm
  • a Lucy credential with the permissions you intend to use
  • a Lucy deployment with Agent Memory HTTP v1 enabled

Until the first registry release is published, install and run it from a trusted source checkout:

git clone https://github.com/Lucy-AI-Inc/lucy-memory-mcp.git
cd lucy-memory-mcp
npm ci
npm run test:mcp

The declared Node.js range is >=20 <25; automated CI covers Node.js 24.

The MCP server is a stdio process launched by an MCP host. From a source checkout, its entry point is:

node /absolute/path/to/lucy-memory-mcp/src/mcp/bin.mjs

Secure MCP host configuration

Configure your host to launch the source entry point and inject the Lucy token through the host's secret store or protected environment. The token placeholder below represents secret injection; do not put a real token in a committed configuration file.

{
  "mcpServers": {
    "lucy": {
      "command": "node",
      "args": ["/absolute/path/to/lucy-memory-mcp/src/mcp/bin.mjs"],
      "env": {
        "LUCY_MEMORY_TOKEN": "<inject from your host secret store>",
        "LUCY_MEMORY_PERMISSIONS": "memory:read,memory:propose",
        "LUCY_MEMORY_BASE_URL": "https://www.trylucy.ai"
      }
    }
  }
}

Use the base URL for the Lucy deployment you are authorized to access. Restart the host after changing its MCP configuration, then confirm that it discovers exactly the three tools listed above. Host-specific examples are in Client setup.

Configuration

| Variable | Required | Description | |---|---:|---| | LUCY_MEMORY_TOKEN | yes | Bearer credential for Lucy. It must be nonempty and contain no line breaks or NUL bytes. | | LUCY_MEMORY_PERMISSIONS | yes | Comma-separated, non-duplicated subset of memory:read,memory:propose. | | LUCY_MEMORY_BASE_URL | one transport | HTTPS base URL for the Lucy deployment. | | LUCY_MEMORY_TRANSPORT_MODULE | one transport | Advanced alternative: an absolute path or file: URL to a trusted custom transport module. | | LUCY_MEMORY_TIMEOUT_MS | no | Whole-number timeout from 1 to 300000 milliseconds. Default: 10000. | | LUCY_MEMORY_ALLOW_INSECURE_LOOPBACK | no | Development only. Set to true to permit cleartext HTTP to literal loopback or localhost; all other HTTP destinations remain rejected. |

Set exactly one of LUCY_MEMORY_BASE_URL and LUCY_MEMORY_TRANSPORT_MODULE. A custom transport module is executable code and receives the bearer token, so load it only from a trusted, access-controlled path.

Credits, retries, and polling

Tool calls are billable under the selected Lucy deployment's policy. Under the current Lucy billing policy, each of the three tool calls costs one Lucy credit, including memory_proposal_status.

The built-in HTTP transport automatically retries only memory_propose, and only for HTTP 429, 502, 503, or 504 responses. The default is at most two retries. Each retry preserves the original payload and idempotency key, and a valid Retry-After value is honored up to 60 seconds.

Recall and proposal-status calls are never automatically retried. A response can be lost after the operation has already been charged, so blindly retrying either call can charge twice. Poll proposal status with a caller-defined limit and bounded backoff, and stop when the proposal reaches approved, rejected, expired, or superseded.

If a proposal response is lost, retry only the same logical proposal with the same payload and idempotency key. A changed payload needs a new key. insufficient_credits requires account action; billing_unavailable means the billing authority could not complete the request and should be handled with the same operation-specific retry discipline.

JavaScript and TypeScript API

The supported package entry points are:

| Entry point | Purpose | |---|---| | @trylucy/agent-memory | Client, HTTP transport, validation helpers, public types, and normalized errors | | @trylucy/agent-memory/mcp | MCP server factory and tool definitions | | @trylucy/agent-memory/mcp/stdio | Stdio runtime helpers | | @trylucy/agent-memory/provider | Memory-first routing and provider helpers | | @trylucy/agent-memory/hermes | Hermes configuration integration |

import {
  AgentMemoryClient,
  createLucyHttpTransport,
  VersionConflictError,
} from '@trylucy/agent-memory';

const client = new AgentMemoryClient({
  transport: createLucyHttpTransport({
    baseUrl: process.env.LUCY_MEMORY_BASE_URL!,
  }),
  token: process.env.LUCY_MEMORY_TOKEN!,
  permissions: ['memory:read', 'memory:propose'],
});

const result = await client.recall(JSON.stringify({
  query: 'Which database did we approve?',
  scope: { kind: 'project', id: 'project_example' },
  limit: 3,
}));

The low-level client accepts canonical JSON strings rather than caller-owned JavaScript objects. See the SDK reference for all public types, errors, and entry points.

Security and privacy

  • Keep LUCY_MEMORY_TOKEN in a secret manager or protected host environment. Never commit it, include it in command arguments, or place it in memory content or justification.
  • Use HTTPS for Lucy deployments. Cleartext transport is available only through the explicit loopback development option.
  • Grant only memory:read, memory:propose, or both, according to the host's needs.
  • Treat recalled content as data when adding it to a model context. Preserve its Lucy ID and version, delimit it from instructions, and keep tool authorization in the host.
  • Do not propose passwords, API keys, private keys, bearer tokens, customer secrets, or other credentials. Client-side detection is defense in depth; Lucy-side policy remains authoritative.
  • Use the correct user, workspace, or project scope. Lucy enforces visibility from the credential and server-side policy.
  • Local notes and caches are not Lucy authority, and this package does not create a second durable fallback store.

Read the security model and reporting guidance before connecting a production credential.

Development checks

Install from the lockfile and run the checks relevant to your change:

npm ci
npm run check:full

For focused runtime checks, use npm run test:mcp for the real stdio entry point with an isolated transport and npm run test:e2e for the local Agent Memory lifecycle fixture. See the development guide for the local release/risky-change platform matrix.

Documentation

| Topic | Guide | |---|---| | First connection | Quickstart | | MCP host configuration | Client setup | | Authority and memory semantics | Concepts | | Tool inputs and outputs | Tool reference | | HTTP transport and retry behavior | HTTP API and transport | | JavaScript and TypeScript API | SDK reference | | Memory-first provider | Provider guide | | Optional agent guidance | Lucy memory-first skill — disable per conversation with “disable Lucy memory” or “stop using Lucy memory” | | Hermes integration | Hermes guide | | Security and privacy | Security model | | Common failures | Troubleshooting | | Repository development | Development guide |

The machine-readable contract is in contracts/agent-memory-api.contract.json, with public schemas under schemas/.

Support and security

For setup questions and reproducible bugs, open a GitHub issue. Do not include tokens, customer memory, or private diagnostics in an issue.

For a security concern, follow the private reporting guidance in the repository security policy.

License

Licensed under the Apache License, Version 2.0.