feat: add pith-skill context compression server optimized for Windows#4404
Open
VjAlbert wants to merge 7 commits into
Open
feat: add pith-skill context compression server optimized for Windows#4404VjAlbert wants to merge 7 commits into
VjAlbert wants to merge 7 commits into
Conversation
Introduces mcp-server-pith, a zero-dependency Python MCP server that compresses inter-agent payloads using Zipf word-density scoring validated by Benford's Law structural integrity check. Exposes two tools: `compress` (text output with header) and `compress_with_metadata` (JSON with token counts and Benford MAD values). Applies sys.stdout.reconfigure(encoding="utf-8") at startup to prevent UnicodeEncodeError on Windows CP1252 terminals. All 7 eval cases pass (core compression, code preservation, passthrough, JSON preservation, aggressive compression, URL preservation, Benford metadata).
…th SIZE_GATE=10000
Replace legacy 'Zipf density scoring' label with accurate 'Shannon local information scoring' in server.py tool description. Rewrite README 'How it Works' section to reflect v2 pipeline: SIZE_GATE, Shannon LUT, filler pre-pass, polarity checksum, Benford gate, XML receptor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace LOG_CACHE static lookup with @functools.lru_cache(maxsize=8192) on _log2; update README docs to reflect lru_cache approach; 22/22 tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR introduces Pith-Skill, an MCP server written in Python and heavily optimized for Windows environments. It bridges the gap in high-context development sessions by introducing an aggressive, token-aware context compression engine that mitigates token bloat during heavy LLM analysis loops.
Key Features & Windows Optimizations
sys.stdout.reconfigure) to fully eliminate the disruptiveUnicodeEncodeError: 'charmap' codec can't encode character '→'bug common in Windows CP1252 environments when handling LLM-generated Unicode characters.compress.py) to prune, filter, and condense massive context logs before they hit the token limit.tests/run_evals.pyandtests/evals.json) ensuring functional parity and stability.How It Works
MCP Tools Exposed
compresscompress_with_metadataTesting Status
Tested locally inside modern Windows PowerShell terminal environments using Anthropic's recommended prompt structures. All 7 validation evals pass successfully under strict UTF-8 enforcement:
Installation
Claude Desktop (Windows):
{ "mcpServers": { "pith": { "command": "cmd", "args": ["/c", "uvx", "mcp-server-pith"] } } }