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

chat-export-mcp

v0.1.0

Published

MCP server and CLI for exporting AI chat histories to Markdown or HTML.

Readme

Chat Export MCP

Chat Export MCP 是一个基于 Node.js 的 MCP 服务器与命令行工具,支持将 Codex CLI、VSCode Augment、Claude 等聊天记录导出为 Markdown 或 HTML,方便归档、分析或分享。

快速开始

npm install
npm run build
npm run dev -- --help

常用脚本

  • npm run build:类型检查并编译 TypeScript,生成 dist 目录。
  • npm run dev:使用 tsx 监听执行 CLI,便于开发调试。
  • npm run lint:运行 ESLint + Prettier 进行代码检查。
  • npm run format / npm run format:write:检查或自动修复 Prettier 格式。
  • npm test:预留的 Vitest 测试脚本。

CLI 用法

  • node dist/bin/chat-export.js --help:查看全部参数说明。
  • node dist/bin/chat-export.js --limit 3:导出最新三条会话(默认输出 HTML 格式到 ./exports)。
  • node dist/bin/chat-export.js --format md --source augment --output ./exports/md:显式导出为 Markdown,并指定来源与目录。
  • node dist/bin/chat-export.js --source augment --session-id <id>:根据会话 ID 精确导出。
  • node dist/bin/chat-export.js --title-contains "关键词" --from 2025-10-01T00:00:00Z --to 2025-10-17T23:59:59Z:结合标题和时间范围过滤导出。
  • node dist/bin/chat-export.js list --source augment --limit 10:列出满足条件的会话,方便复制 session-id
  • node dist/bin/chat-export.js list --source augment --json:以 JSON 形式返回列表结果,便于脚本处理。

CLI 默认最多导出 3 条会话,且默认写出 HTML 文件,命名为 标题_时间戳.html 自动避免重名覆盖。若使用 --format md--session-id--title-contains,会根据参数忽略 --limit 限制以确保命中目标会话。

MCP Server

  • node dist/bin/chat-export-server.js:通过 stdio 启动 MCP Server,可供 Claude Code、VSCode Augment 等客户端连接。
  • 已注册工具:
    • list-sessions:按来源、时间范围列出可用会话摘要,并支持 source、时间、标题筛选。
    • export-session:返回指定会话的 Markdown/HTML 正文。
  • 已注册资源:chat-session://{source}/{sessionId} 可直接读取单个会话的 Markdown 内容。

项目结构

  • src/types.ts:公共类型定义(ChatMessageChatSession 等)。
  • src/platforms/:针对 Codex、Augment、Claude 的会话加载逻辑。
  • src/exporters/:Markdown、HTML 渲染与文件导出实现。
  • src/core/:会话加载核心抽象以及工厂方法。
  • src/cli/:基于 Commander 的 CLI 实现。
  • src/bin/chat-export.tschat-export 命令入口。
  • src/bin/chat-export-server.tschat-export-server 命令入口。

后续规划

  • 完善 Claude 平台的真实数据解析流程。
  • 补充 MCP Server 更全面的错误处理与日志能力。
  • 扩充加载器、导出器以及 CLI 模块的自动化测试覆盖率。