loading…
Search for a command to run...
loading…
Provides sandboxed code execution and data processing for CSVs and logs to achieve over 95% token savings. It enables secure multi-language execution and progre
Provides sandboxed code execution and data processing for CSVs and logs to achieve over 95% token savings. It enables secure multi-language execution and progressive tool disclosure to optimize LLM context usage.
A project-agnostic MCP (Model Context Protocol) server that provides 95%+ token savings through sandboxed data processing, progressive tool loading, and multi-language code execution.
Execute code in sandboxed environment:
Load tools on-demand to reduce context usage:
Process data securely before returning to context:
Works with any project that needs:
# Clone the repository
git clone https://github.com/your-repo/token-efficient-mcp.git
cd token-efficient-mcp
# Install dependencies
npm install
# Build TypeScript
npm run build
Add to your global ~/.claude.json:
{
"mcpServers": {
"token-efficient": {
"command": "srt",
"args": [
"node",
"/path/to/token-efficient-mcp/dist/index.js"
]
}
}
}
Note: The srt command provides OS-level sandboxing via sandbox-exec (macOS) or bubblewrap (Linux).
execute_codeExecute code in multiple languages with sandboxing.
// Run bash commands
execute_code({
code: "npm test",
language: "bash"
})
// Run Python scripts
execute_code({
code: "import sys; print(sys.version)",
language: "python"
})
// Run Node.js code
execute_code({
code: "console.log('Hello from Node')",
language: "node"
})
// Check health endpoint
execute_code({
code: "curl -m 3 http://localhost:8000/api/health",
language: "bash"
})
Supported Languages: python, bash, sh, node, javascript
list_token_efficient_toolsDiscover available tools with progressive disclosure.
// Level 1: Names only (100 tokens)
list_token_efficient_tools({ level: "names_only" })
// Level 2: Summaries (2K tokens)
list_token_efficient_tools({ level: "summary" })
// Level 3: Full definitions
list_token_efficient_tools({ level: "full" })
process_csvProcess CSV files with filtering and aggregation.
// Example: Find expensive stocks
process_csv({
file_path: "data/stocks.csv",
filter_expr: "price > 100 and volume > 1000000",
columns: ["symbol", "price", "volume", "change"],
limit: 10,
response_format: "summary"
})
process_logsFilter and analyze log files efficiently.
// Example: Find all errors with context
process_logs({
file_path: "logs/application.log",
pattern: "ERROR|CRITICAL",
context_lines: 2,
limit: 50,
response_format: "summary"
})
get_token_savings_reportGet optimization tips and savings potential.
// Without execute_code: Multi-turn conversation
// Agent: "Should I run npm test?" → User: "Yes" → Run → Parse output
// Estimated: 5,000+ tokens across multiple turns
// With execute_code: Single call
execute_code({ code: "npm test", language: "bash" })
// Returns: { success: true, output: "Tests passed", exit_code: 0 }
// Result: 200 tokens (98% savings)
// Without optimization: 200,000 tokens
// All 10,000 rows returned to context
// With token-efficient MCP: 2,000 tokens (99% savings)
// Only 100 filtered rows returned
// Without optimization: 500,000 tokens
// All 100,000 log lines returned
// With token-efficient MCP: 5,000 tokens (99% savings)
// Only 500 matching lines with context returned
// Traditional MCP: 150,000 tokens
// All tool definitions loaded at startup
// Token-efficient MCP: 2,000 tokens (98.7% savings)
// Tools loaded on-demand
The server uses OS-level sandboxing via srt wrapper:
# Build the project
npm run build
# Test execute_code tool
node -e "
const { exec } = require('child_process');
const code = \`echo 'Hello from test'\`;
exec(\`node dist/index.js\`, (err, stdout) => {
console.log(stdout);
});
"
# Or test directly with MCP
# The server will be loaded by Claude Code via ~/.claude.json config
The server tracks and reports:
Example response:
{
"token_metrics": {
"input_tokens": 250,
"output_tokens": 1500,
"estimated_savings_percent": 98.5
}
}
MIT License - see LICENSE file for details.
Добавь это в claude_desktop_config.json и перезапусти Claude Desktop.
{
"mcpServers": {
"token-efficient-mcp-server": {
"command": "npx",
"args": []
}
}
}