MCP Distill
FreeNot checkedRecord AI coding interactions for model distillation, exporting to OpenAI, ShareGPT, and Anthropic dataset formats.
About
Record AI coding interactions for model distillation, exporting to OpenAI, ShareGPT, and Anthropic dataset formats.
README
An MCP server (in Rust) that records prompts, context, and responses from Claude (Anthropic Messages API) and Codex (OpenAI Chat Completions API) for small-model distillation.
Captures every turn losslessly to JSONL, then exports to the format your trainer wants.
Quick start
cargo build --release
./target/release/mcp-distill where # show storage root
./target/release/mcp-distill serve # run as MCP server over stdio
Wire it into codex automatically:
./target/release/mcp-distill install codex \
--store-root ~/.mcp-distill --compression zstd
# adds [mcp_servers.distill] to ~/.codex/config.toml (preserves other settings)
# sets default_tools_approval_mode = "approve" so codex doesn't cancel our calls
# `install codex --force` overwrites a differing existing entry
# `uninstall codex` removes it
Wire it into Claude Code automatically (requires claude CLI):
./target/release/mcp-distill install claude \
--store-root ~/.mcp-distill --compression zstd
# shells out to `claude mcp add -s user` (writes ~/.claude.json, user scope)
# `install claude --force` removes any existing entry with the same name first
# `uninstall claude` runs `claude mcp remove -s user distill`
MCP tools exposed
| Tool | What it does |
|---|---|
recording_status |
Whether a session is currently recording, and which one. |
stop_recording |
Halt the auto-started session (writes an end record). |
start_recording |
Open a fresh session and make it current. |
start_session |
Open a session and make it current. Returns session_id. |
append_turn |
Append a provider-native message. session_id optional → uses current. |
append_usage |
Record token usage. session_id optional → uses current. |
end_session |
Mark a session ended (current if session_id omitted). |
record_interaction |
One-shot: start + write all messages + response in a single call. |
list_sessions |
List captured sessions. |
export_dataset |
Emit JSONL in openai_chat / sharegpt / anthropic format. |
stats |
Session/turn counts, providers seen, storage root. |
Auto-recording: the server opens a session at launch and routes
implicit append_turn calls to it. The provider for that session comes
from MCP_DISTILL_AUTO_PROVIDER (install {codex,claude} seeds this).
Disable with MCP_DISTILL_AUTO_RECORD=0. Manually halt with
stop_recording; resume with start_recording.
Storage
$MCP_DISTILL_ROOT (default: ~/.mcp-distill)/
sessions/YYYY/MM/DD/<session_id>.jsonl # raw, lossless, append-only
index.jsonl # session index (latest meta wins)
exports/ # generated SFT datasets
See docs/FORMAT.md for the full schema and the rationale behind the format choice.
Training on the exports (Unsloth)
The openai_chat export drops straight into Unsloth; sharegpt needs one
normalize call.
from datasets import load_dataset
from unsloth.chat_templates import standardize_sharegpt
# A) openai_chat — already in Unsloth's preferred shape
ds = load_dataset("json", data_files="exports/openai_chat-*.jsonl", split="train")
# B) sharegpt — one extra normalize step
ds = load_dataset("json", data_files="exports/sharegpt-*.jsonl", split="train")
ds = standardize_sharegpt(ds)
Two gotchas: assistant turns with only tool_calls carry content: null
(modern templates handle it; some older Phi/Gemma templates need null → ""),
and role: "tool" rows need a tool-aware chat template (Llama 3.1+, Qwen 2.5,
DeepSeek-R1). Filter them out otherwise. Details in
docs/FORMAT.md.
Installing MCP Distill
This server has no published package — it is built from source. Open the repository and follow its README.
▸ github.com/madeye/mcp-distillFAQ
Is MCP Distill MCP free?
Yes, MCP Distill MCP is free — one-click install via Unyly at no cost.
Does MCP Distill need an API key?
No, MCP Distill runs without API keys or environment variables.
Is MCP Distill hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install MCP Distill in Claude Desktop, Claude Code or Cursor?
Open MCP Distill on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Opencode Omniroute Plugin
OpenCode plugin for the OmniRoute AI Gateway. Drives dynamic model discovery, /connect auth flow, and multi-instance OmniRoute providers via the official @openc
by GitHub ActionsRoblox Studio
Enables AI coding tools to control Roblox Studio for workspace exploration, instance manipulation, and script management. It provides tools for playtesting, sce
by paralovAntigravity Drawio
MCP server that enables AI assistants to create, parse, render, and validate Draw.io diagrams programmatically.
by S-SUJAN-SFetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
by modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
by xuzexin-hzMCP-Agent
A simple, composable framework to build agents using Model Context Protocol by [LastMile AI](https://www.lastmileai.dev)
by lastmile-aiSpring AI MCP Client
Provides auto-configuration for MCP client functionality in Spring Boot applications.
mcp.natoma.ai
A Hosted MCP Platform to discover, install, manage and deploy MCP servers by [Natoma Labs](https://www.natoma.ai)
Compare MCP Distill with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All ai MCPs
