auto-script-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@auto-script-mcpsave a reusable script to batch rename all .md files to .mdx"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
auto-script-mcp
Self-generating, zero-token script registry and execution middleware for AI coding agents.
When AI coding agents (Cline, Roo Code, Cursor, Continue) do multi-step file manipulation, data processing, or batch operations, they burn tokens and latency doing work a local script could do in one shot. auto-script-mcp is a Model Context Protocol server that acts as a deterministic execution layer:
Every saved script is exposed to the agent as a native MCP tool —
script_<name>— with a real JSON Schema for its arguments.When no existing script fits a repetitive task, the agent writes one, and persists it with the built-in
save_scripttool. The new tool is mounted live (notifications/tools/list_changed) — no server restart, and it survives into every future session.Execution happens in a local subprocess (Node.js / TypeScript / Python). The agent pays tokens for one tool call instead of the whole operation.
┌────────────────────────────────┐
│ Client AI Agent (VS Code) │
│ (Cline, Roo, Cursor, Continue) │
└───────────────┬────────────────┘
│ JSON-RPC over stdio
▼
┌──────────────────────────────────────────────────────────┐
│ auto-script-mcp Server │
│ Dynamic Tool Registry Built-in MCP Tools │
│ └─ script_<script_name> ├─ save_script │
│ ├─ list_scripts │
│ └─ delete_script │
└────────┬───────────────────────────────┬─────────────────┘
▼ ▼
Exec Subprocess Storage Layer
(Node.js / Python, - SQLite index (index.db)
timeout + truncation) - Local `.scripts/` filesQuick start
npm install -g auto-script-mcp # or run from a clone: npm install && npm run buildWire it into your agent
Cline / Roo Code (mcpServers in settings):
{
"mcpServers": {
"auto-script": {
"command": "node",
"args": ["/path/to/auto-script-mcp/dist/index.js"],
"env": {}
}
}
}Cursor (.cursor/mcp.json) and Continue use the same mcpServers shape.
On connect, the server also serves its playbook as server instructions and as the auto-script-instructions prompt:
Always review registered tools before executing multi-file operations. If no script matches the current task, create a reusable script, test it locally, and persist it via
save_script.
Related MCP server: TokenLighten
How it works
You ask for a repetitive or bulk task in VS Code.
The agent checks its tools — including every dynamic
script_*tool.Match found → agent calls
script_<name>(args); the server runs the subprocess and returns{ success, stdout, stderr, duration_ms }. Tokens saved.No match → agent writes a script, verifies it locally, calls
save_script(...). The server syntax-checks it (dry-run), writes it to disk, indexes it in SQLite, emitstools/list_changed, and the new tool is available immediately — and on every future launch.
Tools
Built-in
Tool | What it does |
| Validate + persist a script and mount it live as |
| List all registered scripts across both scopes with schemas. |
| Remove a script's file + index entry and unmount its tool. |
Dynamic — script_<name>
One per saved script. Accepts exactly the arguments in that script's input_schema and returns:
{ "success": true, "stdout": "...", "stderr": "", "duration_ms": 42, "exit_code": 0 }The script contract
Scripts receive their arguments three ways — use whichever is natural:
argv[2](JS/TS) /sys.argv[1](Python) — a JSON string of the args objectstdin — the same JSON string
SCRIPT_ARGS_JSONenvironment variable
Print results to stdout; exit 0 on success, non-zero on failure. Examples in examples/ (batch_json_transform.js, sync_db_schema.py).
Storage
.scripts/ # project scope: <cwd>/.scripts/
├── index.db # SQLite metadata store
└── src/
├── batch_json_transform.js
├── sync_db_schema.py
└── extract_tailwind_classes.ts
~/.config/auto-script-mcp/scripts/ # global scope, same layout
├── index.db
└── src/…CREATE TABLE IF NOT EXISTS scripts (
id TEXT PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
description TEXT NOT NULL,
language TEXT NOT NULL,
input_schema TEXT NOT NULL,
file_path TEXT NOT NULL,
scope TEXT NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP
);Project scope wins on a name collision. On boot the server scans both stores and mounts every script it finds.
Safety & guardrails
Execution timeout — subprocesses are killed after 30s by default (
--timeout-msflag orAUTO_SCRIPT_TIMEOUT_MSenv to change; SIGTERM, then SIGKILL).Path sanitization — script names must match
^[a-z0-9_]+$; no traversal, no separators.Output truncation — stdout/stderr returned to the agent are capped at 8 KB so a chatty script can't blow the context window it exists to protect. Capture is also hard-capped in memory.
Dry-run validation —
save_scriptparses/checks syntax (node --check, TypeScript compiler diagnostics,py_compile) before anything is written to disk. Invalid code never becomes a tool.Scripts run with your user's permissions, in the project cwd — same trust model as the agent's own terminal. Only save scripts you'd run yourself.
Server options
auto-script-mcp [--project-dir <path>] [--global-dir <path>] [--timeout-ms <n>]
# Env equivalents: AUTO_SCRIPT_PROJECT_DIR, AUTO_SCRIPT_GLOBAL_DIR,
# AUTO_SCRIPT_TIMEOUT_MS, PYTHON_BINDevelopment
npm install
npm run build
npm test # end-to-end: real MCP client ↔ server — save, mount, run (JS/TS/Python), persist, timeout, truncation, deleteRoadmap
HTTP transport (stdio today)
Per-script permission prompts / allowlist for destructive scripts
Script versioning + usage stats (which scripts actually save the most calls)
Import/export packs of scripts between machines
License
MIT © Andrew Edouard
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
The OpenRouter for tools. One MCP connection gives any AI agent 254 hosted tools, pay per call.
Pay-per-use tool marketplace for AI agents. Search, price-check, and call APIs via MCP.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables AI agents to manage processes via structured MCP tools, reducing token usage by 75-80% compared to shell commands.2MIT
- FlicenseNot gradedqualityAmaintenanceLocal-first MCP toolkit that provides coding agents focused repository context via read_file, search_files, and edit_file tools, reducing token usage and task cost.1-
- AlicenseBqualityCmaintenanceEnables AI agents to run shell commands, execute Python code, read and write files, search text, and create or delete folders through MCP stdio tools.9MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to expose and control local and self-hosted tools via MCP, with isolated workers, long-running task management, persisted state, and modular integrations for reverse engineering and development workflows.MIT