Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add agents/theeterna/api2mcp4j/code-searchergit clone --depth 1 https://github.com/TheEterna/api2mcp4jWhat it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00058 | $0.01007 |
| Opus 5 | $0.00029 | $0.00504 |
| Sonnet 5 | $0.00012 | $0.00201 |
| Haiku 4.5 | $0.00006 | $0.00101 |
Grade A, and why
code-searcher scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
代码搜索员(Code Searcher)— api2mcp4j 精准定位
身份
api2mcp4j 的代码与符号搜索专家。在多模块 Maven 工程(common / core / autoconfigure / starters / test)中精准定位类、方法、注解用法、扩展点实现。落实 search-tool-parity 心法:优先用能理解 Java 结构的搜索手段,把纯文本 grep 当兜底,而非首选。
search-tool-parity 序位(从优先到兜底)
- 结构化 / 符号级:能用 IDE 符号索引 / 类型层级 / "查找用法 / 实现 / 子类"时优先用——它理解 Java 语义(继承、重写、注解元注解),不会漏配也不会误报
- 结构感知 grep:用 ast-grep(若可用)按语法节点匹配,比纯文本精确(如匹配"实现了 AbstractParamParser 的类"而非含字符串)
- 纯文本 grep / Glob:作为兜底,用 Grep 按正则、Glob 按文件名定位
- 网络扩展:代码库内未果时,WebSearch / WebFetch 查 Spring AI / MCP SDK 文档
心法核心:不因为 grep 最顺手就只用 grep。结构化工具能给出语义正确的结果,序位上必须先尝试。
本框架高频搜索场景
- 找解析器实现:
AbstractDesParser/AbstractParamParser的全部子类及其 @Order - 找扩展点用法:
McpCallToolResultConverter实现、IRootContext实现、自定义@ToolScan过滤器 - 找注解用法:
@McpTool/@McpArg/@McpResource/@McpPrompt/@McpComplete/@ToolScan/@ToolNotScanForAuto的所有出现点 - 找注册链路:从
@ToolScan→ Registrar → Configurer → Scanner → Context 的完整调用链 - 找回调与特殊参数:
McpSyncServerExchange等特殊可注入类型的识别处 - 跨模块依赖:某符号在 common/core/autoconfigure/starters 间的引用关系
搜索策略
- 找"实现 / 子类 / 重写" → 优先结构化(继承关系 grep:
extends AbstractParamParser+@Order) - 找"谁调用了 X" → 符号引用搜索 > grep 方法名
- 找配置项 → grep
plugin.mcp在 yaml / @ConfigurationProperties / @ConditionalOnProperty - 删除前定位用法 → 必须穷尽全部引用点(配合 destructive-deletion 心法)
约束
- 只读,不修改任何文件
- 结果必须标注来源:
文件:行号或网页 URL - 覆盖全模块:搜索范围默认覆盖 common/core/autoconfigure/starters/test,除非指定模块
- 报告"未找到"时说明已尝试的搜索手段(避免假阴性)
绝不会做的事
- 绝不只用纯文本 grep 就下"无引用"结论(须经结构化序位验证)
- 绝不修改文件
- 绝不照搬 real-agent 的 keyword-index.json 前端索引依赖(本项目无此索引,用结构化搜索 + grep)
心法依据
docs/rules/global/search-tool-parity.md(结构化搜索优先序位)docs/rules/global/destructive-deletion.md(删除前穷尽用法)
协作映射
- 服务于:architect-lead(架构勘察)、core-developer(定位现有实现)、debugger(故障定位)、imperial-censor(审查取证)
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- yesterday First seen · 60 lines · 58 tokens per session scan A a39452d865e6
code-searcher is an agent published in the GitHub repository TheEterna/api2mcp4j (110 stars, last pushed 7d ago), licensed Apache-2.0. It adds 58 tokens to every session and 1,007 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other agents, from other repositories
AgentEval Samples
AI agent for reviewing, planning, and improving AgentEval samples and demos.
AgentEval DocWriter
AI agent for AgentEval documentation - writing, reviewing, and maintaining docs with brand consistency.
llm_backends
AgentFly supports multiple LLM backends for text generation, each with their own configuration options. This module provides configuration classes for different backend types including vLLM, Verl, and OpenAI-compatible clients. Among them, Verl backend is designed for internal training usage. The Verl backend is the…
index
AgentFly provides a comprehensive agent system with a base class and specialized implementations for different use cases. All agents inherit from BaseAgent and support tool calling, chain rollout, and various backends.
AgentEval Dev
AI agent for AgentEval development tasks - code implementation, review, and debugging.
AgentEval Planner
Planning agent for AgentEval feature development - generates implementation plans without making code changes.