continue-chat-export
Sanitizes Continue.dev session exports and reformats them as readable Obsidian chat Markdown, with MCP tools that return only metadata (paths, counts) for privacy.
README
continue-chat-export
Sanitize Continue session transcript exports and rewrite them as readable Obsidian chat Markdown.
| Input | Continue *_session.md exports (quoted or header form) |
| Output | *.chat.md on disk (## User / ## Assistant, answers + always-visible Sources) |
| MCP | Tools return paths + counts only — never transcript body text |
| License | MIT (permissive; fork, modify, redistribute) |
| Deps | Python ≥ 3.11, mcp |
Standalone package.
Privacy contract
- Processing is local disk → disk.
- MCP tool results contain only metadata: paths, byte counts, null/ANSI counts, turn counts, source counts, error type strings.
- Transcript body is never included in tool return values (so this server does not feed chat text back into the model context).
- Other tools (generic filesystem MCPs, editor “@file”) can still read
*.chat.mdif pointed at them — this server does not offer a read/summarize tool.
Features
- Strip embedded NUL bytes (e.g. UTF-16-LE blobs such as Windows
*.iniin a transcript). - Strip ANSI escape sequences from shell tool output.
- Collapse consecutive Continue assistant fragments into one assistant turn per user message.
- Web/search dumps (
Title:/URL:/Highlights:) → always-visible### Sourcesblockquotes. - Optional
<details>for non-web tool dumps only (--collapse-tools).
Example output shape
---
type: continue-chat
source: "export_session.md"
exported: "1/1/2026, 12:00:00 PM"
sanitized: true
user_turns: 15
assistant_turns: 15
sources: 54
---
# Continue session transcript
## User
…
---
## Assistant
### Answer
…
### Sources
> **Page title**
> https://example.com/page
>
> Highlight / snippet text…
---
Install
From a clone (development / local MCP)
git clone https://github.com/<you>/continue-chat-export.git
cd continue-chat-export
uv venv .venv
uv pip install -e ".[dev]"
# or: python3 -m venv .venv && source .venv/bin/activate && pip install -e ".[dev]"
| Script | Role |
|---|---|
continue-chat-export |
CLI formatter |
continue-chat-export-mcp |
MCP server (stdio) |
.venv/bin/continue-chat-export --help
.venv/bin/pytest -q
From PyPI (if/when published)
pip install continue-chat-export
CLI
continue-chat-export path/to/export_session.md
continue-chat-export path/to/export_session.md -o path/to/out.chat.md
continue-chat-export a.md b.md c.md
continue-chat-export path/to/export_session.md --in-place
continue-chat-export path/to/export_session.md --include-narration
continue-chat-export path/to/export_session.md --collapse-tools
continue-chat-export path/to/export_session.md --max-tool-chars 8000
continue-chat-export path/to/export_session.md --inspect --json
Default sidecar output: INPUT.chat.md. CLI prints paths + counts only (or --json stats), never the chat body.
Integrate with Continue
Official docs: MCP in Continue.
1. Install this package
cd /path/to/continue-chat-export
uv venv .venv && uv pip install -e .
Entrypoint:
/path/to/continue-chat-export/.venv/bin/continue-chat-export-mcp
2. Add mcpServers entry
In ~/.continue/config.yaml:
mcpServers:
- name: continue-chat-export
command: /path/to/continue-chat-export/.venv/bin/continue-chat-export-mcp
args: []
env:
PATH: /usr/bin:/usr/local/bin:/bin
No API keys required.
Portable uv run variant
mcpServers:
- name: continue-chat-export
command: uv
args:
- run
- --directory
- /path/to/continue-chat-export
- continue-chat-export-mcp
env:
PATH: /usr/bin:/usr/local/bin:/bin
This is Python, not npm — do not use npx for this server.
3. Reload MCP
Restart Continue / reload the window and confirm tools are listed.
4. Agent mode usage
MCP tools run in agent mode only. Pass filesystem paths; do not paste transcript text.
format_continue_export—input_path="/path/to/vault/export_session.md"format_continue_export_batch—root="/path/to/vault",glob="**/*_session.md"inspect_continue_export—input_path="/path/to/vault/export_session.md"list_session_exports—root="/path/to/vault"
Results are stats only (ok, output_path, user_turns, sources, …). Open output_path in Obsidian yourself.
5. Workspace config (optional)
Same YAML may live in a workspace Continue config / .continue/mcpServers/ (see Continue docs).
6. VSCodium
Same as VS Code once Continue is installed.
MCP tools reference
All tools return metadata only.
| Tool | Purpose |
|---|---|
format_continue_export |
One file → *.chat.md |
format_continue_export_batch |
Many files via paths or root+glob |
inspect_continue_export |
Size, nulls, turn counts (no write) |
list_session_exports |
List exports under a directory |
Default output: <stem>.chat.md beside the input.
GitHub / publishing
continue-chat-export/
README.md
LICENSE # MIT
pyproject.toml
.gitignore
src/continue_chat_export/
tests/
Before you push
- Docs use
/path/to/...placeholders only (no personal home directories). - Do not commit
.venv/, secrets, or real session transcripts. - Run
pytest -q. - Optional PyPI publish (
hatchlingis configured).
.gitignore (sessions)
Ignores *_session.md, *.session.md, *.chat.md, *.bak_nulls, *.bak_continue_export, plus .venv/ and build caches. Keep tests/fixtures/ (synthetic only).
Consumer blurb
## Install as Continue MCP
1. Clone and `uv pip install -e .`
2. Point Continue `mcpServers` at `/path/to/continue-chat-export/.venv/bin/continue-chat-export-mcp`
3. Agent mode → `format_continue_export` with a filesystem path
Optional CI
name: test
on: [push, pull_request]
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v5
- run: uv venv && uv pip install -e ".[dev]" && uv run pytest -q
Development
uv pip install -e ".[dev]"
uv run pytest -q
| Module | Role |
|---|---|
sanitize.py |
NUL / UTF-16-LE / ANSI |
parse.py |
Headers → turns |
sources.py |
Search hits → blockquotes |
format_chat.py |
Render + disk I/O |
cli.py |
CLI |
server.py |
FastMCP stdio |
Limitations
- Heuristic classification; export quality bounds recovery.
- No native Continue UI reconstruction.
- Deterministic local formatting only (no LLM).
License
MIT — free to use, fork, modify, and redistribute, including commercially, with license notice retained.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。