ContextSkeleton
An MCP server that folds function and class implementations into structural skeletons while preserving signatures, interfaces, and docstrings, reducing tokens by up to 90%+ for AI agents. Exposes tools to get repository skeletons, unfold specific symbols on demand, and retrieve exact token and prompt cost savings metrics.
README
⚡ ContextSkeleton
Zero-latency Structural Code Folding CLI, Model Context Protocol (MCP) Server & Token Optimizer for AI Agents (Cursor, Claude Code, Windsurf, AGY).
ContextSkeleton folds function and class implementations while preserving top-level signatures, interface definitions, exported types, and docstrings across JavaScript, TypeScript, Python, Go, and C-style languages.
Token reduction scales with function size and implementation depth — typically 0% on trivial 1-2 line utility functions (comment-marker overhead exceeds the savings), 45-70% on production-sized modules with substantial function bodies, and up to 90%+ on large, implementation-heavy files. Across our internal benchmark set spanning small, medium, and large files in TypeScript, Python, Go, and Rust, the blended average was 67%.
🚀 Quick Start
1. Run CLI Scan
Scan your project to view code compression and token savings metrics:
npx context-skeleton scan
2. Copy Formatted Context for AI Chat Prompts
Dump the compressed skeleton context directly to stdout for Cursor, Claude Code, or Windsurf:
npx context-skeleton copy > context.md
3. Add to PRs & .cursorrules / CLAUDE.md
Inject automated token-savings badges into your repository:
npx context-skeleton badge
🤖 Model Context Protocol (MCP) Integration
Integrate ContextSkeleton natively with Claude Code, Cursor, or AGY agents.
Add to your claude_desktop_config.json or .cursorrules:
{
"mcpServers": {
"context-skeleton": {
"command": "npx",
"args": ["-y", "context-skeleton-mcp"]
}
}
}
Exposed MCP Tools:
get_repo_skeleton: Returns folded structural skeleton of target repository.unfold_symbol: Retrieves exact implementation of a specific function or class on demand.get_token_savings: Returns exact token & prompt cost savings metrics.
📊 Features & Benchmarks
| Feature | Raw Codebase | With ContextSkeleton | Benefit |
|---|---|---|---|
| Blended Benchmark (9 files) | 6,183 tokens | 2,028 tokens | 67.2% Blended Savings |
| Production Modules (88-135 lines) | ~550 tokens / file | ~220 tokens / file | 45% to 70% Reduction |
| Large Files (500+ lines) | 2,963 tokens | 236 tokens | 92.0% Reduction |
| Syntax Errors | Common (unpruned) | 0% (Valid Signatures) | Syntactically intact |
Note: Token reduction scales with function size and implementation depth — typically 0% on trivial 1-2 line utility functions (comment-marker overhead exceeds the savings), 45-70% on production-sized modules with substantial function bodies, and up to 90%+ on large, implementation-heavy files. Across our internal benchmark set spanning small, medium, and large files in TypeScript, Python, Go, and Rust, the blended average was 67%.
💻 Tech Stack ($0 Infra Cost)
- Engine: Zero-dependency Node.js Structural Signature Pruner & Token Counter
- MCP Server: Stdio JSON-RPC 2.0
- Web App: Single-Source HTML5 + Modern CSS + Pure JS
📄 License
MIT License © 2026 ContextSkeleton
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.