
wartoolsai
io.github.jmmana/wartoolsai
Default-Off tool runtime for AI agents: deterministic tools enabled only by preset or by name.
Documentation
Give your AI agent tools — but only the ones you turn on.
A tool runtime and MCP server for AI agents, with identical SDKs for TypeScript, Python and .NET. 62 deterministic tools, all off until you enable them.

Start in 1 minute
Nothing to clone. The MCP server runs straight from npm with the minimal preset (9 tools: time, a tiny key-value memory and the catalog); everything else stays off.
| Client | Do this |
|---|---|
| Claude Code | claude mcp add wartools -- npx -y @warlockcode/wartools-ai --preset minimal |
| Claude Desktop | Add to claude_desktop_config.json: {"mcpServers": {"wartools": {"command": "npx", "args": ["-y", "@warlockcode/wartools-ai", "--preset", "minimal"]}}} |
| Cursor / VS Code | Use the buttons above |
Python (uvx) | uvx --from warlockcode-wartools-ai wartools-ai --preset minimal |
| Docker | docker run -i --rm ghcr.io/jmmana/wartools-ai --preset minimal |
Turn on more tools when you need them: --preset research, or --enable "time.*,fs.read_file" --fs-root ./workspace. Then try these in your client:
| Paste this | What happens |
|---|---|
| "What time is it in Tokyo?" | Calls time.now |
| "Remember that my deploy day is Friday." | Stores it with kv.set; ask again later and kv.get brings it back |
| "Which tools do you have?" | catalog.search lists only what is enabled |
| "Read the file notes.txt" | Rejected with TOOL_DISABLED: fs.read_file is off until you enable it |
Try it before installing
The server is listed on Glama. There you can browse its tools and see its quality score, and test it online with the MCP Inspector.
What is this?
WarToolsAI is a catalog of 62 small, deterministic utilities for agents (clock and timezones, key-value memory, planning scratchpad, safe file access, web fetch, JSON/CSV tooling, hashing, prompt-injection scanning…). You can use it in two ways:
| How | Use it when | |
|---|---|---|
| MCP server | Run one command; Claude Code, Claude Desktop or any MCP client sees the tools | You want tools in an existing agent/client with no code |
| SDK | WarTools.create(...) + kit.execute(name, input) in Node, Python or .NET | You are building your own agent or backend |
Both expose the same tools, same inputs/outputs and same error codes; that parity is enforced by shared contract tests, not by convention.
Why Default-Off?
Most tool servers advertise everything they have. Every tool schema you send costs tokens on every request, and every tool is something the model can misuse.
WarToolsAI starts with zero tools. Nothing is registered, serialized into the model's context or executable until you enable it by name, glob or preset:
enable: ["time.now", "kv.*"] → 6 tools exposed, everything else invisible
preset: "none" (default) → 0 tools, 0 schema tokens
For scale: all the tool schemas together are roughly 3,900 tokens (approxSchemaTokens in the manifest); a typical preset is a fraction of that. A disabled tool that is called anyway returns TOOL_DISABLED; it does not run.
Install
Same version on all three registries. Pick your language:
| Registry | Package | Install | Version |
|---|---|---|---|
| npm | @warlockcode/wartools-ai | npm i @warlockcode/wartools-ai | |
| PyPI | warlockcode-wartools-ai | pip install warlockcode-wartools-ai | |
| NuGet | WarlockCode.WarToolsAI | dotnet add package WarlockCode.WarToolsAI |
Quick start
Status:
1.0.0, published on all three registries:npm i @warlockcode/wartools-ai·pip install warlockcode-wartools-ai·dotnet add package WarlockCode.WarToolsAI.
git clone https://github.com/jmmana/WarToolsAI.git && cd WarToolsAI
npm ci && npm run build:node
As an MCP server
# stdio (default), the agent-core preset
node packages/node/dist/esm/cli.js --preset agent-core
# only specific tools
node packages/node/dist/esm/cli.js --enable "time.now,kv.*,fs.read_file" --fs-root ./workspace
Claude Code
claude mcp add wartools -- node /absolute/path/WarToolsAI/packages/node/dist/esm/cli.js --preset agent-core
Claude Desktop / any MCP client (claude_desktop_config.json)
{
"mcpServers": {
"wartools": {
"command": "node",
"args": ["/absolute/path/WarToolsAI/packages/node/dist/esm/cli.js", "--enable", "time.now,kv.*"]
}
}
}
HTTP SSE transport: --transport sse --port 3333 (binds to 127.0.0.1 by default).
As an SDK
TypeScript
import { WarTools, JsonFileKvStore } from '@warlockcode/wartools-ai';
const kit = WarTools.create({
preset: 'none',
enable: ['time.now', 'kv.*', 'fs.read_file'],
security: {
fsRoot: './workspace',
httpAllowDomains: ['api.github.com'],
maxOutputChars: 16000,
timeoutMs: 10000,
},
store: new JsonFileKvStore('./.wartools-store.json'),
});
const res = await kit.execute('time.now', { timezone: 'America/Bogota' });
Python (≥ 3.10)
from warlockcode_wartools_ai import WarTools, JsonFileKvStore, SecurityConfig
kit = WarTools.create(
preset="none",
enable=["time.now", "kv.*"],
security=SecurityConfig(fs_root="./workspace", http_allow_domains=["api.github.com"]),
store=JsonFileKvStore("./.wartools-store.json"),
)
res = kit.execute("time.now", {"timezone": "America/Bogota"})
.NET (net8.0 / net9.0 / netstandard2.0)
using WarlockCode.WarToolsAI;
var kit = WarTools.Create(new WarToolsOptions
{
Preset = "none",
Enable = new[] { "time.now", "kv.*" },
Store = new JsonFileKvStore("./.wartools-store.json")
});
var res = await kit.ExecuteAsync("time.now", new { timezone = "America/Bogota" });
Optional: SqliteKvStore
A persistent KvStore backed by SQLite (namespaces, TTL expiry, optional FTS5 index). It is not a tool and never loaded by the core, so the core keeps zero dependencies. All three SDKs share the same on-disk schema (version 1).
| SDK | Import | Driver |
|---|---|---|
| Node | import { SqliteKvStore } from '@warlockcode/wartools-ai/sqlite' | built-in node:sqlite, Node >= 22.5 (22.5-22.12 needs --experimental-sqlite); on Node 18/20 constructing it throws a clear error |
| Python | from warlockcode_wartools_ai import SqliteKvStore | stdlib sqlite3 (lazy import) |
| .NET | using WarlockCode.WarToolsAI.Sqlite; | separate package WarlockCode.WarToolsAI.Sqlite (Microsoft.Data.Sqlite) |
const kit = await WarTools.create({ enable: ['kv.*'], store: new SqliteKvStore('./.wartools.db') });
If SQLite was built without FTS5, ftsAvailable / fts_available / FtsAvailable is false and search falls back to scan + BM25.
Every call returns the same envelope
{
"ok": true,
"tool": "time.now",
"data": { /* tool-specific output */ },
"error": null, // or { "code": "INVALID_INPUT" | "TOOL_DISABLED" | ... }
"meta": { "durationMs": 1, "truncated": false }
}
Output is capped by maxOutputChars; when it is cut, meta.truncated is true.
Tool catalog and status
62 tools shipped, identical in TypeScript, Python and .NET. 1 more tool(s) planned.
| Meaning | |
|---|---|
| ✅ | Shipped and covered by the shared contract tests |
| 🟡 | Implemented, in review (open pull request) |
| ⏳ | Planned, tracked in an issue |
| 💡 | Idea, design only |
Shipped tools
| Tool | Domain | Priority | What it does | |
|---|---|---|---|---|
| ✅ | time.now | time | P0 | Return current date/time in ISO-8601, Unix ms, weekday, and requested IANA timezone. |
| ✅ | time.diff | time | P0 | Calculate exact elapsed duration between two ISO-8601 timestamps. |
| ✅ | time.add | time | P0 | Add or subtract minutes, hours, days, weeks, or months from a base timestamp. |
| ✅ | time.convert_tz | time | P0 | Convert a timestamp from one IANA timezone to another. |
| ✅ | time.business_days | time | P2 | Count business days between two dates or add/subtract business days, with custom weekend and… |
| ✅ | time.cron_next | time | P2 | Compute the next N run times of a 5-field cron expression in an IANA timezone with… |
| ✅ | kv.set | kv | P0 | Persist a JSON value under a namespace/key with optional TTL. |
| ✅ | kv.get | kv | P0 | Retrieve a previously stored JSON value from a session namespace. |
| ✅ | kv.delete | kv | P0 | Delete a key from a KV namespace. |
| ✅ | kv.list | kv | P0 | List active non-expired keys in a namespace filtered by prefix. |
| ✅ | scratchpad.set_plan | scratchpad | P0 | Initialize or replace the active session execution goal and ordered step checklist. |
| ✅ | scratchpad.update_step | scratchpad | P0 | Transition a scratchpad step status and record a concise result summary. |
| ✅ | scratchpad.add_note | scratchpad | P0 | Append a tagged working memory note to the session scratchpad. |
| ✅ | scratchpad.get_workspace | scratchpad | P0 | Retrieve the full scratchpad plan, step statuses, notes, and completion percentage. |
| ✅ | web.fetch_markdown | web | P1 | Fetch an allowlisted HTTP/HTTPS document and convert HTML to clean Markdown. |
| ✅ | web.fetch_json | web | P1 | Execute a guarded HTTP GET request and parse the JSON response. |
| ✅ | web.extract_links | web | P1 | Extract and resolve anchor links from an allowlisted HTML page. |
| ✅ | web.extract_metadata | web | P1 | Extract page title, description, author, publication time, and HTML language metadata. |
| ✅ | json.query | json | P1 | Query JSON objects or strings using deterministic dot/bracket JSONPath expressions. |
| ✅ | json.repair | json | P1 | Repair malformed JSON output (markdown fences, trailing commas, single quotes, unclosed… |
| ✅ | json.validate | json | P1 | Validate a JSON payload against a structural schema and return field-level diagnostics. |
| ✅ | json.diff | json | P1 | Compare two JSON objects and report added, removed, and modified keys. |
| ✅ | text.chunk | text | P1 | Split long text into bounded chunks by paragraph, sentence, or markdown headings. |
| ✅ | text.regex_extract | text | P1 | Extract structured regex matches and capture groups with bounded output. |
| ✅ | text.count_tokens_approx | text | P1 | Estimate token count, word count, line count, and character count deterministically. |
| ✅ | text.diff | text | P1 | Generate a line-by-line unified diff between original and updated text. |
| ✅ | text.apply_patch | text | P1 | Apply a unified diff to text, tolerating line offsets and CRLF; fails atomically with… |
| ✅ | text.rerank_chunks | text | P1 | Rerank text chunks against a query with deterministic BM25 (no embeddings, no network). |
| ✅ | text.detect_language | text | P3 | Detect the language of a text (en, es, pt, fr, de, it or und) with a confidence score and a… |
| ✅ | text.summarize_extractive | text | P2 | Reduce a long text to its N most representative sentences (TF-IDF cosine centrality, optional… |
| ✅ | logs.cluster_templates | logs | P3 | Group log lines by template (timestamps, UUIDs, IPs, hex ids and numbers masked as ) and… |
| ✅ | agent.detect_loop | agent | P2 | Detect loops and stagnation in a window of tool calls (blind retry of an error, same call… |
| ✅ | doc.detect_type | doc | P2 | Detect document type (json, csv, markdown, html, yaml, code, text, empty) from the first 512… |
| ✅ | math.eval | math | P2 | Safely evaluate arithmetic expressions and math functions using a recursive-descent AST. |
| ✅ | math.stats | math | P2 | Compute descriptive statistics (count, sum, mean, median, min, max, stdDev, p95). |
| ✅ | math.convert_unit | math | P2 | Convert values across length, mass, duration, temperature, and digital storage units. |
| ✅ | csv.parse | csv | P2 | Parse delimited CSV/TSV text into typed row objects with pagination. |
| ✅ | csv.summarize | csv | P2 | Profile CSV columns, inferred types, null counts, and distinct sample values. |
| ✅ | csv.filter_aggregate | csv | P2 | Filter CSV rows and compute grouped count, sum, avg, min, or max aggregations. |
| ✅ | fs.list_dir | fs | P2 | List directory entries inside the canonical fsRoot sandbox. |
| ✅ | fs.read_file | fs | P2 | Read a file inside fsRoot with optional line range and maxChars limit. |
| ✅ | fs.write_file | fs | P2 | Write or update a file safely inside the configured fsRoot sandbox. |
| ✅ | fs.search_text | fs | P2 | Search for matching text lines across files inside fsRoot. |
| ✅ | kv.incr | kv | P2 | Atomically increment or decrement a numeric counter in a KV namespace. |
| ✅ | text.redact_pii | text | P2 | Detect and redact emails, phones, Luhn payment cards, IPv4 addresses, and API secrets. |
| ✅ | text.template_render | text | P2 | Render mustache-style templates with strict mode detection for missing variables. |
| ✅ | json.flatten | json | P2 | Flatten nested JSON objects to dotted keys or unflatten them back into objects. |
| ✅ | crypto.hash | crypto | P3 | Compute SHA-256, SHA-384, or SHA-512 cryptographic digests in hex and base64. |
| ✅ | crypto.uuid | crypto | P3 | Generate UUID v4, UUID v7, or ULID identifiers deterministically formatted. |
| ✅ | encoding.base64 | encoding | P3 | Encode or decode UTF-8 strings using standard or URL-safe Base64. |
| ✅ | encoding.jwt_inspect | encoding | P3 | Decode JWT header and claims without signature verification and check expiration. |
| ✅ | security.scan_prompt_injection | security | P3 | Scan untrusted text for prompt injection phrases, role impersonation, and hidden Unicode. |
| ✅ | security.url_inspect | security | P3 | Inspect a URL for protocol, private/loopback network status, punycode, and query params. |
| ✅ | security.redact_secrets | security | P1 | Detect and mask secrets (private keys, cloud/API tokens, JWT, bearer/basic auth, URL… |
| ✅ | security.restore_secrets | security | P1 | Restore <SECRET_n> placeholders from the session's in-memory vault (created by… |
| ✅ | security.vault_clear | security | P1 | Discard the session's in-memory secret vault; returns how many entries were removed. |
| ✅ | validate.batch_rules | validate | P3 | Validate arrays of records against field constraints (required, min, max, email, iso_date… |
| ✅ | state.checkpoint | state | P3 | Save, restore, or list named session checkpoints covering KV and scratchpad state. |
| ✅ | catalog.search | catalog | P4 | Search WarToolsAI capabilities by keyword, domain, or active policy status. |
| ✅ | doc.extract_tables | doc | P4 | Extract structured header/row tables from Markdown or HTML documents. |
| ✅ | doc.to_markdown_report | doc | P4 | Compile structured sections and data tables into a formatted Markdown report. |
| ✅ | trace.log_event | trace | P4 | Record a structured execution trace event to the configured session trace sink. |
Planned tools
| Tool | Domain | What it does | Tracking | |
|---|---|---|---|---|
| ⏳ | kv.search | kv | Search stored values. | #64 |
Runtime and store features
| Feature | What it does | Tracking | |
|---|---|---|---|
| ✅ | Approval gate (requiresApproval) | Single-use approvals bound to tool, arguments and session | #68 |
| ✅ | Budget guard | Per-session limits on calls, per-tool calls and cost | #66 |
| ✅ | Retry with backoff + idempotency cache | Safe retries for flaky tools | #67 |
| ✅ | SqliteKvStore | Persistent KV with TTL, namespaces and FTS5 | #65 |
| 💡 | wartools-ml (ONNX models) | Optional separate package | #69 |
Full schemas live in spec/registry-manifest.json, the single source of truth.
Presets
| Preset | Tools | Selectors | For |
|---|---|---|---|
none | 0 | — | Strict default |
minimal | 9 | time.*, kv.get/set/delete/list, catalog.search | Light stateful agents |
agent-core | 16 | time.*, kv.*, scratchpad.*, state.checkpoint, catalog.search, trace.log_event | Planning, memory, tracing |
research | 14 | time.now, web.*, text.*, doc.*, security.url_inspect | Web and document pipelines |
data-ops | 16 | json.*, csv.*, math.*, validate.batch_rules, crypto.*, encoding.* | Deterministic data work |
Presets and enable combine; see docs/presets.md.
Security model
Tools that touch the outside world are fenced by configuration, not by trust in the model:
- Filesystem (
fs.*): confined tofsRoot; path traversal and symlink escapes returnSANDBOX_PATH_DENIED. - Network (
web.*): only domains inhttpAllowDomains(DOMAIN_NOT_ALLOWED); literal and DNS-resolved private, loopback and link-local addresses are blocked (PRIVATE_NETWORK_BLOCKED); enforced timeouts. - Output limits: every response is truncated at
maxOutputChars. - MCP over HTTP binds to loopback unless you pass
--host.
Details and threat model: docs/security-model.md. Report vulnerabilities per SECURITY.md.
CLI configuration
| Flag / env | Purpose |
|---|---|
--preset <name> | Start from a preset (default none) |
--enable a,b.* · WARTOOLS_ENABLE | Enable tools by name or glob |
--fs-root <dir> · WARTOOLS_FS_ROOT | Sandbox root for fs.* |
--allow-domains a.com,b.com · WARTOOLS_HTTP_ALLOWLIST | Allowed hosts for web.* |
--store-file <path> | Persist kv.* to a JSON file |
--trace-file <path> | Write trace.log_event records to a file |
--config <file.json> | Same options from a JSON file |
--transport stdio|sse · --port · --host | MCP transport |
How it is built
| Layer | Location |
|---|---|
| Canonical manifest (tools, schemas, presets) | spec/registry-manifest.json |
| Shared contract tests (17 domain suites) | spec/contracts/*.json |
| Node / TypeScript SDK + MCP | packages/node → @warlockcode/wartools-ai |
| Python SDK + MCP (stdio) | packages/python → warlockcode-wartools-ai |
| .NET SDK | packages/dotnet → WarlockCode.WarToolsAI |
| Workbench (catalog, playground, policy export) | apps/workbench/, npm run dev → port 3000 |
| Parity check and CI | scripts/sync-manifest.py, .github/workflows/ |
The three SDKs implement every tool independently and must pass the same JSON contract suites; sync-manifest.py fails CI if the manifest, contracts or any language drift apart. Architecture: docs/architecture.md.
Develop and verify
npm run sync:check # manifest ↔ contracts ↔ Node/Python/.NET parity
npm run build:node
npm run test:node # contracts, CJS, MCP stdio, MCP HTTP SSE
npm run test:python
npm run lint
dotnet test packages/dotnet/WarToolsAI.slnx -c Release
Roadmap
Planned tools and runtime features (approval gates, budget limits, retries, SQLite store, cron/time math, patching…) are tracked in issues and docs/roadmap.md. Contributions welcome: see CONTRIBUTING.md.
License
MIT © WarlockCode
@warlockcode/wartools-ainpm install @warlockcode/wartools-aiwarlockcode-wartools-aipip install warlockcode-wartools-ai