Repository avatar
AI Tools
v1.0.0
active

wartoolsai

io.github.jmmana/wartoolsai

Default-Off tool runtime for AI agents: deterministic tools enabled only by preset or by name.

Documentation

WarToolsAI

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.

Total downloads across npm, PyPI and NuGet

npm downloads PyPI downloads NuGet downloads

Docker MCP Registry

CI Node CI Python CI .NET

License: MIT Docs · English · Español

WarToolsAI in action: tools/list, time.now works, fs.read_file is refused until you turn it on


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.

Add to Cursor Install in VS Code

ClientDo this
Claude Codeclaude mcp add wartools -- npx -y @warlockcode/wartools-ai --preset minimal
Claude DesktopAdd to claude_desktop_config.json: {"mcpServers": {"wartools": {"command": "npx", "args": ["-y", "@warlockcode/wartools-ai", "--preset", "minimal"]}}}
Cursor / VS CodeUse the buttons above
Python (uvx)uvx --from warlockcode-wartools-ai wartools-ai --preset minimal
Dockerdocker 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 thisWhat 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

WarToolsAI MCP server

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:

HowUse it when
MCP serverRun one command; Claude Code, Claude Desktop or any MCP client sees the toolsYou want tools in an existing agent/client with no code
SDKWarTools.create(...) + kit.execute(name, input) in Node, Python or .NETYou 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:

RegistryPackageInstallVersion
npm@warlockcode/wartools-ainpm i @warlockcode/wartools-ainpm
PyPIwarlockcode-wartools-aipip install warlockcode-wartools-aiPyPI
NuGetWarlockCode.WarToolsAIdotnet add package WarlockCode.WarToolsAINuGet

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).

SDKImportDriver
Nodeimport { 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
Pythonfrom warlockcode_wartools_ai import SqliteKvStorestdlib sqlite3 (lazy import)
.NETusing 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

ToolDomainPriorityWhat it does
✅time.nowtimeP0Return current date/time in ISO-8601, Unix ms, weekday, and requested IANA timezone.
✅time.difftimeP0Calculate exact elapsed duration between two ISO-8601 timestamps.
✅time.addtimeP0Add or subtract minutes, hours, days, weeks, or months from a base timestamp.
✅time.convert_tztimeP0Convert a timestamp from one IANA timezone to another.
✅time.business_daystimeP2Count business days between two dates or add/subtract business days, with custom weekend and…
✅time.cron_nexttimeP2Compute the next N run times of a 5-field cron expression in an IANA timezone with…
✅kv.setkvP0Persist a JSON value under a namespace/key with optional TTL.
✅kv.getkvP0Retrieve a previously stored JSON value from a session namespace.
✅kv.deletekvP0Delete a key from a KV namespace.
✅kv.listkvP0List active non-expired keys in a namespace filtered by prefix.
✅scratchpad.set_planscratchpadP0Initialize or replace the active session execution goal and ordered step checklist.
✅scratchpad.update_stepscratchpadP0Transition a scratchpad step status and record a concise result summary.
✅scratchpad.add_notescratchpadP0Append a tagged working memory note to the session scratchpad.
✅scratchpad.get_workspacescratchpadP0Retrieve the full scratchpad plan, step statuses, notes, and completion percentage.
✅web.fetch_markdownwebP1Fetch an allowlisted HTTP/HTTPS document and convert HTML to clean Markdown.
✅web.fetch_jsonwebP1Execute a guarded HTTP GET request and parse the JSON response.
✅web.extract_linkswebP1Extract and resolve anchor links from an allowlisted HTML page.
✅web.extract_metadatawebP1Extract page title, description, author, publication time, and HTML language metadata.
✅json.queryjsonP1Query JSON objects or strings using deterministic dot/bracket JSONPath expressions.
✅json.repairjsonP1Repair malformed JSON output (markdown fences, trailing commas, single quotes, unclosed…
✅json.validatejsonP1Validate a JSON payload against a structural schema and return field-level diagnostics.
✅json.diffjsonP1Compare two JSON objects and report added, removed, and modified keys.
✅text.chunktextP1Split long text into bounded chunks by paragraph, sentence, or markdown headings.
✅text.regex_extracttextP1Extract structured regex matches and capture groups with bounded output.
✅text.count_tokens_approxtextP1Estimate token count, word count, line count, and character count deterministically.
✅text.difftextP1Generate a line-by-line unified diff between original and updated text.
✅text.apply_patchtextP1Apply a unified diff to text, tolerating line offsets and CRLF; fails atomically with…
✅text.rerank_chunkstextP1Rerank text chunks against a query with deterministic BM25 (no embeddings, no network).
✅text.detect_languagetextP3Detect the language of a text (en, es, pt, fr, de, it or und) with a confidence score and a…
✅text.summarize_extractivetextP2Reduce a long text to its N most representative sentences (TF-IDF cosine centrality, optional…
✅logs.cluster_templateslogsP3Group log lines by template (timestamps, UUIDs, IPs, hex ids and numbers masked as ) and…
✅agent.detect_loopagentP2Detect loops and stagnation in a window of tool calls (blind retry of an error, same call…
✅doc.detect_typedocP2Detect document type (json, csv, markdown, html, yaml, code, text, empty) from the first 512…
✅math.evalmathP2Safely evaluate arithmetic expressions and math functions using a recursive-descent AST.
✅math.statsmathP2Compute descriptive statistics (count, sum, mean, median, min, max, stdDev, p95).
✅math.convert_unitmathP2Convert values across length, mass, duration, temperature, and digital storage units.
✅csv.parsecsvP2Parse delimited CSV/TSV text into typed row objects with pagination.
✅csv.summarizecsvP2Profile CSV columns, inferred types, null counts, and distinct sample values.
✅csv.filter_aggregatecsvP2Filter CSV rows and compute grouped count, sum, avg, min, or max aggregations.
✅fs.list_dirfsP2List directory entries inside the canonical fsRoot sandbox.
✅fs.read_filefsP2Read a file inside fsRoot with optional line range and maxChars limit.
✅fs.write_filefsP2Write or update a file safely inside the configured fsRoot sandbox.
✅fs.search_textfsP2Search for matching text lines across files inside fsRoot.
✅kv.incrkvP2Atomically increment or decrement a numeric counter in a KV namespace.
✅text.redact_piitextP2Detect and redact emails, phones, Luhn payment cards, IPv4 addresses, and API secrets.
✅text.template_rendertextP2Render mustache-style templates with strict mode detection for missing variables.
✅json.flattenjsonP2Flatten nested JSON objects to dotted keys or unflatten them back into objects.
✅crypto.hashcryptoP3Compute SHA-256, SHA-384, or SHA-512 cryptographic digests in hex and base64.
✅crypto.uuidcryptoP3Generate UUID v4, UUID v7, or ULID identifiers deterministically formatted.
✅encoding.base64encodingP3Encode or decode UTF-8 strings using standard or URL-safe Base64.
✅encoding.jwt_inspectencodingP3Decode JWT header and claims without signature verification and check expiration.
✅security.scan_prompt_injectionsecurityP3Scan untrusted text for prompt injection phrases, role impersonation, and hidden Unicode.
✅security.url_inspectsecurityP3Inspect a URL for protocol, private/loopback network status, punycode, and query params.
✅security.redact_secretssecurityP1Detect and mask secrets (private keys, cloud/API tokens, JWT, bearer/basic auth, URL…
✅security.restore_secretssecurityP1Restore <SECRET_n> placeholders from the session's in-memory vault (created by…
✅security.vault_clearsecurityP1Discard the session's in-memory secret vault; returns how many entries were removed.
✅validate.batch_rulesvalidateP3Validate arrays of records against field constraints (required, min, max, email, iso_date…
✅state.checkpointstateP3Save, restore, or list named session checkpoints covering KV and scratchpad state.
✅catalog.searchcatalogP4Search WarToolsAI capabilities by keyword, domain, or active policy status.
✅doc.extract_tablesdocP4Extract structured header/row tables from Markdown or HTML documents.
✅doc.to_markdown_reportdocP4Compile structured sections and data tables into a formatted Markdown report.
✅trace.log_eventtraceP4Record a structured execution trace event to the configured session trace sink.

Planned tools

ToolDomainWhat it doesTracking
⏳kv.searchkvSearch stored values.#64

Runtime and store features

FeatureWhat it doesTracking
✅Approval gate (requiresApproval)Single-use approvals bound to tool, arguments and session#68
✅Budget guardPer-session limits on calls, per-tool calls and cost#66
✅Retry with backoff + idempotency cacheSafe retries for flaky tools#67
✅SqliteKvStorePersistent 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

PresetToolsSelectorsFor
none0—Strict default
minimal9time.*, kv.get/set/delete/list, catalog.searchLight stateful agents
agent-core16time.*, kv.*, scratchpad.*, state.checkpoint, catalog.search, trace.log_eventPlanning, memory, tracing
research14time.now, web.*, text.*, doc.*, security.url_inspectWeb and document pipelines
data-ops16json.*, 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 to fsRoot; path traversal and symlink escapes return SANDBOX_PATH_DENIED.
  • Network (web.*): only domains in httpAllowDomains (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 / envPurpose
--preset <name>Start from a preset (default none)
--enable a,b.* · WARTOOLS_ENABLEEnable tools by name or glob
--fs-root <dir> · WARTOOLS_FS_ROOTSandbox root for fs.*
--allow-domains a.com,b.com · WARTOOLS_HTTP_ALLOWLISTAllowed 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 · --hostMCP transport

How it is built

LayerLocation
Canonical manifest (tools, schemas, presets)spec/registry-manifest.json
Shared contract tests (17 domain suites)spec/contracts/*.json
Node / TypeScript SDK + MCPpackages/node → @warlockcode/wartools-ai
Python SDK + MCP (stdio)packages/python → warlockcode-wartools-ai
.NET SDKpackages/dotnet → WarlockCode.WarToolsAI
Workbench (catalog, playground, policy export)apps/workbench/, npm run dev → port 3000
Parity check and CIscripts/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

NPM
@warlockcode/wartools-ai
Install Command
npm install @warlockcode/wartools-ai
Runtime: npx
PYPI
warlockcode-wartools-ai
Install Command
pip install warlockcode-wartools-ai
Runtime: uvx