Filter documentation build output (MkDocs, Sphinx) to show only warnings and errors with nice formatting
Project description
docs-output-filter
Filter documentation build output to show only what matters: warnings and errors.
Works with MkDocs and Sphinx (including sphinx-autobuild, Jupyter Book, myst-nb). Includes an MCP server for AI code assistant integration (Claude Code, etc.).
Before & After
| โ Raw build output (43 lines) | โ Filtered output (15 lines) |
|---|---|
|
|
Installation
# Run directly (no install needed)
uvx docs-output-filter -- mkdocs build
# Or install permanently
uv tool install docs-output-filter
# Or with pip
pip install docs-output-filter
Usage
# Wrapper mode (recommended) โ just prefix your build command
docs-output-filter -- mkdocs build
docs-output-filter -- mkdocs serve --livereload
docs-output-filter -- sphinx-autobuild docs _build/html
# Pipe mode โ traditional Unix pipe
mkdocs build 2>&1 | docs-output-filter
sphinx-build docs _build 2>&1 | docs-output-filter
# Process a remote build log (e.g., ReadTheDocs)
docs-output-filter --url https://app.readthedocs.org/projects/myproject/builds/12345/
Tip: Wrapper mode (
--) is the easiest way to use docs-output-filter. It runs the command for you, automatically captures both stdout and stderr, and fixes buffering issues with sphinx-autobuild. No2>&1needed.
Note: If using pipe mode,
2>&1is important โ Sphinx writes warnings to stderr. Without it, warnings bypass the filter.
Note: Use
--livereloadwithmkdocs servedue to a Click 8.3.x bug.
Features
| Feature | Description |
|---|---|
| Multi-tool support | MkDocs and Sphinx with auto-detection |
| Filtered output | Shows WARNING and ERROR messages, hides routine INFO |
| Code blocks | Syntax-highlighted code for markdown_exec and myst-nb errors |
| Location info | File, line number, session name, warning codes |
| Streaming mode | Real-time output for mkdocs serve / sphinx-autobuild with rebuild detection |
| Interactive mode | Toggle between raw/filtered with keyboard (-i) |
| Remote logs | Fetch and parse build logs from ReadTheDocs and other CI |
| MCP server | API for AI code assistants like Claude Code |
Options
| Flag | Description |
|---|---|
-- COMMAND |
Run command as subprocess (recommended, no 2>&1 needed) |
-v, --verbose |
Show full tracebacks and code blocks |
-e, --errors-only |
Hide warnings, show only errors |
--no-color |
Disable colored output |
--raw |
Pass through unfiltered build output |
-i, --interactive |
Toggle raw/filtered with keyboard |
--url URL |
Fetch and process a remote build log |
--tool mkdocs|sphinx|auto |
Force build tool detection (default: auto) |
--share-state |
Write state for MCP server integration |
MCP Server (for AI Assistants)
Enable AI code assistants to access build issues:
# Terminal 1: Run build tool with state sharing
docs-output-filter --share-state -- mkdocs serve --livereload
# Terminal 2: Add MCP server to Claude Code (if installed)
claude mcp add --scope user --transport stdio docs-output-filter -- docs-output-filter --mcp --watch
# Or with uvx (no install needed)
claude mcp add --scope user --transport stdio docs-output-filter -- uvx docs-output-filter --mcp --watch
Documentation
Full documentation: https://ianhuntisaak.com/docs-output-filter/
Development
git clone https://github.com/ianhi/docs-output-filter
cd docs-output-filter
uv sync
uv run pre-commit install
uv run pytest
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file docs_output_filter-0.3.3.tar.gz.
File metadata
- Download URL: docs_output_filter-0.3.3.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2ffb98274d84b728bc5dc38897aeda09c6a09eae984a7cb01f1ce1071001474
|
|
| MD5 |
d2e9e01ea236c3c67f956f2cef4f5c15
|
|
| BLAKE2b-256 |
741a0eef00710acdbb2978986103ec665708a99343f95e15d10776e0d5f2bc97
|
Provenance
The following attestation bundles were made for docs_output_filter-0.3.3.tar.gz:
Publisher:
publish.yml on ianhi/docs-output-filter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docs_output_filter-0.3.3.tar.gz -
Subject digest:
b2ffb98274d84b728bc5dc38897aeda09c6a09eae984a7cb01f1ce1071001474 - Sigstore transparency entry: 1043947669
- Sigstore integration time:
-
Permalink:
ianhi/docs-output-filter@355de6278199112dfc6ebb536b765fc2590c2b4a -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/ianhi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@355de6278199112dfc6ebb536b765fc2590c2b4a -
Trigger Event:
release
-
Statement type:
File details
Details for the file docs_output_filter-0.3.3-py3-none-any.whl.
File metadata
- Download URL: docs_output_filter-0.3.3-py3-none-any.whl
- Upload date:
- Size: 43.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88b5395bc8b90e2623634bfb7a70dda4a2cd5945806e9490d038d21111e3e365
|
|
| MD5 |
ee71bad83e4b66aee258536d24da9694
|
|
| BLAKE2b-256 |
5da7d38d737aa9388f66ed233585cc9222444d7ea2809b6c76649e118241adb1
|
Provenance
The following attestation bundles were made for docs_output_filter-0.3.3-py3-none-any.whl:
Publisher:
publish.yml on ianhi/docs-output-filter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
docs_output_filter-0.3.3-py3-none-any.whl -
Subject digest:
88b5395bc8b90e2623634bfb7a70dda4a2cd5945806e9490d038d21111e3e365 - Sigstore transparency entry: 1043947752
- Sigstore integration time:
-
Permalink:
ianhi/docs-output-filter@355de6278199112dfc6ebb536b765fc2590c2b4a -
Branch / Tag:
refs/tags/v0.3.3 - Owner: https://github.com/ianhi
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@355de6278199112dfc6ebb536b765fc2590c2b4a -
Trigger Event:
release
-
Statement type: