calling-mcp-tools-via-subprocess

calling-mcp-tools-via-subprocess is a skill for Claude Code, Codex from andreaswasita/copilot-agents-dojo. It costs 21 tokens per session (1,364 once invoked), scanned A, original, MIT.

A fallback method for calling an MCP server directly as a separate process. MCP is a protocol that lets coding agents use external tools and data, while JSON-RPC over standard input and output carries the requests and responses.

In plain words
What is it for?
Use it in scripts, continuous-integration jobs, scheduled tasks, batch updates, or troubleshooting to call MCP tools directly with the required authentication.
Why use it?
It avoids a broker—the intermediary that normally connects the client to the server—when that connection hangs, times out, or behaves unreliably.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is node mcp/scripts/mcp-subprocess.js call "$BIN" get_my_deals '{"limit":10}'.

Good fit Use it in scripts, continuous-integration jobs, scheduled tasks, batch updates, or troubleshooting to call MCP tools directly with the required authentication.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/andreaswasita/copilot-agents-dojo
agentmods
npx agentmods add skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocess

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for calling-mcp-tools-via-subprocess

README.md
[![agentmods](https://agentmods.dev/badge/skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocess/github.svg)](https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocess)
Your own site
<a href="https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocess"><img src="https://agentmods.dev/badge/skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocess/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for calling-mcp-tools-via-subprocess

Your own site · 80×15
<a href="https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocess"><img src="https://agentmods.dev/badge/skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocess.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 21 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,364 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Privilege Escalation · line 59
    Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
    Fix: Remove references to credential paths. Use environment variables or secrets managers. For docs, use placeholder paths (e.g., /path/to/config). Never load .env or token files in production code paths.
  • medium MCP Rug Pull · line 52
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
  • medium MCP Rug Pull · line 65
    npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.
    Fix: Pin the version: npx @scope/[email protected]
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00021 $0.01364
Opus 5 $0.00010 $0.00682
Sonnet 5 $0.00004 $0.00273
Haiku 4.5 $0.00002 $0.00136

Measured 11d ago against content hash a0c9964a3ced, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

calling-mcp-tools-via-subprocess scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

Bypasses a flaky MCP broker by spawning the server binary directly and speaking JSON-RPC over stdio, using the dojo helpers `mcp/scripts/mcp-subprocess.js` and `mcp-subprocess.ps1`. Does NOT replace `using-mcp` for norma
optional-skills/calling-mcp-tools-via-subprocess/SKILL.md · 147 lines

How it starts

The opening of the file, as written. The whole thing — 147 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Calling MCP Tools via Subprocess Skill

Bypasses a flaky MCP broker by spawning the server binary directly and speaking JSON-RPC over stdio, using the dojo helpers mcp/scripts/mcp-subprocess.js and mcp-subprocess.ps1. Does NOT replace using-mcp for normal operation — broker is the fast path; subprocess is the reliable fallback.

When to Use

  • Broker shows the server as connected but tools/call hangs or times out.
  • Building a script (CI job, scheduled refresh, batch backfill) that needs MCP data without an IDE.
  • Deterministic agent workflows that must succeed regardless of client flakiness.
  • Diagnosing whether a problem is in the broker or in the server itself.
  • User says "broker stuck", "tools not loading", "tools_changed notice".

Prerequisites

  • The dojo helpers mcp/scripts/mcp-subprocess.js and mcp/scripts/mcp-subprocess.ps1.
  • The MCP server binary resolvable (npm install or known path).
  • Node 18+ on the path.
  • Required auth context set in env BEFORE spawning (e.g. az login, gh auth).
  • The powershell Copilot tool to run the helper.

How to Run

1. Resolve the server binary path.
2. Call the helper with binary, tool name, and JSON args.
3. Receive parsed `result.content` text.
4. Wrap recurring calls in a per-server module to keep skill code clean.
5. Cache results in-session (or to `.cache/mcp/`) since startup is 200–800ms.

Quick Reference

Helper Use from
node mcp/scripts/mcp-subprocess.js call <bin> <tool> <jsonArgs> bash / cmd / CI
Invoke-McpTool -Bin <bin> -Tool <name> -Params @{...} PowerShell
Binary location Source
~/.copilot/installed-plugins/_direct/<vendor>--<name>/dist/index.js Copilot CLI
~/.npm/_npx/<hash>/node_modules/<pkg>/dist/index.js npx cache
Global install: npm i -g <pkg> then which <pkg> Most reliable
Auth source Set before spawn
Azure / MSX az login
GitHub gh auth login OR $env:GITHUB_PERSONAL_ACCESS_TOKEN
Kubernetes Current kubeconfig context

Read the full file on GitHub · 147 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 147 lines · 21 tokens per session scan A a0c9964a3ced

Subscribe to this mod's changes

calling-mcp-tools-via-subprocess is a skill published in the GitHub repository andreaswasita/copilot-agents-dojo (53 stars, last pushed 4d ago), licensed MIT. It adds 21 tokens to every session and 1,364 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

llm-pipeline

Use when wiring several LLM calls into a production flow: typed contracts between steps, a router/gateway so 429s, timeouts and outages fail over instead of taking you down, and cost control via caching, model tiers and abort caps. NOT single-prompt wording (that is prompt-engineering), NOT a model-driven tool loop…

ericrisco/rsc-harness · 83 tokens

decision-ledger

A session record for tracking unresolved decisions and drafting them into `.governance/claims/` when they are settled. It preserves both the decision and the reason behind it.

johnrucnapier-sketch/ACGM-for-Claude-Code · 99 tokens

governance-bootstrap

A guided checklist for creating a project's governance system from scratch when no governance exists.

johnrucnapier-sketch/ACGM-for-Claude-Code · 107 tokens

session-grounding

A session-start procedure for checking the current facts, scope, and work track in a governed project before taking action.

johnrucnapier-sketch/ACGM-for-Claude-Code · 105 tokens

truth-first

A set of rules for writing technical conclusions and performing irreversible or state-changing operations. It requires evidence tied to file and line locations and restricts unsupported claims.

johnrucnapier-sketch/ACGM-for-Claude-Code · 120 tokens

todos

This chat has a shared, live TODO plan — your tasks for the conversation, which the user also edits. Read this skill and reach for the todo tools whenever a request takes more than a couple of steps. It covers the plan model (group = task, items = its steps; loose items are the user's lane), how to work it: propose…

JetBrains/thinkrail · 127 tokens