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.
git clone --depth 1 https://github.com/andreaswasita/copilot-agents-dojonpx agentmods add skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocessWrote 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.
[](https://agentmods.dev/skills/andreaswasita/copilot-agents-dojo/calling-mcp-tools-via-subprocess)<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.
<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>- NVIDIA SkillSpector warn
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]
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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00021 | $0.01364 |
| Opus 5.5 | $0.00008 | $0.00546 |
| Sonnet 5.5 | $0.00004 | $0.00273 |
| Haiku 4.5 | $0.00002 | $0.00136 |
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 3mo 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 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/callhangs 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.jsandmcp/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
powershellCopilot 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 |
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.
- 3mo ago First seen · 147 lines · 21 tokens per session scan A a0c9964a3ced
calling-mcp-tools-via-subprocess is a skill published in the GitHub repository andreaswasita/copilot-agents-dojo (56 stars, last pushed 2mo ago), licensed MIT. It adds 21 tokens to every session and 1,364 once invoked, about $0.0001 per session on Opus 5.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.
calling-mcp-tools-via-subprocess compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| calling-mcp-tools-via-subprocessandreaswasita/copilot-agents-dojo | Skill | 56 | 2mo ago | MIT | A | 21 | Claude Code, Codex |
| llm-pipelineericrisco/rsc-harness | Skill | 682 | 4d ago | MIT | A | 83 | Claude Code, Codex |
| decision-ledgerjohnrucnapier-sketch/ACGM-for-Claude-Code | Skill | 1 | 2mo ago | none | A | 99 | Claude Code |
| governance-bootstrapjohnrucnapier-sketch/ACGM-for-Claude-Code | Skill | 1 | 2mo ago | none | A | 107 | Claude Code |
| session-groundingjohnrucnapier-sketch/ACGM-for-Claude-Code | Skill | 1 | 2mo ago | none | A | 51 | Claude Code |
| truth-firstjohnrucnapier-sketch/ACGM-for-Claude-Code | Skill | 1 | 2mo ago | none | C | 120 | Claude Code |
| todosJetBrains/thinkrail | Skill | 8.5k | yesterday | Apache-2.0 | A | 58 | Claude Code, Codex |