Power your agent
คำสั่งของผู้เผยแพร่เอง ไม่ใช่เอนด์พอยต์ของ PlugMCP
Host a copy with our keys and logs.
npx -y [email protected]Claude Code ไม่มีลิงก์ติดตั้งสำหรับคำสั่งแบบโลคัล ให้คัดลอกคำสั่งด้านล่างแล้วรันในเทอร์มินัล
claude mcp add mcp-trunc-proxy -- npx -y mcp-trunc-proxy@0.2.2รันในเทอร์มินัล
{ "mcpServers": { "mcp-trunc-proxy": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดA generic MCP stdio proxy that saves tokens by offloading large tools/call results to an artifact store and returning only a compact preview + a retrieval tool.
98% token reduction on large payloads. Works with any MCP server.
MCP tools like @modelcontextprotocol/server-filesystem, server-github, and server-fetch can return massive payloads:
When these outputs enter the conversation context, they get re-sent with every subsequent message. With 20 subagents carrying history forward, a single 200KB response costs tokens 20+ times.
Without proxy:
LLM ◄── 200KB response ── MCP Server
LLM ◄── 200KB (again, in context) ── ...
LLM ◄── 200KB (again) ── ...
Total: 200KB × N messages = massive token burn
With mcp-trunc-proxy:
LLM ◄── 3KB preview + artifact ID ── Proxy ◄── MCP Server
LLM ── "get lines 100-150" ──► Proxy ──► 2KB slice
Total: 3KB + targeted retrievals = 98% savings
The proxy:
Tested against simulated payloads matching real MCP server outputs:
Average: 98.1% token reduction
Compression: ~50 MB/s compress, ~200 MB/s decompress (gzip)
# Install globally
npm install -g mcp-trunc-proxy
# Wrap any MCP server
mcp-trunc-proxy -- npx -y @modelcontextprotocol/server-filesystem /path/to/repo
# Or use npx directly (no install)
npx mcp-trunc-proxy -- npx -y @modelcontextprotocol/server-github
Claude Code uses ~/.claude/claude_desktop_config.json (same as Claude Desktop).
Location:
~/.claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonStep 1: Install the proxy
npm install -g mcp-trunc-proxy
Step 2: Edit your config to wrap existing MCPs
Before:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
After (wrapped with proxy):
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-filesystem", "/home/user/projects"
]
},
"github": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
Step 3: Restart Claude Code
Same configuration as Claude Code above.
Config location:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.jsonExample with multiple MCPs:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-filesystem", "/Users/you/code"
]
},
"fetch": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "60000", "--",
"npx", "-y", "@modelcontextprotocol/server-fetch"
]
},
"postgres": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "100000", "--store", "file:.mcp-artifacts", "--",
"npx", "-y", "@modelcontextprotocol/server-postgres"
],
"env": {
"DATABASE_URL": "postgresql://user:pass@localhost/db"
}
}
}
}
Cursor uses .cursor/mcp.json in your project root or ~/.cursor/mcp.json globally.
Step 1: Create or edit .cursor/mcp.json
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
},
"filesystem": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-filesystem", "."
]
}
}
}
Step 2: Restart Cursor or reload window
OpenCode uses mcp.json or opencode.json in your project root, or ~/.config/opencode/config.json globally.
Step 1: Edit your MCP config
{
"mcp": {
"github": {
"type": "local",
"command": ["npx", "mcp-trunc-proxy", "--max-bytes", "80000", "--", "npx", "-y", "@modelcontextprotocol/server-github"],
"environment": {
"GITHUB_TOKEN": "{env:GITHUB_TOKEN}"
}
},
"filesystem": {
"type": "local",
"command": ["npx", "mcp-trunc-proxy", "--max-bytes", "80000", "--", "npx", "-y", "@modelcontextprotocol/server-filesystem", "."]
},
"fetch": {
"type": "local",
"command": ["npx", "mcp-trunc-proxy", "--max-bytes", "60000", "--", "npx", "-y", "@modelcontextprotocol/server-fetch"]
}
}
}
Step 2: Restart OpenCode
Windsurf uses ~/.windsurf/config.json or .windsurf/mcp.json in your project.
Config example:
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
Cline stores MCP config in VS Code settings or .vscode/cline_mcp_settings.json.
Step 1: Open VS Code settings (JSON)
Step 2: Add MCP servers:
{
"cline.mcpServers": {
"github": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
},
"filesystem": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-filesystem", "${workspaceFolder}"
]
}
}
}
Or use .vscode/cline_mcp_settings.json:
{
"mcpServers": {
"github": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
Continue uses ~/.continue/config.json.
Step 1: Edit ~/.continue/config.json
{
"mcpServers": [
{
"name": "github",
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
},
{
"name": "filesystem",
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-filesystem", "/path/to/project"
]
}
]
}
Step 2: Reload Continue extension
Zed uses ~/.config/zed/settings.json.
Add to your settings:
{
"language_models": {
"mcp_servers": {
"github": {
"command": "npx",
"args": [
"mcp-trunc-proxy", "--max-bytes", "80000", "--",
"npx", "-y", "@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_TOKEN": "ghp_xxxxxxxxxxxx"
}
}
}
}
}
If you're building a custom MCP client, wrap the server spawn:
import { spawn } from "child_process";
// Instead of:
const server = spawn("npx", ["-y", "@modelcontextprotocol/server-github"]);
// Use:
const server = spawn("npx", [
"mcp-trunc-proxy",
"--max-bytes", "80000",
"--",
"npx", "-y", "@modelcontextprotocol/server-github"
]);
Copy and paste this prompt into your AI tool to automatically set up mcp-trunc-proxy with optimized settings for each MCP:
I want you to wrap all my existing MCP servers with mcp-trunc-proxy to reduce token usage.
## What is mcp-trunc-proxy?
An npm package that intercepts large MCP tool outputs, stores them compressed, and returns a compact preview with a retrieval tool. Reduces token usage by ~98% for large responses.
## Your Task
### Phase 0: Prerequisites
1. **Check if mcp-trunc-proxy is installed globally:**
```bash
npm list -g mcp-trunc-proxy
```
2. **If NOT installed, install it globally** (faster startup, no npx overhead):
```bash
npm install -g mcp-trunc-proxy
```
3. **Verify installation:**
```bash
mcp-trunc-proxy --version
# Should output version number like "1.x.x"
```
4. **If global install fails** (permissions, corporate proxy, etc.), fall back to npx:
- The prompt will still work with `npx mcp-trunc-proxy`
- Just slightly slower startup per MCP
### Phase 1: Discovery
5. **Find my MCP configuration file** (check in order, use first found):
- Claude Desktop/Code: ~/.claude/claude_desktop_config.json or %APPDATA%\Claude\claude_desktop_config.json
- Cursor: .cursor/mcp.json or ~/.cursor/mcp.json
- OpenCode: mcp.json or opencode.json or ~/.config/opencode/config.json or ~/.config/opencode/opencode.json
- Cline: .vscode/cline_mcp_settings.json
- Continue: ~/.continue/config.json
- Zed: ~/.config/zed/settings.json
- Windsurf: ~/.windsurf/config.json or .windsurf/mcp.json
6. **Read the config and analyze each MCP server**
7. **Detect my operating system** (Windows requires special handling)
### Phase 2: Configuration
8. **For each MCP, choose optimal --max-bytes based on this table:**
| MCP Server Pattern | --max-bytes | Reason |
|--------------------|-------------|--------|
| server-filesystem, filesystem | 80000 | Directory listings can be huge |
| server-github, github | 80000 | PR comments, issues, file trees |
| server-gitlab, gitlab | 80000 | Similar to GitHub |
| server-fetch, fetch, puppeteer, playwright | 60000 | Web pages vary, often moderate |
| server-postgres, postgres, server-sqlite, sqlite, server-mysql, mysql, database, db, supabase, prisma | 120000 | Query results can be massive |
| server-brave-search, search, tavily, exa | 50000 | Search results are moderate |
| server-memory, memory, knowledge | 40000 | Usually smaller payloads |
| server-slack, slack, discord | 60000 | Message history moderate |
| server-notion, notion | 80000 | Page content can be large |
| server-google-drive, gdrive, drive | 100000 | File listings and content |
| server-aws, aws, s3 | 100000 | Listings can be large |
| server-kubernetes, k8s | 80000 | Resource listings |
| server-docker | 60000 | Container/image lists |
| everything-else | 80000 | Safe default |
9. **Additional optimizations based on MCP type:**
- Database MCPs: Add `--store file:.mcp-artifacts` for persistence (queries worth caching)
- Filesystem MCPs with large repos: Consider `--max-bytes 100000`
- Search MCPs: Can use lower `--max-bytes 40000` (results are summarized)
10. **Transform each MCP entry:**
If mcp-trunc-proxy is installed globally, use direct command (preferred):
```json
{
"command": "mcp-trunc-proxy",
"args": [
"--max-bytes", "120000",
"--store", "file:.mcp-artifacts",
"--",
"npx", "-y", "@modelcontextprotocol/server-postgres"
],
"env": { "DATABASE_URL": "..." }
}
```
If using npx (fallback):
```json
{
"command": "npx",
"args": [
"mcp-trunc-proxy",
"--max-bytes", "120000",
"--store", "file:.mcp-artifacts",
"--",
"npx", "-y", "@modelcontextprotocol/server-postgres"
],
"env": { "DATABASE_URL": "..." }
}
```
11. **Preserve all existing environment variables and arguments**
12. **Save the updated config file**
### Phase 3: Verification (MANDATORY - DO NOT SKIP)
13. **Dry-run test EVERY enabled MCP** before telling me to restart:
```bash
# For each MCP, run with timeout (10-15 seconds)
# Use mcp-trunc-proxy directly if installed globally:
timeout 10 mcp-trunc-proxy --max-bytes <N> -- <downstream-command> 2>&1
# Or with npx:
timeout 10 npx mcp-trunc-proxy --max-bytes <N> -- <downstream-command> 2>&1
# Success: Shows "Proxy started..." or waits silently for input
# Failure: Shows error (spawn ENOENT, spawn EINVAL, ETIMEDOUT, etc.)
```
14. **If a test fails, diagnose and fix:**
| Error | Cause | Fix |
|-------|-------|-----|
| `spawn ENOENT` | Command not found | Use absolute path or check package installed |
| `spawn EINVAL` | Windows .cmd script issue | Use `node` + JS entry point (see below) |
| `ETIMEDOUT` | npx download too slow | Pre-install globally: `npm install -g <pkg>` |
| `Cannot find module` | Package not installed | `npm install -g <package>` |
15. **Windows .cmd fix pattern:**
When a command like `playwriter` or `serverless` fails with `spawn EINVAL` on Windows:
```bash
# Step 1: Find entry point
npm root -g # Get global node_modules path
# Then check: <npm-root>/<package>/package.json for "bin" field
# Step 2: Convert command to node + entry point
# Before: ["playwriter"]
# After: ["node", "C:\\path\\to\\node_modules\\playwriter\\bin.js"]
```
16. **Re-test after each fix** until the MCP passes
17. **Present final verification table:**
```
## MCP Proxy Verification Results
| MCP Name | Status | Command | Issue | Fix Applied |
|----------|--------|---------|-------|-------------|
| github | ✅ PASS | npx ... server-github | - | - |
| filesystem | ✅ PASS | npx ... server-filesystem | - | - |
| playwriter | ✅ PASS | node .../bin.js | spawn EINVAL | node + entry point |
| morph-mcp | ✅ PASS | node .../dist/index.js | wrong binary name + EINVAL | fixed name + node |
| serverless | ✅ PASS | node .../run.js mcp | spawn EINVAL | node + entry point |
### Summary
- Total MCPs: 5
- Passed: 5
- Fixed: 3
- Still Failing: 0
```
18. **Only after ALL MCPs pass**, tell me to restart my application
### Phase 4: Completion
19. **Show configuration summary:**
| MCP Name | --max-bytes | --store | Notes |
|----------|-------------|---------|-------|
| ... | ... | ... | ... |
20. **Tell me to restart** (only after Phase 3 passes completely)
## Important Rules
- ALWAYS check/install mcp-trunc-proxy globally first (faster, more reliable)
- Do NOT modify MCPs already wrapped with mcp-trunc-proxy
- Do NOT skip the verification phase
- Do NOT report success until ALL MCPs pass dry-run tests
- If an MCP keeps failing after 3 fix attempts, ask me if I want to disable it
- If unsure about an MCP type, use --max-bytes 80000 (safe default)
## Platform-Specific Notes
### Windows
- `.cmd` and `.bat` scripts WILL fail with `spawn EINVAL` when spawned through the proxy
- ALWAYS convert to `node` + JavaScript entry point for Node.js packages
- Use `\\` for path separators in JSON, or `/` which Node.js accepts
- PATH inheritance is unreliable - prefer absolute paths
### macOS/Linux
- Most commands work directly
- If using nvm/volta, ensure the shell has the right Node version
- uvx/pipx commands usually work fine
### Common Package Entry Points
| Package | Entry Point |
|---------|-------------|
| playwriter | `<npm-root>/playwriter/bin.js` |
| @morphllm/morphmcp | `<npm-root>/@morphllm/morphmcp/dist/index.js` |
| serverless | `<npm-root>/serverless/run.js` (+ `mcp` arg) |
| @anthropic/mcp-server-puppeteer | `<npm-root>/@anthropic/mcp-server-puppeteer/dist/index.js` |
Client ── tools/call ──► Proxy ──► MCP Server
Client ◄── response ──── Proxy ◄── MCP Server
Client ── tools/call ──────────────► Proxy ──► MCP Server
│
▼
Store full payload (gzip)
│
Client ◄── preview + artifact ID ◄─────┘
When a tool returns a large result, the agent sees:
═══ RESULT OFFLOADED ═══
artifact=art_abc123 bytes=245760 lines=3847
══ Errors/Warnings (12 found) ══
line 847: ERROR: Connection refused
line 1203: FAIL: assertion failed
line 2341: Exception: NullPointerException
...
══ Head (first 60 lines) ══
Starting build process...
Compiling src/main.ts...
...
══ Tail (last 60 lines) ══
...
Build completed with 3 errors.
Total time: 45.2s
═══ RETRIEVAL ═══
Use proxy_artifact_get to fetch specific content:
• grep: {"id":"art_abc123", "mode":"grep", "pattern":"ERROR"}
• range: {"id":"art_abc123", "mode":"range", "startLine":800, "endLine":900}
• tail: {"id":"art_abc123", "mode":"tail", "tailLines":100}
The proxy injects proxy_artifact_get into tools/list:
// Grep for errors (substring or regex)
{"id": "art_abc123", "mode": "grep", "pattern": "ERROR", "maxLines": 200}
{"id": "art_abc123", "mode": "grep", "pattern": "/TypeError:.*/i"}
// Get specific line range
{"id": "art_abc123", "mode": "range", "startLine": 1200, "endLine": 1350}
// Get last N lines
{"id": "art_abc123", "mode": "tail", "tailLines": 200}
// Full content (use sparingly - defeats the purpose)
{"id": "art_abc123", "mode": "full"}
All flags have env var equivalents (CLI takes precedence):
MCP_TRUNC_PROXY_MAX_BYTES=60000
MCP_TRUNC_PROXY_STORE=file:.artifacts
MCP_TRUNC_PROXY_LOG_LEVEL=debug
mcp-trunc-proxy --store memory -- ...
mcp-trunc-proxy --store file:.mcp-artifacts -- ...
npm install redis # Optional dependency
mcp-trunc-proxy --store redis://localhost:6379 --ttl-seconds 86400 -- ...
--max-bytesIf you see errors like Connection closed (-32000) or Operation timed out after wrapping MCPs with the proxy, the issue is usually not the proxy itself but slow-starting downstream servers.
npx -y package@latestUsing npx -y package@latest inside the proxy command causes double startup delay:
npx -y package@latest which downloads the package every timeMany MCP clients (Claude Desktop, OpenCode, Cursor) have a 30-second connection timeout. If download + startup exceeds this, the connection fails.
# Install problematic packages globally
npm install -g playwriter @morphllm/morphmcp @anthropic/mcp-server-puppeteer
# Then update config to use the global command directly
Before (slow - downloads every time):
{
"command": ["npx", "mcp-trunc-proxy", "--max-bytes", "60000", "--",
"npx", "-y", "playwriter@latest"]
}
After (fast - uses pre-installed package):
{
"command": ["npx", "mcp-trunc-proxy", "--max-bytes", "60000", "--",
"playwriter"]
}
To confirm the proxy isn't the issue, temporarily remove it:
// Test: Does the MCP work WITHOUT the proxy?
{ "command": ["npx", "-y", "playwriter@latest"] }
// If this also times out, the issue is npx download time, not the proxy
Some MCP servers are genuinely slow to initialize (e.g., serverless mcp loads AWS SDK). The 30-second timeout is enforced by the MCP client (Claude Desktop, OpenCode, etc.), not by mcp-trunc-proxy.
Options:
After making changes:
# Test the full command manually
npx mcp-trunc-proxy --max-bytes 60000 -- playwriter
# Should output: "Proxy started, waiting for JSON-RPC..."
Windows has unique challenges when spawning processes through the proxy.
spawn EINVAL or spawn ENOENT on WindowsSymptom: MCPs fail with spawn EINVAL or spawn ENOENT even though the command works in terminal.
Root Cause: Node.js spawn() on Windows cannot directly execute .cmd/.bat scripts when invoked through the proxy's subprocess. The proxy spawns child processes without a shell wrapper.
Solution: Use node + the package's JavaScript entry point directly instead of the .cmd wrapper.
Step 1: Find the package's entry point
# Find where the package is installed
npm root -g
# Example output: C:\Users\YourName\scoop\persist\nodejs\bin\node_modules
# Check the package.json for "bin" entry
cat <npm-root>\<package>\package.json | Select-String '"bin"' -Context 0,3
Step 2: Update your config to use node + entry point
Before (fails on Windows):
{
"command": ["npx", "mcp-trunc-proxy", "--max-bytes", "60000", "--", "playwriter"]
}
After (works on Windows):
{
"command": [
"npx", "mcp-trunc-proxy", "--max-bytes", "60000", "--",
"node", "C:\\Users\\YourName\\scoop\\persist\\nodejs\\bin\\node_modules\\playwriter\\bin.js"
]
}
Symptom: Commands work in terminal but fail when spawned by the proxy.
Root Cause: Package managers like Scoop, NVM, or Volta modify PATH in shell profiles, but the proxy's subprocess may not inherit the full PATH.
Solution: Use absolute paths to executables:
{
"command": [
"npx", "mcp-trunc-proxy", "--max-bytes", "60000", "--",
"node", "C:\\absolute\\path\\to\\package\\entry.js"
]
}
# Generic method to find any package's entry point
npm root -g # Get global node_modules path
# Then check the package's package.json for "bin" or "main"
cat "<npm-root>/<package>/package.json"
# Look for:
# "bin": { "command-name": "./path/to/entry.js" }
# or
# "main": "./dist/index.js"
The proxy provides several tools and methods to inspect stored artifacts and debug behavior.
The proxy injects three tools (all enabled by default):
Use proxy_artifact_list to see what's currently stored:
// List artifacts (default: 20, max: 100)
{"tool": "proxy_artifact_list", "arguments": {}}
{"tool": "proxy_artifact_list", "arguments": {"limit": 50}}
Response:
{
"total": 3,
"returned": 3,
"artifacts": [
{
"id": "art_abc123",
"toolName": "filesystem",
"originalBytes": 245760,
"bytesStored": 12345,
"createdAt": "2025-01-08T12:34:56.789Z",
"expiresAt": "2025-01-15T12:34:56.789Z"
},
...
]
}
Use proxy_artifact_info to inspect a specific artifact:
{"tool": "proxy_artifact_info", "arguments": {"id": "art_abc123"}}
Response:
{
"id": "art_abc123",
"store": "memory",
"meta": {
"toolName": "filesystem",
"requestId": 42,
"originalBytes": 245760,
"storedAt": "2025-01-08T12:34:56.789Z",
"bytesStored": 12345,
"kind": "tools/call.result"
},
"createdAt": "2025-01-08T12:34:56.789Z",
"lastAccess": "2025-01-08T12:35:10.123Z",
"expiresAt": "2025-01-15T12:34:56.789Z",
"bytesStored": 12345
}
Enable verbose logging to see all artifact operations:
mcp-trunc-proxy --log-level debug --max-bytes 60000 -- <your-mcp-server>
Log levels:
silent - No outputerror - Only errorswarn - Errors + warningsinfo - Default, includes startup messagesdebug - Verbose, shows all operationsExample debug output:
[mcp-trunc-proxy] info: mcp-trunc-proxy started: maxBytes=60000 store=memory tool=proxy_artifact_get infoTool=proxy_artifact_info
[mcp-trunc-proxy] debug: storing artifact art_abc123 (245760 bytes -> 12345 compressed)
[mcp-trunc-proxy] debug: retrieved artifact art_abc123 (mode=grep, pattern=error)
For easier debugging, use file-based storage to inspect artifacts directly:
mcp-trunc-proxy --store file:.mcp-artifacts --max-bytes 60000 -- <server>
Then browse the artifacts directory:
# List stored artifacts
ls .mcp-artifacts/
# Inspect a specific artifact (files are gzipped JSON)
zcat .mcp-artifacts/art_abc123.json.gz | jq .
# Or on Windows with PowerShell
$content = [System.IO.File]::ReadAllBytes(".mcp-artifacts\art_abc123.json")
$stream = New-Object System.IO.MemoryStream(,$content)
$gzip = New-Object System.IO.Compression.GzipStream($stream, [System.IO.Compression.CompressionMode]::Decompress)
$reader = New-Object System.IO.StreamReader($gzip)
$reader.ReadToEnd() | ConvertFrom-Json
# Enable debug logging via env var
MCP_TRUNC_PROXY_LOG_LEVEL=debug
# Use file store for inspection
MCP_TRUNC_PROXY_STORE=file:.mcp-debug-artifacts
# Lower threshold to trigger more offloading (for testing)
MCP_TRUNC_PROXY_MAX_BYTES=10000
Tool outputs can contain secrets (tokens, env vars, credentials).
The proxy includes:
npm test # Unit + functional tests (141 tests)
npm run test:e2e # End-to-end tests
npm run test:all # Everything
npm run benchmark # All benchmarks
npm run benchmark:tokens # Token reduction benchmark
npm run benchmark:perf # Performance benchmark
# Terminal 1: Proxy with fake MCP server
node src/cli.mjs --max-bytes 20000 -- node examples/fake-mcp-server.mjs
# Terminal 2: Send test requests
node examples/demo-client.mjs
This proxy is a drop-in solution that works with any MCP server without modifications.
npm run test:allGPL-3.0-only. See LICENSE.
Marco Jardim - GitHub
See CHANGELOG.md for version history.
Generic MCP stdio proxy that offloads large tools/call results to an artifact store (memory by default) and returns small previews + retrieval tool.
{ "mcpServers": { "mcp-trunc-proxy": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
MCP Trunc Proxy ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-11-13 Generic MCP stdio proxy that offloads large tools/call results to an artifact store (memory by default) and returns small previews + retrieval tool.