skills/using-heavy-mcps/SKILL.md
Use mcporter and jq to reduce token bloat from heavy MCPs like Sanity or Brain vault. Filter and compact tool outputs outside chat to feed only essential data back to the model.
npx skillsauth add nweii/agent-stuff using-heavy-mcpsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
When working with MCPs that return large payloads—like Sanity queries with full document content or Brain vault searches with entire file contents—you can route these calls through mcporter outside of chat, trim the output with jq, and feed only the compact result back to the model. This avoids the 20–40k token bloat that comes from loading full responses into context.
Use mcporter + jq when:
Don't use this pattern when:
The basic workflow:
bunx mcporter callbunx mcporter call 'MCP-Name.tool_name(param: "value")' | jq 'filter'
Alternative syntaxes:
# Shorthand (infers 'call' command)
bunx mcporter 'MCP-Name.tool_name(param: "value")' | jq 'filter'
# Structured JSON output (useful for error handling)
bunx mcporter call 'MCP-Name.tool_name(param: "value")' --output json | jq 'filter'
mcporter responses include built-in helpers that can replace jq for simple extractions. Choose based on your needs:
mcporter returns results wrapped in a CallResult object with helper methods:
# Extract plain text only (strips all metadata/formatting)
bunx mcporter call 'Brain.vault(action: "search", query: "portfolio")' | node -e "console.log(JSON.parse(require('fs').readFileSync(0)).result.text())"
# Get markdown format
# Similar node one-liner but calling .markdown()
# Get parsed JSON
# Similar but calling .json()
When to use: Simple text extraction, when you want markdown, or when you need the full JSON object.
Limitation: Less flexible than jq for complex filtering/transforming.
jq is a command-line JSON filter. Think of it as "grep for JSON."
Basic patterns:
# Get specific fields from each item in array
jq '[.[] | {id: ._id, title: .title}]'
# Limit to first 5 results
jq '.results[:5]'
# Extract nested field
jq '.results[] | .frontmatter.description'
# Combine: first 3 items, specific fields
jq '.results[:3] | [.[] | {path: .path, desc: .frontmatter.description}]'
# Filter by condition
jq '[.[] | select(.status == "published")]'
When to use: Precise field selection, transforming data structure, filtering by conditions, combining multiple operations.
Recommendation: Start with jq since it's more flexible and works across any JSON output, not just mcporter.
For concrete examples of using this pattern with Sanity and Brain Vault MCPs, see EXAMPLES.md.
When you need compact data mid-conversation, run the command and paste the filtered output:
User: "Can you review my portfolio projects? Here's the data:"
<paste result of mcporter + jq command>
Add mcporter commands to rules that need specific data:
## Portfolio Context
When discussing portfolio work, use this to fetch current project list:
<command>
bunx mcporter call 'Sanity Developer.query_documents(
resource: {projectId: "xyz", dataset: "production"},
query: "*[_type == \"project\"]"
)' | jq '[.[] | {title: .title, role: .role}]'
</command>
Add to your .zshrc for frequently-used queries:
alias portfolio-list='bunx mcporter call '"'"'Sanity Developer.query_documents(
resource: {projectId: "xyz", dataset: "production"},
query: "*[_type == \"project\"]"
)'"'"' | jq "[.[] | {title: .title, slug: .slug.current}]"'
Then just run: portfolio-list
Let Cursor call MCPs directly when:
The mcporter pattern is for repeatability and token efficiency, not every MCP interaction.
Set timeouts to fail fast:
# Don't wait forever for a hung MCP call
bunx mcporter call 'Brain.vault(action: "search", query: "test")' --timeout 10000
Default timeout is 30 seconds. For slow operations, increase it. For quick checks, decrease it.
Check auth before expensive queries:
# Verify authentication status
bunx mcporter config get "Sanity Developer"
# If auth is required, do it once
bunx mcporter auth "Sanity Developer"
This prevents loading huge error messages into context when auth fails.
Use --output json for programmatic error handling:
bunx mcporter call 'Brain.vault(action: "search", query: "test")' --output json
The structured envelope makes it easier to detect failures without loading full error traces into context.
Check available MCPs:
bunx mcporter list
See tool signatures and schemas:
bunx mcporter list Brain --schema
bunx mcporter list "Sanity Developer" --schema
Test without jq first:
bunx mcporter call 'Brain.vault(action: "search", query: "test")'
Then add jq filtering once you see the structure.
Format jq output for readability:
... | jq '.'
# vs compact:
... | jq -c '.'
Before (direct MCP call in chat):
After (mcporter + jq):
Savings: 95%+ reduction for typical filtered queries.
Official mcporter documentation: Available via Context7 at /steipete/mcporter
Key docs to reference:
development
Sync meetings from Granola to Obsidian — pulls notes and transcripts and imports them as formatted meeting/transcript notes. Use when the user says "sync my last granola meeting", "note for my last meeting", or asks to pull in a Granola transcript.
tools
Create a topic note grouping related notes under a common theme, with automatic backlinking to source notes. Triggers: 'group these under a topic', 'create topic note for [[A]], [[B]], [[C]]'.
data-ai
Save an archival summary of an AI conversation to Nathan's Obsidian vault, using the Thinking note template and vault folder conventions to capture intellectual journeys, key insights, and technical logs. Use when archiving a chat session to the vault.
testing
Enrich an existing meeting/interview note from its transcript, or scaffold one when only a transcript exists. Captures granular narrative, exact phrases, mechanics, casual context, and implicit signals. Run on thin auto-summary notes or transcripts that warrant close reading.