mcp-scripting

mcp-scripting is a skill for Claude Code from nicobailon/pi-mcp-adapter. It costs 21 tokens per session (1,060 once invoked), scanned A, original, MIT.

A guide for writing JavaScript scripts that discover, inspect, and call tools provided through the Model Context Protocol (MCP), a standard way for an agent to use external tools.

In plain words
What is it for?
Use it to find matching tools, inspect their exact interfaces, call them with data from earlier results, run several calls in parallel, and return structured outcomes.
Why use it?
It makes multi-step tool work easier to organize, including loops, filtering, chained calls, and handling failed calls.

Skill for Claude Code

Written for Claude Code: disable-model-invocation in frontmatter.

Good fit Use it to find matching tools, inspect their exact interfaces, call them with data from earlier results, run several calls in parallel, and return structured outcomes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nicobailon/pi-mcp-adapter/mcp-scripting
About the project

Pi MCP Adapter is a proxy that lets the Pi coding agent use MCP servers without loading all of their tool definitions into its context at once. MCP servers provide connected tools such as databases, browsers, and APIs, and the adapter discovers and starts them only when needed. Its catalogue skill supplies the workflow for using this adapter with Pi.

nicobailon/pi-mcp-adapter · 1,435 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add nicobailon/pi-mcp-adapter --skill mcp-scripting
Clone the repo
git clone --depth 1 https://github.com/nicobailon/pi-mcp-adapter

Made for: Claude Code.

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 mcp-scripting

README.md
[![agentmods](https://agentmods.dev/badge/skills/nicobailon/pi-mcp-adapter/mcp-scripting/github.svg)](https://agentmods.dev/skills/nicobailon/pi-mcp-adapter/mcp-scripting)
Your own site
<a href="https://agentmods.dev/skills/nicobailon/pi-mcp-adapter/mcp-scripting"><img src="https://agentmods.dev/badge/skills/nicobailon/pi-mcp-adapter/mcp-scripting/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 mcp-scripting

Your own site · 80×15
<a href="https://agentmods.dev/skills/nicobailon/pi-mcp-adapter/mcp-scripting"><img src="https://agentmods.dev/badge/skills/nicobailon/pi-mcp-adapter/mcp-scripting.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,060 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
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.01060
Opus 5 $0.00010 $0.00530
Sonnet 5 $0.00004 $0.00212
Haiku 4.5 $0.00002 $0.00106

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

Security

Grade A, and why

mcp-scripting scanned grade A with 0 findings 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 3d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/mcp-scripting/SKILL.md · 50 lines

How it starts

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

MCP scripting

For multi-call MCP work, write ordinary JavaScript with loops, filtering, chaining, fan-out, or other logic between calls. Run that source with mcpScript; it is the primary MCP orchestration surface. For a single MCP search, describe, status check, auth action, or tool call, use mcp instead.

Write the source naturally, then pass it as mcpScript's code argument:

const { items } = await tools.search({ query: "search issues", server: "github" });
const candidate = items[0];
if (!candidate) return { error: "No matching tool" };

const details = await tools.describe({ path: candidate.path });
if (details.error) return details;

const result = await tools.call(details.path, { query: "is:open label:bug" });
if (!result.ok) return result;
emit({ tool: details.path, completed: true });
return result.data;

Workflow

  1. Find candidate tools with await tools.search({ query, server?, limit?, offset? }).
  2. Inspect the exact returned path with await tools.describe({ path }).
  3. Call it with tools.call(path, args).

Descriptors include inputTypeScript (a compact parameter shape, or formatted schema fallback). When a compact shape would omit documented fields, inputGuidance preserves their descriptions, including formats and units. Undocumented inputs stay compact.

When advertised by the server, outputSchema is the original JSON Schema and outputSchemaTarget is "data.structuredContent": it describes structured output inside the successful { ok: true, data } call envelope, not the envelope itself. Inspect this schema for result fields and constraints; unsupported constructs remain intact rather than being presented as an approximate TypeScript type. Both output fields are absent when no output schema is advertised. Discovery and cache refresh preserve these optional schemas; old cache entries gain them on the next server metadata refresh. Ordinary search results do not include schemas.

Calls resolve to { ok: true, data } or { ok: false, error }; handle failed calls instead of expecting them to stop the script. emit(value) adds user-visible output before the final return value. console output is captured too.

Read the full file on GitHub · 50 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. 3d ago Changed · +8 lines d70b732e0ea2
  2. 4d ago Changed · +2 lines b926892cde18
  3. 7d ago Changed · +1 lines 99484966a21d
  4. 10d ago First seen · 39 lines · 21 tokens per session scan A d33016aeb01d

Subscribe to this mod's changes

mcp-scripting is a skill published in the GitHub repository nicobailon/pi-mcp-adapter (1,435 stars, last pushed 3d ago), licensed MIT. It adds 21 tokens to every session and 1,060 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. 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

pi

Use when needing a minimal, extensible terminal AI coding agent harness in TypeScript with plugin architecture. Pi: minimalist terminal AI coding agent emphasizing simplicity and composability.

znlgis/opengis-skills · 35 tokens

ask-user

Use askuser as a decision, research, and requirements gate before ambiguous or high-stakes choices.

eko24ive/pi-ask · 23 tokens

optimization

Use when improving performance, latency, throughput, memory usage, or general efficiency. Start by defining target metrics, measuring comprehensively, attributing bottlenecks, validating with static analysis, and prioritizing macro-optimizations before micro-optimizations.

1jehuang/jcode · 52 tokens

tmux-manual-qa

Run a single manual tmux-based QA scenario for the todo continuation feature against the real CLI (./pi-test.sh) in an interactive TUI. Captures scrollback, asserts deterministic pass/fail count markers, and cleans up test fixtures. Use only for the manual-qa milestone features.

code-yeongyu/senpi · 66 tokens

coding-agent-extension-worker

Implements a single feature in the pi-mono todotools builtin extension work. Use for refactoring, continuation runtime, config resolver, prompt builder, test authoring, golden snapshots, CHANGELOG entries, and harness helpers. Does NOT do manual tmux QA.

code-yeongyu/senpi · 61 tokens

gpt-image-gen

MUST read before generating images. Detailed prompt-crafting guide for gpt-image models, covering tool routing (native imagegeneration server tool vs the generateimage tool), prompt structure from subject to background, verbatim text rendering, anti-patterns, and the revisedprompt feedback loop for iteration.

code-yeongyu/senpi · 63 tokens