agent-tool
agent-tool is an MCP server for AI coding agents that provides bounded, encoding-aware file operations plus a gateway to many extra local, remote, data, analysis, and Windows tools.
Read files with encoding detection, line numbers, paging, truncation metadata, image support, and optional SHA-256; read multiple files in one call.
Create, edit, and patch files while preserving encoding, line endings, and indentation via
.editorconfig; supports dry runs and hash-guarded writes.Apply atomic multi-edit batches and unified diff patches safely.
Search and navigate projects with regex grep, glob matching, and bounded/pageable directory listings.
Use
toolboxto discover and call additional bundled tools on demand, including SSH/SFTP, MySQL/Redis, HTTP/download, shell/process control, debugging, binary analysis/decompilation, memory inspection, Windows GUI automation, and code graph queries.Get built-in help and manage schema profiles to keep tool context small and token-efficient.
Locates C and C++ compilers and build systems to facilitate code compilation and development tasks.
Automatically respects project-specific indentation and encoding standards by reading settings from .editorconfig files during file editing.
Supports the discovery of development tools, compilers, and runtimes installed through the Homebrew package manager.
Enables retrieval of Linux-specific system metrics, process management, and firewall rules from iptables, nftables, and firewalld.
Provides system information and environment-aware tool discovery for development workflows on macOS.
Generates unified diff outputs and comprehensive help documentation in Markdown format for high readability by AI agents.
Discovers .NET SDKs and runtimes to support application development and environmental assessment.
Identifies Node.js runtimes and associated development tools managed via the Node Version Manager (nvm).
Searches for and identifies installed Python environments and development tools across the host system.
Detects Rust toolchains, compilers, and development utilities to assist AI agents in managing Rust projects.
agent-tool
MCP (Model Context Protocol) tool server for AI coding agents.
Why?
Built-in tools in AI coding agents (Claude Code, Cursor, Codex, etc.) have known limitations:
Tab indentation breaks: LLMs output spaces, but your project uses tabs. The built-in Edit tool writes spaces as-is, corrupting your indentation style.
Encoding corruption: Editing EUC-KR, Shift-JIS, or GB18030 files silently converts them to UTF-8, breaking legacy projects.
Too many separate tools: Making the agent find, install, and configure Redis CLI, MySQL client, SSH client, etc. is tedious and error-prone. agent-tool bundles 40 tools into one binary and exposes them on demand through compact profiles.
No reverse engineering support: Built-in tools can't disassemble binaries, inspect PE/ELF headers, find function boundaries, or search cross-references. agent-tool includes static binary analysis (disassembly, decompilation to C with PDB/DWARF types, xref, function detection), a DAP debugger, and CheatEngine-style memory tools -- giving your agent full reverse engineering capabilities.
Network censorship: In some countries, government-level web filtering breaks plain
curl/wgetrequests. agent-tool uses ECH (Encrypted Client Hello) and DoH (DNS over HTTPS) by default to work around these restrictions.
agent-tool solves these with agent-oriented tools that preserve project conventions while keeping model context bounded.
Related MCP server: File Operations MCP Server
Supported Agents
Claude Code, Codex CLI, Cursor, Windsurf, Cline, Gemini CLI, and any MCP-compatible agent.
LLM-efficient by default
The default core profile exposes only 11 schemas (including toolbox) instead of
all 40. In a protocol-level measurement this reduced the serialized tool list from
about 74 KB (full) to 15 KB. For the smallest steady-state context, start with
--profile core-lite; its five schemas are about 6.4 KB and expose only read,
write, edit, grep, and toolbox. Use
toolbox(operation="describe", tool="ssh", compact=true, tool_operation="execute")
to load only one operation's fields and required list, then invoke it through
toolbox(operation="call", tool="ssh", arguments={...}). The gateway does not
depend on dynamic tool-list refresh, so it works with fixed-binding clients such as
Codex. Describe returns a tool/version-bound schema_handle; sending it on a later
describe returns a short unchanged acknowledgement when the schema is still current.
Common compact operations include SSH execution, MySQL queries, file copy, Windows
screenshots/clipboard images, and static-analysis operations. You can also start
with --profile core-lite|coding|remote|analysis|full.
Potentially large text responses default to 32K characters with a 128K hard ceiling.
Truncation is always visible and pageable tools return next_offset or next_cursor.
Local relative paths resolve against an explicit workspace, then the MCP client root.
Features
Tool | Description | Status |
Edit | String replacement with smart indentation and encoding preservation (supports dry_run) | ✅ |
Read | Encoding-aware, line-numbered reading. Defaults to 400 lines/32K chars, reports truncation and exact | ✅ |
Write | Encoding-aware file creation/overwrite | ✅ |
Grep | Encoding-aware regex search with 32K output budget, compact file-grouped output, relative paths, | ✅ |
Glob | Sorted, bounded file matching with | ✅ |
ListDir | Bounded/pageable directory listing. max_entries + continuation cursor, directory/file filters, entry-name glob filters, counts-only mode, flat/tree output | ✅ |
Diff | Compare two files with unified diff output (encoding-aware). Files differing only in line endings or a trailing newline say so instead of returning an empty diff | ✅ |
Patch | Apply unified diff patch to a file (supports dry_run). Each line keeps its own ending, so a mixed CRLF/LF file is not rewritten | ✅ |
Checksum | Compute file hash (md5, sha1, sha256) | ✅ |
FileInfo | File metadata (size, encoding, mixed line-ending counts, indentation, line count) | ✅ |
ConvertEncoding | Convert file encoding (EUC-KR ↔ UTF-8, add/remove BOM, etc.) | ✅ |
Delete | Safe file/directory deletion, including compact batches of up to 100 | ✅ |
Rename | Atomic file/directory rename or move (dry_run) | ✅ |
ProcList | List running processes — PID, name, command line, memory. Sensitive args auto-masked. Filter by name or port | ✅ |
ProcKill | Kill, suspend, or resume processes by PID or port. Tree kill, signal selection (kill/term/hup/int/stop/cont), zombie handling (Linux), dry_run | ✅ |
ProcExec | Execute commands as new processes without blocking the agent: runs still going after | ✅ |
SSH | SSH execution with 32K head+tail capture, original byte counts, proper non-zero-exit errors, and background jobs ( | ✅ |
SSHKey | Convert local private keys between PuTTY PPK v3, traditional PEM, modern OpenSSH, and PKCS#8. Auto-detects input, supports encrypted PPK/OpenSSH output, writes mode 0600, and never returns key material | ✅ |
SFTP | Transfer files and manage remote filesystems over SSH. Upload, download, ls, stat, mkdir, rm, chmod, rename. Reuses SSH session pool. Max 2 GB per transfer | ✅ |
Bash | Persistent shell sessions with working directory/environment retention, safe repeated-diagnostic compaction, and expiring raw-output retrieval. Session pooling (max 5, idle timeout 30 min). Unix: bash/sh, Windows: PowerShell/git-bash/cmd | ✅ |
Download | Download files from URLs to disk. ECH + DoH by default. SSRF protection. HTTP/SOCKS5 proxy. Atomic write. Max 2 GB | ✅ |
HTTPReq | Execute HTTP requests with any method (GET/POST/PUT/PATCH/DELETE/HEAD/OPTIONS). API testing with custom headers, body, proxy. SSRF protection | ✅ |
Query | Read one value from a JSON, YAML or TOML file by dot-notation path (e.g. | ✅ |
Copy | Copy files/directories with atomic write and permission preservation. Recursive directory copy. Windows locked-file fallback (renames running exe/DLL aside). dry_run preview | ✅ |
Mkdir | Create directories with optional permission mode (octal, e.g. 0755). Recursive by default (mkdir -p). dry_run preview | ✅ |
MultiRead | Read up to 50 files with a call-wide 32K budget, 200-line per-file default, long-line safety, and per-file/overall continuation metadata. Hashes are opt-in | ✅ |
RegexReplace | Regex find-and-replace across files/directories. Encoding and line-ending preserving, capture groups ($1, $2). Skips binary files. dry_run preview | ✅ |
NetCheck | Network diagnostics: | ✅ |
MySQL | Execute SQL queries on MySQL/MariaDB. Table-formatted SELECT results with configurable row/column/cell/total-output limits; affected rows for DML. Use SQL LIMIT/OFFSET for paging | ✅ |
Redis | Execute Redis commands with formatted output by type. TLS support. Dangerous commands (FLUSHALL, SHUTDOWN, etc.) blocked | ✅ |
SLOC | Count source lines of code per language. 70+ language detection, per-file/language breakdown, blank line stats, max_depth control | ✅ |
Debug | Interactive debugger via DAP (Debug Adapter Protocol). Full DAP coverage with bounded values/output and paging for variables, completions, modules, and loaded sources. Tested with dlv (Go), debugpy (Python), codelldb (C/C++/Rust). Works with any DAP-compatible adapter. Stdio and TCP modes. Note: vsdbg (Microsoft) requires VS Code licensing and is not usable standalone — use codelldb or netcoredbg as open-source alternatives | ✅ |
Analyze | Static binary analysis and reverse engineering of PE/ELF/Mach-O files. Decompiles x86/x64 PE/ELF functions to C with names and types from a matching PDB, embedded DWARF or IL2CPP metadata (details); x86/x64/ARM/ARM64 disassembly; semantic instruction search that traces constants into call arguments; xrefs to addresses, strings and struct fields; function bounds and call graphs; RTTI, vtable, pointer and struct-layout inspection; header parsing, imphash, Rich header, DWARF, strings, hexdump, pattern search, entropy, overlay detection and binary diff; persistent user annotations. Only | ✅ |
Memtool | CheatEngine-style process memory tool — search/filter/read/write memory values, read_chain (resolve base+offset pointer chains, batched in one call), live disassembly (x86/x64/ARM/ARM64), undo, struct pattern search, pointer scan, memory diff. Disk-backed snapshots for large scans. Session management with idle timeout. Windows and Linux. Windows auto-enables SeDebugPrivilege when elevated; opt-in | ✅ |
Wintool | Windows GUI automation — find/enumerate windows and child controls, capture screenshots (ImageContent PNG), read clipboard images, read/set text, click, type, send raw messages, show/hide/minimize/maximize, move/resize, close, focus. screenshot/clipboard return ImageContent by default (save_path option for file output). Enables AI agents to "see" and interact with GUI applications. Windows only | ✅ |
CodeGraph | Semantic code graph for C/C++, Python, Go, C#, Rust and Java: symbol definitions, callers/callees, call trees, class methods and inheritance, importers and unused symbols, across single projects or multi-root workspaces. Resolves overloads, virtual/interface dispatch, aliases and transitive includes. Fully embedded: no compiler, language server or external binary | ✅ |
SetConfig | Change runtime settings (encoding, file size limit, symlinks, workspace, etc.) | ✅ |
Help | Built-in usage guide for agents. The large | ✅ |
Decompilation
analyze(operation="decompile") turns x86/x64 PE and ELF functions into C with Gosleigh (currently v0.1.19), a Go port of Ghidra's decompiler core.
{"operation":"decompile","file_path":"game.exe","va":"Player::TakeDamage, 0x140001000"}A matching PDB or embedded DWARF is applied automatically: function names, prototypes, struct/enum types, globals and locals. The types a function names are printed after its C;
type_infoprints any other.Obfuscated or damaged functions still print. An undecodable path ends in
halt_baddata(), runaway flow is cut at the function's.pdataextent, andassume_branchesfixes conditional jumps that a runtime trace resolved.Each call runs in a worker process with time and memory limits. A loaded worker is reused for ten minutes, so follow-up calls on the same binary skip the load.
agent-tool decompile-all <binary>dumps every function to a JSONL corpus.
Per-operation guide for agents: agent_tool_help topic analyze/decompile.
IL2CPP prototypes
For Windows x64 IL2CPP images without PDB/DWARF, decompile takes prototypes from il2cpp_signatures: global-metadata.dat (metadata v39 is read natively, without running the DLL or an external dumper), an Il2CppDumper script.json, or an exported methodsigs.tsv. Sidecars beside the binary and the standard Unity metadata locations are found automatically; none disables the source. Debug information keeps precedence and names are never changed.
Details: native extraction, discovery rules and the TSV format, class and virtual-slot type export.
Persistent analysis annotations
analyze keeps your own labels and comments on instructions, functions and decompiled C lines in a SQLite file (annotation_set, annotation_list, annotation_delete, annotation_batch, annotation_suggest). Disassembly and decompilation show saved notes automatically and separately from engine facts: notes never rename symbols or override types.
{"operation":"annotation_set","file_path":"sample.exe","rva":"0x1234","subject":"rax","comment":"User pointer returned here","annotations_path":"project.annotations.sqlite"}
{"operation":"disassemble","file_path":"sample.exe","va":"0x140001234","annotations_path":"project.annotations.sqlite"}Notes are scoped by the binary's SHA-256 and a static address: copies keep their notes, modified builds do not inherit them.
Edits and deletes are revision-checked; a stale revision fails without changing the record.
C-line notes are bound to the decompiled snapshot. When the C changes they are held for review, and
annotation_suggestproposes where they belong.Keep private annotation databases out of public Git history (this repository ignores
*.annotations.sqlite*).
Fields, revision rules and batch use: agent_tool_help topics analyze/annotation_set and analyze/annotation_batch.
Key Improvements
Smart Indentation
LLMs typically output spaces, but many projects use tabs. AgentTool auto-converts indentation to match the file's existing style.
Inherits
indent_style,indent_size, andtab_widthper property from parent.editorconfigfiles, respectingroot = true,unset,indent_size=tab, and common**path patternsFalls back to analysing the file content (up to 8 MiB; LF, CRLF and CR endings). Block structure decides the width, not continuation alignment, comments or string literals
Preserves the detected space width when existing space indentation conflicts with a tab setting
Converts tabs/spaces and space widths such as 2 ↔ 4; converted matches stay at line boundaries, and tab-depth correction preserves relative nesting
Unique line and multiline block anchors use actual local indentation and prefix mappings, preserving minority styles, alignment, and indented blank lines. Block nesting must agree
For C++/header and Python files the embedded Tree-sitter engine infers the indentation of new nested levels from the enclosing block
Alignment to an inline token column and the interiors of multi-line literals/comments in the replacement are kept as written
Rejects equally plausible tab-depth candidates instead of choosing one arbitrarily
Detection is heuristic, not a language formatter; use
dry_run=trueto review an automatic edit
Encoding Preservation
Edits preserve the original file encoding instead of forcing UTF-8.
Detection priority: BOM → per-call
encodingoverride → inherited.editorconfigcharset → BOM-less UTF-16 → valid UTF-8 → chardet auto-detection → fallback encodingSupported: UTF-8, UTF-8 BOM, EUC-KR, Shift-JIS, ISO-8859-1, UTF-16 (LE/BE, with or without BOM), and more
Inherited settings:
charsetinherits independently of indentation settings; new files honorcharset = utf-8-bomby writing a UTF-8 BOMDecode failures: malformed UTF-8/UTF-16, detected lossy decoding, and unsupported encodings return errors.
writerefuses to overwrite an existing file whose encoding cannot be readRetry without project changes:
read,multiread,edit,multiedit,write,patch, andfile_infoacceptencoding="EUC-KR",encoding="CP949", or another supported charset, overriding.editorconfig. An existing BOM still takes priority; useconvert_encodingfor intentional conversionDetection limits: automatic detection remains heuristic; its 64 KiB sample starts after the ASCII preamble so long headers do not hide legacy text. Specify
encodingorcharsetwhen the result is ambiguousNo false warnings on ASCII: valid UTF-8 is verified directly, so plain ASCII files never raise a low-confidence warning
Line endings: Detects LF, CRLF, CR, and mixed files.
editmatches a multi-lineold_stringwhether the file uses CRLF or LF, including files that mix both, and text inserted byedit/regexreplacefollows the newline style of the region it lands in, so the rest of the file is left byte-identical
Consistent reads and edit batches
read,multiread,file_info,grep, andpatchagree on LF, CRLF, and CR line boundaries. A final terminator adds no phantom line; reading past EOF returns no lines.Read hashes come from the same raw bytes as the text.
edit,multiedit,write,patch,regexreplace, andconvert_encodingcheck their captured source hash before saving.expected_hashis available onedit,multiedit, andpatch.multieditsupports the sameencodingandindent_styleoptions asedit; each replacement sees the previous result, and a failed replacement leaves the whole file unchanged.multireadaccepts global or per-fileencoding. Resume the original input list withstart_file_index=next_file_indexandresume_offset=next_offset(omit the offset when zero); the current file keeps its original window end, and later files keep their original ranges.Read output budgets are 256–131072 characters. An oversized first line is visibly shortened so paging can advance; raise
max_output_charsormax_line_charsto inspect it in full.
Conversion and bulk-operation results
Directory
regexreplacereportsfiles_scanned,error_count,limit_reached, andtruncated. The matching-file cap is explicit. Successful files stay changed if another file fails; inspect the partial result and retry only failed files.diffacceptsencoding_a/encoding_bandcontext_lines=0. It distinguishes identical decoded text from identical bytes, reports CR/LF placement changes, and separates a missing final newline from other ending changes.convert_encodingacceptsfrom_encodingfor source hints. GBK and GB18030 remain distinct targets; GB2312 is a GBK compatibility alias. Characters unsupported by the chosen target leave the original unchanged.File writes stage a replacement beside the target. If staging or replacement fails, they return an error and do not fall back to truncating the original in place. Close programs locking the target or correct directory permissions before retrying.
Token-safe directory listings
listdir defaults to 500 entries per page and returns next_cursor when more
entries are available. Narrow results with directories_only, files_only,
name_pattern (for example A*), or multiple OR patterns in include.
Use counts_only=true when only matching file/directory counts are needed.
Idle memory release
After 30 minutes with no tool call the server returns its heap to the OS: an instance that once read a 50MB file settles back to its ~20MB baseline instead of holding 200MB. It never exits on idle, because a stdio server cannot tell an abandoned client from a quiet one. Open shell and ssh sessions survive.
Quick Start
Download the binary for your OS from Releases
Run
agent-tool install(oragent-tool install claudefor a specific agent)Restart your IDE / agent
Done — the compact core tools are available immediately;
toolboxdescribes and calls every other tool on demand
Or just ask your AI agent to do it for you:
"Download agent-tool from https://github.com/knewstimek/agent-tool/releases/latest and run
agent-tool install"
Any capable AI coding agent (Claude Code, Codex, etc.) can handle the full download → install → restart flow automatically.
Recommended: Tell your agent to prefer agent-tool
After installing, agents will have access to agent-tool but may still default to built-in tools (Read, Edit, etc.). To ensure agents prefer agent-tool's encoding-aware, indentation-smart tools, add one of the instructions below.
Code navigation tip: For large projects, add this to your CLAUDE.md / AGENTS.md to enable AST-based code navigation:
At the start of a session, run codegraph(op="index", path="<project_root>") to build a code index.
For several repositories sharing one graph, use codegraph(op="index", path="<db_root>", roots=["<source_root_1>", "<source_root_2>"]). Source-root provenance prevents unrelated projects with the same symbol names from contaminating candidates while explicit/transitive includes can still cross roots.
Then use codegraph for structural queries (find, callers, callees, methods, inherits) instead of grep.Pick Strict or Soft:
Mode | When to use | Instruction |
Strict | Projects with non-UTF-8 files or mixed indentation |
|
Soft | General projects |
|
Where to put it:
Per-project — add to your project's CLAUDE.md:
ALWAYS use agent-tool MCP tools (mcp__agent-tool__*) instead of built-in file tools.Global (all projects) — add to ~/.claude/CLAUDE.md:
ALWAYS use agent-tool MCP tools (mcp__agent-tool__*) instead of built-in file tools.Hard enforcement — deny built-in file tools at the permission level via ~/.claude/settings.json:
{
"permissions": {
"deny": ["Read", "Edit", "MultiEdit", "Write", "Glob", "Grep"]
}
}This makes Claude Code's built-in file tools unavailable, so the agent is forced to use agent-tool. Recommended when you want strict enforcement without relying on prompt instructions.
Add to
~/.codex/config.toml(top-level, not inside[mcp_servers.*]):
model_instructions_file = "~/.codex/model_instructions.md"Create
~/.codex/model_instructions.md:
ALWAYS use agent-tool MCP tools (mcp__agent-tool__*) instead of built-in file tools.Restart Codex.
Per-project — add to your project's AGENTS.md instead.
Add to your project's .cursorrules, .windsurfrules, or AGENTS.md:
ALWAYS use agent-tool MCP tools (mcp__agent-tool__*) instead of built-in file tools.Installation
Auto-install (recommended)
# Register with all detected agents (full auto-approve — all tools)
agent-tool install
# Safe mode — only auto-approve local file tools (no SSH, HTTP, DB, shell)
agent-tool install --safe-approve
# No auto-approve — manual approval required for every tool call
agent-tool install --no-auto-approve
# Register with a specific agent
agent-tool install claude
agent-tool install claude --safe-approve
# Also install the optional agent skills (Claude Code, Codex)
agent-tool install --skills
# Uninstall (removes agent-tool entry only, preserves other settings)
agent-tool uninstall # from all agents
agent-tool uninstall claude # from specific agentInstall permission levels:
Level | Flag | Auto-approved tools |
Full (default) | (none) | All tools ( |
Safe |
| 29 local-only tools (read, edit, write, grep, glob, etc.) — no SSH, HTTP, DB, bash, process control |
None |
| No tools — every call requires manual approval |
Approval level is independent of schema profile: installation may approve the full
namespace while the server still starts with the token-efficient core profile.
toolbox is intentionally not auto-approved by --safe-approve, because its
operation=call gateway can invoke network, shell, database, and process-control
tools. Safe-mode users should review each toolbox approval and avoid granting it a
permanent allow rule unless they intend to trust the full AgentTool namespace.
Agent skills (optional)
The skills/ folder ships workflow skills that tell an agent how to work with the tools, while the built-in help stays the parameter reference:
Skill | Use |
Reverse engineering with |
agent-tool install --skills copies them to ~/.claude/skills and ~/.codex/skills; they are embedded in the binary, so no checkout is needed. Skills are opt-in because an agent loads every installed skill's description into each session. Once installed, later install/reinstall runs refresh them and uninstall removes them. To install by hand, copy the skill folder into the agent's skills directory.
Manual setup
Claude Code / Cursor / Cline (settings.json or mcp.json):
{
"mcpServers": {
"agent-tool": {
"command": "/path/to/agent-tool"
}
}
}Codex CLI (~/.codex/config.toml):
[mcp_servers.agent-tool]
command = "/path/to/agent-tool"Options
# Select the initial schema profile (default: core)
agent-tool --profile core-lite
# Keep the core and eagerly expose only selected additional tools
agent-tool --profile core+copy+delete+ssh+wintool
# Set fallback encoding for projects with non-UTF-8 files
agent-tool --fallback-encoding EUC-KRProfiles are presets: core-lite (read/write/edit/grep/toolbox), core (11
schemas), coding (core plus broader file/build/shell tools), remote, analysis,
and full. Append +tool names to a preset for a custom initial inventory;
for example, core+copy+delete+ssh+wintool exposes 15 tools while leaving analysis
and other remote tools behind the gateway. The same syntax works in
AGENT_TOOL_PROFILE and toolbox operation=profile. Unknown tools or empty
components reject the whole selection before any tools are registered.
At runtime, prefer the
client-independent toolbox gateway: operation=describe returns one tool's schema
(compact=true plus tool_operation limits it to one operation), and
operation=call invokes it through the stable toolbox binding. Re-send a returned
schema_handle to avoid receiving an unchanged schema again. When command
diagnostics are compacted, operation=output retrieves the bounded raw output by
its reported ID for 30 minutes and reports next_offset when paging is needed.
Long-running calls do not block the agent: bash, ssh, sftp, download,
analyze, codegraph, and memtool return a job_id once a call has run for about 15 seconds
(procexec after its yield_after_sec) while the work continues, so the agent can
answer the user or do other work. operation=job with job_action=wait|status|tail|cancel|list
collects the result; cancelling a wait never stops the job. enable,
disable, and profile remain available for clients that honor
tools/list_changed; fixed-binding clients can always keep using the gateway.
Job listing, results and cancellation are restricted to the originating MCP session, including SSH/ProcExec job operations and toolbox. A job ID alone does not grant access from another session. Closing a session does not terminate background work; its job records cannot be retrieved by a newly created session.
Environment Variable
Set AGENT_TOOL_FALLBACK_ENCODING and/or AGENT_TOOL_PROFILE to avoid repeating CLI flags:
# Windows (no admin required)
setx AGENT_TOOL_FALLBACK_ENCODING EUC-KR
setx AGENT_TOOL_PROFILE coding
# Linux / macOS (add to ~/.bashrc or ~/.zshrc)
export AGENT_TOOL_FALLBACK_ENCODING=EUC-KR
export AGENT_TOOL_PROFILE=codingPriority: CLI flag > environment variable > default (UTF-8).
Session directory aliases
Use directory_alias through toolbox (describe, then call) to register directories:
{"operation":"set","aliases":{"src":"src","logs":"logs"}}
{"operation":"set","connection_profile":"dev","aliases":{"deploy":"/srv/releases/current"}}Local values must be existing directories (relative to the workspace or absolute).
Remote values must be absolute; registration does not connect to the server.
Use @src/main.go in read/write/edit/copy/multiread and other common local path
arguments, or @deploy in SSH remote_root and SFTP path arguments. Output path
metadata in read diagnostics, write/edit/copy/multiread results and SFTP uses aliases
when shorter and reusable. Other tools may retain ordinary path displays. Contents
and SSH commands are never substituted.
Bindings stay in client-session memory, scoped by local workspace or remote
connection/authentication identity, and disappear when the MCP session ends. No alias JSON file
is created or loaded; existing SSH connection profiles are still read as usual. list shows mappings on demand (names filters), delete removes
names, and changing a binding requires overwrite:true. Names are case-sensitive
ASCII letters/digits, with _/- allowed after the first character; max 64 characters
and 64 aliases per scope. Unknown aliases, rooted suffixes, .. and : in suffixes
are rejected. Use ./@name for a literal filename starting with @. Aliases are
path conveniences, not sandboxes; symlink destinations are not constrained.
Each MCP call uses one workspace and alias snapshot, captured lazily on first use. Concurrent registrations/rebindings apply to later calls, so a multi-path operation does not mix alias versions. File path whitespace is significant and is not trimmed. Equivalent SSH port/authentication defaults use the same target scope; different hosts, credentials or jump settings remain isolated.
SFTP background status/cancel is restricted to the MCP session that started the transfer. Status keeps resolved paths and renders current aliases at query time; if an alias was deleted or rebound, the exact remote path is shown instead.
Persistent bash shell names (including default), SSH/SFTP pooled connections,
and connection_id handles also belong to the calling MCP session. Other clients
cannot reuse or disconnect them. Pool capacity never evicts another client's
connection; creation fails when no owned entry is available for eviction.
Local SSH/SFTP connection profiles
SSH and SFTP accept either connection_profile or a session-local connection_id,
so host, user, key, and jump-host fields do not need to be repeated. Profiles are
read from the OS user config directory at agent-tool/connections.json; override the
location with AGENT_TOOL_CONNECTION_PROFILE_FILE. Keep this file local and explicitly
ignored if it is placed inside a workspace.
{
"connections": {
"dev": {
"host": "192.0.2.10",
"user": "builder",
"key_file": "/local/path/to/id_ed25519",
"host_key_check": "strict",
"trusted": true,
"remote_root": "/srv/app"
}
}
}An initial call returns an opaque connection_id that remains reusable by both tools
for 30 minutes. Local profiles default to trusted:true; set trusted:false to show the
private-address warning on every call instead of once per pooled connection. This affects
only display; SSRF blocking and cloud metadata protection are unchanged. SSH also supports quiet, echo_command, and
result_only; the last returns compact JSON centered on stdout, stderr, and
exit_code. SFTP supports quiet, result_only, and upload_many (up to 100 files).
Set remote_root in a connection profile or an initial SSH/SFTP call to reuse an
absolute remote working directory through the returned connection_id. SSH changes
to that directory for every foreground/background command or PowerShell script;
a failed directory change prevents execution. SFTP resolves relative remote_path,
rename new_path, and batch upload destinations against it. Explicit absolute paths
keep their meaning; this is a working directory, not a filesystem sandbox. Changing
the root with an existing ID returns a new ID without changing the original one.
remote_shell describes the server's SSH default shell: posix (default), cmd
(default for Windows drive roots such as D:/app), or powershell. Set it explicitly
if the SSH server uses a different default. Windows roots must be drive-based;
cmd roots containing shell expansion/metacharacters are rejected. powershell_script
uses PowerShell location handling independently of the SSH default shell.
With remote_root, Windows CMD commands are launched as child processes with
an explicit working directory through PowerShell (which must be installed).
Command text is passed as data, keeping parentheses and %CD% out of the cwd
guard's parser. PowerShell script text keeps leading using and param
declarations; location setup occurs outside its scriptblock. Generated Windows
launchers are staged when their final length reaches the command-line threshold.
Tool-generated local paths in read diagnostics, multiread headers, edit and copy
results use workspace-relative paths when inside the workspace. SFTP reports local
paths relative to the workspace and remote paths relative to remote_root, including
transfer status. Outside paths remain explicit. File contents and SSH stdout/stderr
are never rewritten. SSH no longer echoes commands by default; use echo_command:true
to display the original command. No root banner or alias list is added per call.
{"connection_profile":"dev","command":"git status"}
{"operation":"upload","connection_profile":"dev","local_path":"build/app","remote_path":"bin/app"}To set the root without editing a profile, pass it once and reuse the returned ID:
{"connection_profile":"dev","remote_root":"/srv/app","command":"git status"}
{"operation":"ls","connection_id":"<returned-id>","remote_path":"logs"}For Windows PowerShell, pass script text in powershell_script instead of command.
SSH uploads a unique UTF-8 temporary .ps1 through a short PowerShell command's
standard input, executes its contents with
a short PowerShell launcher, and deletes it after success or failure. Standalone
powershell[.exe] / pwsh[.exe] commands using -EncodedCommand (or -enc, -ec,
-e) are staged automatically at 8,000 UTF-16 code units. Safe profile, interactive,
apartment, and execution-policy options are preserved; unsupported options or shell
suffixes require explicit powershell_script input. Scripts are limited to 4 MiB.
SFTP is not required, including on legacy Windows SSH servers.
{"operation":"execute","connection_profile":"dev","powershell_script":"Write-Output 'hello'","result_only":true}Preparation and foreground execution share timeout_sec. Background scripts use
the same upload and cleanup path, then expose job_id for wait/status/tail/cancel.
The remote launcher attempts cleanup in finally; confirmed completion also triggers
bounded SSH cleanup. Cancellation or connection loss does not prove remote termination,
so the tool leaves deletion to the remote launcher and reports cleanup_warning if
completion or cleanup could not be confirmed. This warning is separate from the
script's exit code and captured output.
Local SSH private-key conversion
ssh_key converts a private-key file without sending its contents over the network or
returning key material in the response. Input is auto-detected as PPK, PEM, PKCS#8, or
OpenSSH. The output format is one of ppk, pem, pkcs8, or openssh.
{
"operation": "convert",
"input_path": "server.pem",
"output_path": "server.ppk",
"output_format": "ppk",
"input_passphrase": "",
"output_passphrase": "",
"overwrite": false
}PPK output uses version 3. Passphrase-protected PPK output uses Argon2id,
AES-256-CBC, and HMAC-SHA-256; protected OpenSSH output uses OpenSSH's modern
encrypted format. Traditional PEM and PKCS#8 output are deliberately unencrypted;
use openssh or ppk when output encryption is required. New files are mode 0600,
and existing files are not replaced unless overwrite=true.
Runtime Configuration
Agents can change settings at runtime via set_config without restarting:
Parameter | Description | Default |
| Fallback encoding when auto-detection fails |
|
| Show encoding detection warnings |
|
| Max file size for read/edit/grep (MB) |
|
| Allow symlink extraction from tar archives |
|
| Explicit local workspace root. Otherwise the first MCP client root is used, then cwd | (MCP root/cwd) |
| Allow webfetch/download/httpreq to access private IPs |
|
| Allow mysql tool to access private IPs |
|
| Allow redis tool to access private IPs |
|
| Allow ssh/sftp tools to access private IPs |
|
| Enable DNS over HTTPS globally (webfetch/download/httpreq/dnslookup) |
|
| Enable Encrypted Client Hello globally (webfetch/download/httpreq) |
|
Build
go build -trimpath -ldflags="-s -w" -o agent-tool .Cross-compile:
GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o agent-tool .
GOOS=darwin GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o agent-tool .
GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o agent-tool.exe .Release
The guarded GitHub workflow runs tests, builds all declared assets, creates the MCPB and checksums,
and verifies uploaded bytes. From a clean, pushed master branch, dispatch a build-only dry run:
.\scripts\release.ps1After the dry run succeeds, publish the version declared in main.go:
.\scripts\release.ps1 -PublishThe workflow requires tracked notes at docs/releases/vVERSION.md. Publication creates an
annotated tag and GitHub Release, then updates server.json with the released MCPB hash.
When RepoPlane uses this repository as its workspace, the same dry-run, publish, and status
operations are discoverable through the repository-local catalog/ manifests.
Troubleshooting
Garbled text (encoding issues)
If Korean, Japanese, or other non-ASCII text appears as garbage characters:
Option 1: Add charset to your .editorconfig:
[*]
charset = euc-krOption 2: Set environment variable (persistent):
setx AGENT_TOOL_FALLBACK_ENCODING EUC-KR # Windows
export AGENT_TOOL_FALLBACK_ENCODING=EUC-KR # LinuxOption 3: CLI flag (per-session):
agent-tool --fallback-encoding EUC-KRBuilt-in help for agents
agent-tool includes a agent_tool_help tool that agents can call for usage guidance. When an agent encounters encoding warnings or garbled text, it can call:
{ "tool": "agent_tool_help", "arguments": { "topic": "encoding" } }Available topics: overview, encoding, indentation, tools, debug, analyze, memtool, wintool, codegraph, troubleshooting
The two large references, tools and analyze, return a short index (about 1k tokens) instead of the whole text. One part is requested as topic/section, several with commas:
{ "tool": "agent_tool_help", "arguments": { "topic": "analyze/decompile" } }
{ "tool": "agent_tool_help", "arguments": { "topic": "tools/ssh,sftp" } }Security
agent-tool provides powerful system access (SSH, MySQL, Redis, file operations, HTTP requests). When used with AI coding agents, be aware of prompt injection risks:
SSRF Protection: Cloud metadata IPs (169.254.x.x, fe80::/10) are always blocked regardless of settings. Private IP access is configurable per protocol via
set_config(allow_http_private,allow_mysql_private,allow_redis_private,allow_ssh_private)DLP (Data Loss Prevention): All outbound HTTP request bodies are scanned for sensitive data patterns (PEM private keys, AWS access keys, GitHub/GitLab tokens, Slack tokens, .env file dumps) and blocked before transmission
Prompt Injection Warnings: Allowed private IP connections show a compact warning; trusted local SSH/SFTP profiles show it once per pooled connection
Zip Slip protection: Archive entries with
../path traversal are blocked (both zip and tar)Zip Bomb protection: Single file limit (1GB), total extraction limit (5GB)
Symlinks: Skipped by default. Enable via
set_config allow_symlinks=true(tar only; zip symlinks always skipped). Even when enabled, symlinks targeting outside the output directory are blockedFile size limit: Configurable max file size (default 100MB) prevents OOM on large files. Adjustable via
set_config max_file_size_mb=NEncoding safety: chardet uses a 64 KiB sample after the ASCII preamble; malformed input is reported before an edit can persist lossy text
For maximum security, review the AI agent's tool calls before approving, especially for SSH commands, HTTP requests to external URLs, and database queries.
Tech Stack
Language: Go
Encoding: saintfish/chardet + golang.org/x/text
Distribution: Single binary (cross-compiled)
Decompiler: Gosleigh with embedded Ghidra x86/x64 language specs
PDB: gopdb (PDB 7.0 reader and MSVC demangler)
License
The decompiler (Gosleigh) and the Ghidra language specs it embeds are licensed under the Apache License 2.0; Gosleigh is a reimplementation of the Ghidra decompiler, developed by the National Security Agency (https://github.com/NationalSecurityAgency/ghidra).
Available Tools
11 toolsagent_tool_helpA
Returns usage guide for agent-tool. Call this when you encounter encoding warnings, garbled text, or need to understand agent-tool features. Topics: overview, encoding, indentation, tools, debug, analyze, memtool, wintool, codegraph, troubleshooting. tools and analyze return a short index; request one part with topic="analyze/decompile" or topic="tools/ssh,sftp".
Inputs: topic.
editA
Replace exact text in a file. Preserves encoding and local line endings, adapts indentation using the file and .editorconfig, and supports dry-run plus hash-guarded edits.
Inputs: path, dry_run, encoding, file_path, +7 more.
globA
Finds files matching a glob pattern. Supports ** recursive matching and sorts results by modification time (newest first). Defaults to 200 workspace-relative paths and 32768 characters per page. Skips hidden paths and paths excluded by root .gitignore/.ignore or the common generated/vendor policy unless explicitly included. Returns total/has_more/truncated metadata and an opaque next_cursor.
Inputs: pattern (required), path, limit, cursor, +4 more.
grepA
Regex-search encoding-aware files or directories. Supports context, glob filters, content/file/count modes, ignored-path controls, and bounded pageable output. Directory searches skip detected binaries; explicit files are searched.
Inputs: pattern (required), glob, path, after, +14 more.
listdirA
Lists directory contents with bounded, pageable output. Default: flat listing, max_depth=3, max_entries=500. When has_more=true, pass next_cursor as cursor to fetch the next page. Filter by type with directories_only or files_only, and by entry-name glob with name_pattern (single) or include (multiple OR patterns, e.g. ["A*", "*.go"]). Use counts_only=true for counts without names, flat=false for a visual tree, and relative_paths=true to save tokens. Skips hidden entries and common build/vendor directories during recursion.
Inputs: flat, path, cursor, include, +8 more.
multieditA
Applies multiple old_string -> new_string replacements to a single file in one call. Edits are applied sequentially in order; each edit sees the result of the previous one. Atomic: if any edit fails, the file is not modified at all. Encoding-aware: preserves original file encoding (UTF-8, EUC-KR, Shift-JIS, etc.). Line-ending aware: old_string matches whether the file uses CRLF or LF, and inserted newlines follow the region being edited (mixed-newline files stay intact). Use dry_run=true to preview all changes without modifying the file.
Inputs: edits (required), path, dry_run, encoding, +3 more.
multireadA
Reads multiple files in a single call to reduce API round-trips. Encoding-aware: auto-detects each file, with optional global/per-file encoding overrides. Supports offset/limit for reading specific line ranges. Defaults to 200 lines per file and 32768 characters total across the call. Returns visible per-file and overall truncation metadata with continuation positions. Resume the same input list with start_file_index=next_file_index and resume_offset=next_offset (omit resume_offset when zero). Use file_paths or paths (string array) with global offset/limit, or files (object array) for per-file offset/limit. If a file fails, the error is included in output and remaining files continue. Maximum 50 files per request.
Inputs: all, files, limit, paths, +8 more.
patchA
Applies a unified diff patch to a file. Parses @@ hunk headers, verifies context lines, and applies changes. Encoding-aware: preserves original file encoding. Line-ending aware: each line keeps its own ending (a mixed CRLF/LF file is not rewritten) and a file without a trailing newline does not gain one. Use dry_run=true to preview without modifying the file.
Inputs: patch (required), path, dry_run, encoding, +2 more.
readA
Read text with line numbers or return raster images as ImageContent. Detects common encodings; SVG stays text. Text is bounded and reports truncation/next_offset. Use offset/limit to page; relative paths use the workspace or MCP root.
Inputs: all, path, limit, offset, +7 more.
toolboxA
Discover and call tools without loading every schema. Use describe, preferably compact with tool_operation, then call with arguments. Reuse schema_handle. output retrieves preserved paged command output. job collects results of calls that returned a job_id, limited to the originating MCP session. list shows tools; enable/disable/profile manage direct bindings. Profiles: core-lite, core, coding, remote, analysis, full.
Inputs: tool, tools, groups, job_id, +12 more.
writeA
Create or overwrite a file. Preserves existing encoding, uses .editorconfig for new files, and creates parent directories.
Inputs: content (required), path, encoding, file_path.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Tools are mostly distinct: read vs multiread and edit vs multiedit split cleanly along single-vs-batch lines, and glob (name pattern) vs grep (content regex) target different search intents. The main soft overlaps are edit vs patch (both modify files, one by exact-string, one by unified diff) and multiedit vs patch, but descriptions make the boundaries clear enough for an agent to choose.
Most names are single lowercase words with no separator (edit, write, read, grep, glob, patch, listdir), which is internally readable. But conventions are mixed: some are verbs (edit, write), some are nouns (glob, listdir, toolbox, multiedit, multiread), and agent_tool_help breaks the pattern entirely with a snake_case prefix.
Eleven tools sit comfortably in the well-scoped 3-15 range for a coding/file-manipulation agent toolkit. Each tool maps to a recognizable operation (read, write, edit, patch, search, list, help, dynamic tool access) with no obvious filler.
The surface covers the core lifecycle: read/list/search (read, multiread, glob, grep, listdir), create/modify (write, edit, multiedit, patch), plus help and dynamic tool discovery. Notable gaps are file deletion, move/rename, and explicit directory creation, though write implicitly creates parent dirs and agents can often work around the rest.
Maintenance
Related MCP Connectors
Shared control plane for AI coding agents — tasks, memory, decisions, file locks. 12 tools.
13 free utility tools for AI agents: web text, markdown, hashing, IDs, dates, units, JSON.
File tools for your AI chat: PDF tables to Excel, merge PDFs, images to PDF, fill PDF forms.
PDF and image tools for AI agents: compress, merge, split, OCR, sign. Runs locally, never uploads.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides AI assistants with 28 developer tools across file, git, code analysis, HTTP, and system domains, enabling tasks like file editing, repository management, code analysis, and shell command execution.2MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to safely interact with the file system through a set of tools for reading, writing, deleting, copying, moving files, and managing directories.-
- AlicenseAqualityDmaintenanceEnables AI agents to explore, analyze, and search file systems, with tools for directory trees, file statistics, duplicate detection, code counting, and multi-criteria file search.545 npmMIT
- AlicenseNot gradedqualityCmaintenanceEnables agents to read, write, edit, search, rename, move, and delete files, perform regex search-and-replace across trees, query and modify JSON documents, and inspect git status and diffs, all through structured tools instead of shell commands. Includes safeguards like dry-run previews, atomic multi-file edits, and protection for denied or sensitive paths.MIT