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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.