pip install diffctx[mcp]Add to ~/.claude/mcp.json:
{
"mcpServers": {
"diffctx": {
"command": "diffctx-mcp"
}
}
}Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"diffctx": {
"command": "diffctx-mcp"
}
}
}Add to ~/.continue/config.json:
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "diffctx-mcp"
}
}
]
}
}Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"diffctx": {
"command": "diffctx-mcp"
}
}
}Add to ~/.config/zed/settings.json:
{
"context_servers": {
"diffctx": {
"command": {
"path": "diffctx-mcp"
}
}
}
}DIFFCTX_ALLOWED_PATHS— colon-separated list of directories the server is allowed to access. When set, requests for repositories outside these paths are rejected.
Returns the most relevant code fragments for understanding a git diff.
Parameters:
repo_path(string, required) — absolute path to a git repositorydiff_range(string, default"HEAD~1..HEAD") — git diff rangebudget_tokens(integer, default8000) — token budget for selectionclipboard(boolean, defaultfalse) — copy the result to the clipboard and return a short confirmation instead of the full context
Returns a structured map of a codebase — directory tree with file contents in
YAML or Markdown, respecting .gitignore and skipping binaries/build
artifacts. Requires a git repository.
Parameters:
repo_path(string, required) — absolute path to a git repositorysubdirectory(string, default"") — optional path underrepo_pathto map instead of the whole repositoryoutput_format(string, default"yaml") —"yaml"or"md"no_content(boolean, defaultfalse) — emit structure only, skip contentsmax_depth(integer, optional) — limit traversal depthmax_file_bytes(integer, default262144= 256 KB) — per-file content capclipboard(boolean, defaultfalse) — copy to clipboard instead of returning the mapmax_tokens(integer, default25000) — ceiling on the returned output; if the map exceeds it, an advisory message is returned instead of the content (narrow withsubdirectory/no_content/max_depth, or raise the ceiling)
Reads files by glob pattern, formatted for LLM consumption. Works on any directory (no git required).
Parameters:
repo_path(string, required) — absolute path to a directorypatterns(list of strings, required) — glob patterns, e.g.["src/**/*.py"]max_files(integer, default50) — maximum number of files to includemax_file_bytes(integer, default262144= 256 KB) — per-file content cap; larger files are listed but their content is skippedclipboard(boolean, defaultfalse) — copy to clipboard instead of returning the contentdry_run(boolean, defaultfalse) — preview which files match without reading their contentmax_tokens(integer, default25000) — ceiling on the returned output; if the content exceeds it, an advisory message is returned instead (tightenpatterns, lowermax_files, usedry_run=true, or raise the ceiling)