Menu

Loading the search index…

Last updated

On this page

MCP tools a repository never uses

#

Every harness resends every listed tool on every model call, and most of the servers in HarnessLink's own ~/.hnl/agent/mcp.json are never called in a given repository. The MCP hub records, per repository (one git repository and its worktrees, or one folder), each session that lists tools and each call of a proxied tool, in ~/.hnl/agent/tool-usage.db. When a session starts, a proxied tool is left out only when all of these hold:

  • its server has been on this machine for mcp.prune.graceDays (7) days, so

    a newly added server is never hidden at once;

  • the repository has at least mcp.prune.sessions (10) sessions spanning

    that many days;

  • the tool was not called here in the repository's last 10 sessions, nor in

    the last 7 days.

So that this works from the first day, the hub learns once from what is already on the machine, in the background after it starts: the omp, pi, Claude Code and Codex transcripts of the last 60 days (read only, in small chunks so the service stays responsive; at most 5,000 files, 2 GB and one minute; sessions still running are recorded live instead) give each past session's repository and its mcp__hnl_* calls, and the mcp.json backups date each server (one in a backup written 30 days ago was added at least 30 days ago; a server with no such record counts as added at the upgrade). hnl tools says how many past sessions it learned from.

A repository without that history is judged by the whole machine: tools any repository called recently are listed, the rest are not; with too little machine history everything is listed. HarnessLink's own tools are never left out. The list is decided once when a session starts and stays fixed for the session, so the cached prompt prefix does not move.

When something is left out, the session gets one more tool, more_tools, whose description names the hidden servers. The agent searches it (query, server), enables what it needs (enable: the tool is listed from then on, the hub tells the client its list changed, and the tool counts as used here so later sessions keep it), or runs a hidden tool directly (call with arguments). A hidden tool also still runs when called by name.

bash
hnl tools                     # this repository: listed tools and why, hidden ones per server
hnl tools --all               # every name
hnl tools --restore [tool …]  # list hidden tools here again (they count as used now)
hnl tools --off               # list every tool everywhere (mcp.prune.enabled: false); --on undoes it

Changes apply from each harness's next session.

hnl tools also suggests removing a harness's own tools the repository never used in its last 10 sessions, where the harness has a setting that drops the definition from the request (checked against the real request): Claude Code (permissions.deny in the project's .claude/settings.local.json: Workflow, ScheduleWakeup, ReportFindings, ListAgents) and omp (<tool>.enabled: false in the project's .omp/config.yml: todo, web_search). It prints the exact lines and how to undo them; HarnessLink never writes those files. Codex (capability switches, not per tool, honoured only in trusted projects) and pi (tools chosen per launch) get no suggestion.

Code map: locate code without reading whole files

#

code_map {op, path?, name?, budget?, offset?} answers "where is this defined, who uses it, what is in this file" in a few hundred tokens instead of a grep plus whole-file reads. Agents are told to call it first and then read only the lines it names.

  • Ops. overview lists files with their top-level symbols and line numbers

    (path narrows it; a tree too big for the budget becomes a per-directory summary naming each directory's most-referenced exports). outline gives one file's symbols with line ranges, nesting and signatures (name narrows it to one class and its members). find returns definitions (Store.load works). refs returns file:line and the line for every whole-word use, with the definitions left out.

  • Budget. Replies fit budget tokens (default 1,000, 200 to 8,000); a longer

    answer ends with call again with offset=N.

  • Index. One SQLite file per project root (the git root, or the session's

    directory) under ~/.hnl/agent/cache/codemap/, never synced. Every call re-checks file sizes and mtimes and re-reads only what changed. A first index that takes longer than 3 s keeps going in the background and the reply says its results are partial. Up to 50,000 files per project.

  • What is left out. .gitignored files; vendored and build directories

    (node_modules, vendor, dist, build, target, …) and dot-directories; binaries, lockfiles, minified and generated files; files over 1 MB; and anything named like a credential (.env*, keys and certificates, credentials, id_rsa, *.tfstate, …), which is never read at all. Signatures and refs lines pass through the credential redactor.

  • Languages. Symbols for TypeScript/JavaScript (JSX/TSX), Python, Go, Rust,

    Java, Kotlin, C#, Ruby, PHP, Swift and C/C++, by built-in line patterns over source with comments and strings masked (no parser dependency). Other files are listed and searched by refs, without symbols. Functions declared inside function bodies, as in factory-style JavaScript, are found; other locals are not.

Any MCP client or base URL

#

The table above is the six harnesses HarnessLink sets up itself. Other coding agents and editors connect by hand, in one or both of two ways, and get less: HarnessLink does not read their transcripts, so their prompts are not in History and their turns are not banked.

  • The MCP server gives the tool the memory tools (memory_search,

    memory_bank and the rest). hnl mcp print prints the entry; paste it into the tool's MCP config under the key it documents.

  • The gateway routes the tool's model calls through HarnessLink, so they

    count in Usage (as other) and follow your organisation's model rules and limits. Set the tool's base URL to http://127.0.0.1:4747/other/anthropic for an Anthropic-compatible provider, or http://127.0.0.1:4747/other/openai in place of https://api.openai.com/v1 for an OpenAI-compatible one. The tool keeps its own API key; the gateway needs hnl gateway start and a HarnessLink Cloud sign-in.

bash
hnl mcp print                 # the MCP entry, as JSON (`mcpServers`)
hnl mcp print --format toml   # the same, as TOML

Each tool below documents how it takes an MCP server or a base URL; the links go to its own docs.

ToolConnects throughMCP entry goes in
Gemini CLIMCP servermcpServers in settings.json
GitHub CopilotMCP server, gateway (Anthropic), gateway (OpenAI)servers in .vscode/mcp.json (VS Code agent mode)
Devin Desktop (formerly Windsurf)MCP servermcpServers in ~/.config/devin/mcp_config.json or .devin/mcp_config.json
ZedMCP server, gateway (Anthropic), gateway (OpenAI)context_servers in Zed's settings
ClineMCP server, gateway (Anthropic), gateway (OpenAI)mcpServers in cline_mcp_settings.json
Roo CodeMCP server, gateway (Anthropic), gateway (OpenAI)mcpServers in mcp_settings.json or .roo/mcp.json
Kilo CodeMCP server, gateway (OpenAI)see its MCP docs
ContinueMCP server, gateway (OpenAI)mcpServers in its config, or .continue/mcpServers/
OpenCodeMCP server, gateway (OpenAI)mcp in its config, with type: "local"
gooseMCP server, gateway (Anthropic), gateway (OpenAI)a command-line extension in ~/.config/goose/config.yaml
AmpMCP server, gateway (Anthropic), gateway (OpenAI)amp.mcpServers in ~/.config/amp/settings.json
WarpMCP server, gateway (OpenAI)see its MCP docs
DeepSeek HarnessMCP server, gateway (Anthropic), gateway (OpenAI)see its MCP docs
Aidergateway (OpenAI)no MCP

Flag notifications