rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
PROJECT README
English | Português
A DeepSeek Harness plugin that keeps large tool sets, such as many MCP servers, out of every model request. Tool definitions are loaded on demand with a tool_search tool.
With many MCP servers configured, every request carried hundreds of definitions the agent never used. In one measured native desktop session, 480 tools weighed 396 KB of JSON per request, and 352 KB of that was MCP definitions. With this plugin the model sees a short list of tool groups plus tool_search, and the tools it loads are declared from its next step.
Deferred tools stay registered and executable. Only the declaration size of each request changes. Deferral is presentation, not access control; use the harness's own tool restrictions to forbid a tool.
The module has no package imports and reads everything from the Cordis ctx, so one file mounts by absolute path. Add a row to your profile patch (cordis.patch.yml):
- insert:
- id: tool-search
name: 'C:/path/to/dsh-tool-search/index.mjs'
config:
defer:
- 'mcp__*'
keep:
- 'mcp__memory__*'
maxResults: 8
The host caches plugin modules, so restart it after you change the file. Removing the row restores the full declarations.
| Field | Default | Meaning |
|---|---|---|
defer |
required | *-wildcard patterns over complete tool names. Matching tools are withheld until loaded. |
keep |
[] |
Patterns that are never withheld, even when defer matches. |
maxResults |
8 |
Most tools one keyword search loads. |
An empty defer list, an empty pattern, or a non-positive maxResults fails when the plugin loads.
The model calls tool_search with query keywords, exact names, or both. Keyword search ranks unloaded deferred tools by how many query terms their names and descriptions contain (name hits count more) and loads the best maxResults. A name that no pattern defers is reported as already loaded; an unknown name is reported as unknown.
system-prompt/assemble and adds a catalog section that lists each deferred group once with its tool count.tools:sdk section, removing deferred members from ToolArgsMap and ToolOutputMap. The model calls await tools.tool_search({ query }) inside run_code. A layout it does not recognize is left unfiltered, with one warning in the log.tool_search. A resumed PTC session starts empty.Verified on DeepSeek Harness 0.2.1-alpha.2. Newer releases moved tool declarations out of the system-prompt/assemble assembly into the provider. On such a release native deferral is inactive: the plugin leaves the assembly untouched and logs one warning (native deferral is inactive) instead of failing prompt assembly. The PTC filter depends on the member layout that the SDK generator emits.
tool_search runs inside run_code, which costs one program per search.npm test
The tests use a fake Cordis context and need neither DeepSeek Harness nor any dependency.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: mcp、deepseek-harness。