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

@trinity-mcp/trinity-memory

v0.1.3

Published

Trinity Memory — 统一 MCP 入口,聚合本地代码分析能力

Readme

@trinity-mcp/trinity-memory

统一的本地 MCP 入口,聚合开源代码分析能力。

对内产品名 trinity-memory,内部使用 Codebase Memory 引擎(DeusData MIT 开源项目)。

用户安装

npm install -g @trinity-mcp/trinity-memory

npm 会自动安装 codebase-memory-mcp 引擎,无需手动配置。

配置 AI IDE

以 CodeBuddy 为例,在项目根目录 .mcp.json 中添加:

{
  "mcpServers": {
    "trinity-memory": {
      "command": "trinity-memory"
    }
  }
}

其他 AI IDE 同理,command 填 trinity-memory 即可。之后打开项目,引擎会自动扫描并索引代码库。

开发

# 安装依赖
npm install

# 类型检查
npm run typecheck

# 开发模式运行(需要 codebase-memory-mcp 在 PATH 中)
npm run dev

# 构建(产出 dist/index.js)
npm run build

# 运行单元测试
npm run test

配置

| 环境变量 | 默认值 | 说明 | |----------|--------|------| | TEI_CACHE_DIR | ~/.cache/trinity-memory-mcp/ | Trinity Memory 缓存目录(优先) | | CBM_CACHE_DIR | — | 旧版兼容缓存目录;仅在未设置 TEI_CACHE_DIR 时读取 | | TEI_DEFAULT_PROJECT | — | 漏传 project 时的显式默认项目名(须已索引;优先于 cwd 匹配) | | CBM_DEFAULT_PROJECT | — | 旧版兼容;仅在未设置 TEI_DEFAULT_PROJECT 时读取 | | CBM_BINARY_PATH | codebase-memory-mcp(从 PATH 查找) | Codebase Memory 可执行文件路径 | | CHILD_TIMEOUT_MS | 30000 | 子进程超时(毫秒) | | MAX_RESTARTS | 3 | 子进程最大重启次数 | | LOG_LEVEL | info | 日志级别:silent / error / warn / info / debug |

漏传 project 时的行为(0.1.3+)

search_graph / trace_path / search_code 等需要 project 的工具:若 Agent 未传,桥接会自动补全:

  1. TEI_DEFAULT_PROJECT(或 CBM_DEFAULT_PROJECT)且该名已在 list_projects
  2. 否则用 process.cwd() 与各项目 root_path 做最长前缀匹配
  3. 若仅索引了一个项目,直接用它
  4. 仍无法判定 → 返回带索引名列表的错误,提示显式传 project

对外 tools/list 中 project 标为可选,减少「missing required argument: project」误报。

架构

AI IDE / Agent (Claude Code, Codex, CodeBuddy, etc.)
       │  MCP stdio
       ▼
trinity-memory (MCP Server)
  ├── McpHub (子进程管理、工具路由)
  └── Bridges
       └── CodebaseMemoryBridge
            └── codebase-memory-mcp 子进程
                 (tools/list 可能分页;桥接会翻完 nextCursor)
src/
├── index.ts              ← MCP Server 入口
├── hub.ts                ← 子进程管理器(McpHub)
├── config.ts             ← 配置加载
├── bridges/
│   ├── types.ts          ← 桥接接口(McpBridge)
│   └── codebase-memory.ts ← Codebase Memory 适配器
└── __tests__/
    └── hub.test.ts       ← Hub 单元测试

版本清单

version-manifest.json,定义 Trinity Memory、Codebase Memory 引擎及目标客户端版本信息。

许可证

MIT. 内部引擎 Codebase Memory 为 DeusData 开源项目(MIT)。