Skip to main content
Glama

Mini Agent MCP

CI npm version npm downloads GitHub license GitHub stars MCP Node.js

䞀䞪基于 FastMCP + OpenAI SDK 的 MCP 智胜代理服务噚
集成 ReAct Agent、DAG 工䜜流、深床研究、持久化记忆、技胜孊习、AnySearch 检玢等胜力
单二进制即可托管 / 本地郚眲 / 嵌入任意 MCP 客户端

⚠ 安党告譊2026-07早期版本䞭scripts/ 例的 9 䞪测试文件曟把䞀䞪 LongCat LLM API keyak_2wG...前猀已泄露盎接硬猖码进 Git 仓库。该凭证必须视䞺已泄露——已有 Git 历史记圕单纯删陀文件无法回收。请立即

  1. 圚䟛应商控制台撀销并蜮换该 key

  2. 通过 CI Secret Store / process.env.LLM_API_KEY 重新泚入

  3. 圚 PR 流皋䞭加入 node scripts/test-secret-scan.mjs 䜜䞺 CI 防技。

圓前所有脚本已改䞺读取环境变量猺凭据时枅晰 SKIP 并退出 0。


䞀、这是什么

mini-agent-mcp 是䞀䞪遵埪 Model Context Protocol (MCP) 的 stdio / SSE 服务噚

  • 对倖只暎露 1 䞪 MCP 工具run_agent——甚于没有子 Agent 的应甚泚入䞀䞪"子智胜䜓"

  • 对内托管䞀䞪 ReAct 掚理代理自䞻调甚 14 䞪内郚工具6 䞪基础工具 + 4 䞪 AnySearch 工具 + 高级 pipeline 等完成任务

  • 内眮 DAG 工䜜流䞎倚阶段深床研究管线

  • 通过 ToolManager 统䞀管理超时、并发、重试、闚犁

  • 通过 .memory/ 侎 .skills/ 实现本地持久化记忆和技胜孊习

支持䞉种 LLM 通信暡匏自劚级联 fallback

  1. MCP Sampling — 客户端暡型零配眮

  2. Direct HTTP — 通过 OpenAI SDK 盎连任意兌容端点

  3. Rule-based — 基于正则的暡匏匹配兜底


Related MCP server: Forage MCP Server

二、栞心特性

暡块

胜力

🧮 基础工具

安党数孊计算、文本统计、文本蜬换、单䜍换算、日期时闎、随机生成

🀖 ReAct Agent

原生 Function Calling 倚步掚理自劚匹配历史技胜Hook 泚入

🔗 DAG 工䜜流

有向无环囟猖排并行执行无䟝赖节点自劚泚入䞊枞结果

🔍 深床研究

拆解子问题 → 并行检玢 → 绌合报告䞉阶段管线

💟 记忆系统

4 类标筟化持久记忆按访问频次 LRU 检玢

🎯 技胜系统

完成任务后提取可倍甚技胜新任务自劚匹配

🌐 AnySearch 集成

自劚发现并接入检玢工具仅䟛 Agent 内郚调甚

🛡 工具闚犁

蟓入长床䞊限、错误分类、智胜重试、超时控制

🔌 䞉暡匏 LLM

Sampling → HTTP → Rule-based 透明级联 fallback

🪝 Hooks 扩展

圚 LLM 调甚前后泚入自定义逻蟑Yao 暡匏


䞉、架构总览

┌─────────────────────────────────────────────────────────────────────┐
│                       MCP 客户端 (Claude / ZCode)                   │
│              tools/list 只见 1 䞪工具: run_agent                    │
│              tools/call 仅可调 run_agent                            │
└─────────────────────────────┬───────────────────────────────────────┘
                              │ run_agent(task)
┌─────────────────────────────▌───────────────────────────────────────┐
│                         FastMCP Server                              │
│              run_agent — 唯䞀对倖的 MCP 工具                          │
└─────────────────────────────┬───────────────────────────────────────┘
                              │
┌─────────────────────────────▌───────────────────────────────────────┐
│                       ToolManager (singleton)                       │
│   超时 / 并发䞊限 / 智胜重试 / 蟓入闚犁 / 调甚历史                  │
│   14 䞪内郚工具倖面看䞍见                                       │
└─────────────────────────────┬───────────────────────────────────────┘
                              │
        ┌─────────────────────┌──────────────────────┐
        │                     │                      │
        ▌                     ▌                      ▌
   6 䞪本地工具       run_agent唯䞀对倖工具     .memory / .skills
   (calculator, ...   + 内郚高级 pipeline              (持久化)
                     仅 Agent 内郚䜿甚)
                              │
                              ▌
┌─────────────────────────────────────────────────────────────────────┐
│                    ReAct Agent (src/agent/react.ts)                 │
│                                                                     │
│   LLM ←── CreateHook ── messages ──→ LLM ──→ NextHook → 响应校验    │
│    │                                                              │
│    │ tool_calls                                                    │
│    â–Œ                                                              │
│  buildToolList() = 6 本地工具 + AnySearch 4 䞪内郚工具              │
│  (AnySearch 懒加蜜銖次 run_agent 调甚时发现并猓存)                │
│                                                                     │
│   ┌─────────────────────────┐    ┌─────────────────────────┐       │
│   │   LLM 暡匏 (䌘先级)      │    │     Fallback 铟          │       │
│   │   1. MCP Sampling        │ →  │   倱莥 → 降级到䞋䞀暡匏  │       │
│   │   2. Direct HTTP         │    │                         │       │
│   │   3. Rule-based          │    │                         │       │
│   └─────────────────────────┘    └─────────────────────────┘       │
└─────────────────────────────────────────────────────────────────────┘
                              │
                              ▌
┌─────────────────────────────────────────────────────────────────────┐
│                    持久化层 (本地 JSON)                             │
│   .memory/memories.json   ── 4 类记忆 (fact/preference/task/conv)   │
│   .skills/skills.json     ── 标筟评分技胜库                         │
└─────────────────────────────────────────────────────────────────────┘

**AnySearch 懒加蜜时序**
1. 服务噚启劚 → 仅泚册 `run_agent` 到 FastMCP + 6 䞪本地工具到内郚 ToolManager
2. 客户端调甚 `run_agent` → Agent 觊发 `ensureAnySearchTools()`
3. 銖次HTTP 连接到 `api.anysearch.com/mcp` 发现工具猓存 1 小时
4. 后续呜䞭猓存陀非 TTL 过期或调甚 `resetAnySearchCache()`

四、快速䞊手

4.1 MCP 客户端配眮

stdio 暡匏最垞甚— 倍制到客户端的 MCP 配眮文件䞭

{
  "mcpServers": {
    "mini-agent-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mini-agent-mcp"],
      "env": {
        "ANYSEARCH_API_KEY": "",
        "LLM_API_KEY": "sk-your-key",
        "LLM_BASE_URL": "https://api.longcat.chat/openai/v1",
        "LLM_MODEL": "LongCat-2.0",
        "LLM_MAX_TOKENS": "4096"
      }
    }
  }
}

也可盎接䜿甚 node dist/index.js 启劚本地猖译产物见 §4.3。

SSE 暡匏可选— 通过 node dist/index.js --sse 启甚 httpStream 䌠蟓。

4.2 .env 配眮fallback

服务噚启劚时按以䞋顺序查扟 .env第䞀䞪存圚即生效

  1. process.cwd()/.env — 启劚时的工䜜目圕

  2. <dist 䞊䞀级>/.env — 即 npm install 后的项目根目圕dist/index.js 启劚场景

  3. <dist 䞊䞀级>/.env — 项目根目圕的父目圕

⚠ 通过 npx -y mini-agent-mcp 党局拉起时process.cwd() 取决于 MCP 客户端的工䜜目圕䞍䞀定等于项目根。掚荐同时圚 MCP 配眮文件的 env 块䞭星匏泚入变量见 §4.1以避免查扟路埄䞍䞀臎垊来的配眮挂移。

cp .env.example .env
# AnySearch API Key可选 — 䞍填则匿名访问有蟃䜎速率限制
ANYSEARCH_API_KEY=

# LLM 盎接调甚配眮仅 Direct HTTP 暡匏需芁
LLM_API_KEY=
LLM_BASE_URL=https://api.longcat.chat/openai/v1
LLM_MODEL=LongCat-2.0
LLM_MAX_TOKENS=4096

# 可选倚䟛应商切换见 §9.2
# LLM_PROVIDER=openai
# LLM_PROVIDERS_PATH=/abs/path/to/providers.json

# Agent 行䞺调䌘
AGENT_MAX_TURNS=5          # ReAct 掚理步数䞊限1-50
# AGENT_TOOL_RETRY=1       # 已废匃 — 仅 TOOL_RETRY_COUNT 生效

# ToolManager 调䌘
TOOL_MAX_CONCURRENT=10     # 并发执行䞊限
TOOL_RETRY_COUNT=2         # 瞬时错误重试0-5

4.3 本地匀发

git clone https://github.com/Microbiosis/mini-agent-mcp.git
cd mini-agent-mcp
npm install
npm run build          # tsc 猖译到 dist/
node dist/index.js           # 启劚 MCP 服务噚stdio
node dist/index.js --test    # 自检暡匏调甚党郚 14 䞪工具
node dist/index.js --sse     # 启甚 HTTP Stream 䌠蟓

--test 暡匏运行完成后䌚 process.exit(0)适合做 CI 自检。

4.4 验证安装

echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"probe","version":"1"}}}' \
  | npx mini-agent-mcp

正垞情况䞋䌚返回 14 䞪工具的 schema。


五、MCP 工具参考

5.1 唯䞀对倖工具倖郚 Agent 唯䞀可调

工具

参数

甹途

超时

run_agent

task: stringmode?: 'auto'|'rule'

把任务委掟给内眮 ReAct AgentAgent 自劚选择并调甚 14 䞪内郚工具完成。rule 区制正则暡匏无需 LLM

600s

run_agent 返回结构

Task: 计算 sqrt(15) + 8
Mode: LLM-powered (HTTP)
Steps: 2

--- Reasoning Trace ---
[Step 1]
  Thought: ...
  Action: calculator
  Observation: Expression: sqrt(15) + 8
Result: 11.872983346207417
[Step 2]
  Thought: ...
  Final Answer: 11.87

--- Final Answer ---
11.87

5.2 内郚工具仅 Agent 可见倖郚 tools/list 䞍可见

䞋面 14 䞪工具䞍通过 MCP tools/list 暎露——只胜由 run_agent 内的 ReAct 埪环自劚调甚。客户端 Agent 通过 run_agent(task) 委掟任务Agent 圚内郚根据需芁挑选并执行这些工具。

基础工具6 䞪 — 同步、确定性

内郚工具

参数

甹途

calculator

expression: string

安党数孊求倌递園䞋降解析噚无 eval()。支持 + - * / % ^、括号、凜数 sqrt abs sin cos tan asin acos atan log ln exp floor ceil round、垞量 pi e

text_stats

text: string

字笊数、词数、句数、段数、平均词长、Top 5 高频词

text_transform

text: stringoperation (9 种)pattern?: stringreplacement?: string

uppercase/lowercase/titlecase/reverse/trim/remove_duplicates/sort_lines/count_substring/replace

unit_convert

value: numberfrom: stringto: string

长床/重量/枩床/数据单䜍换算

datetime_info

operation: 'now'|'format'|'diff' + 配套参数

圓前时闎、栌匏蜬换、日期差

random_gen

operation: 'number'|'uuid'|'password'|'pick'|'shuffle' + 配套参数

随机敎数/UUID/密码/采样/掗牌

高级 pipeline3 䞪

内郚工具

甹途

run_workflow

DAG 工䜜流猖排倚䞪 Agent 任务按䟝赖执行

deep_research

䞉阶段深床研究拆解 → 检玢 → 绌合

(倍合)

倚阶段研究任务的䞲联入口

记忆工具3 䞪 — 持久化到 .memory/memories.json

内郚工具

甹途

remember

存傚䞀条记忆fact/preference/task/conversation

recall

按标筟检玢 Top 5 记忆

memory_stats

返回记忆统计

技胜工具2 䞪 — 持久化到 .skills/skills.json

内郚工具

甹途

extract_skill

提取䞀䞪可倍甚技胜

list_skills

列出所有技胜

AnySearch 工具4 䞪 — 懒加蜜

anysearch_search / anysearch_batch_search / anysearch_extract / anysearch_get_sub_domains诊见 §6

💡 讟计意囟本服务的栞心定䜍是䞺没有子智胜䜓的 Agent 应甚泚入"子智胜䜓"胜力。倖郚工具集保持极简仅 run_agent党郚内郚工具由 Agent 自治调床避免暎露过倚工具面干扰䞻 Agent 的选择。


懒加蜜AnySearch 工具䞍圚启劚时连接而是等到銖次调甚 run_agent或 deep_research时由 Agent 通过 ensureAnySearchTools() 觊发发现 + 泚册。这样

  • 服务噚冷启劚䞍受 AnySearch 眑络圱响

  • 䞍䜿甚 Agent 功胜的客户端完党跳过 AnySearch

  • 工具列衚猓存 1 小时可甚 ANYSEARCH_CACHE_TTL_MS 芆盖

发现后䌚泚册到内郚 ToolManager 的工具

内郚名称

功胜

anysearch_search

通甚搜玢支持金融、孊术、法埋等垂盎领域

anysearch_batch_search

1-5 䞪独立查询的并行搜玢

anysearch_extract

URL 眑页内容提取最倚 50,000 字笊 Markdown

anysearch_get_sub_domains

查询垂盎领域目圕

⚠ 这些工具仅泚册到内郚 ToolManager䟛 ReAct Agent 圚掚理埪环䞭自䞻调甚䞍 通过 MCP tools/list 暎露给倖郚客户端——MCP tools/list 始终只返回 1 䞪工具run_agent。

匿名可甚䞍讟 ANYSEARCH_API_KEY 也胜连接只是有蟃䜎的速率限制高级䜿甚场景可填 Key 提升配额。

猓存策略

  • 默讀 TTL1 小时环境变量 ANYSEARCH_CACHE_TTL_MS讟䞺 0 每次过期郜重发现

  • 瞬时倱莥时保留旧猓存serving stale cache—— 可甚工具䌘先于无工具

  • 手劚刷新调甚 resetAnySearchCache()来自 mini-agent-mcp/agent 或内郚 API

容错MCPRuntime 状态机idle → connecting → connected → degraded/error/disabled自劚倄理瞬时错误重试和硬错误401/403/DNS → 犁甚AnySearch 䞍可蟟䞍䌚阻塞 Agent 启劚。


䞃、LLM 䞉暡匏 + Fallback

run_agent 启劚时按䌘先级选择 LLM 调甚方匏倱莥时自劚降级

┌─────────────────────────────────────────────────────────┐
│  runAgent(task)                                         │
│    ↓                                                    │
│  getLLMMode()                                           │
│    ├─► "sampling" (MCP 客户端支持时)                      │
│    │     ├─ 成功 → 返回                                  │
│    │     └─ 倱莥 → 检查 Direct HTTP 配眮                 │
│    ├─► "http" (讟眮了 LLM_API_KEY + BASE_URL + MODEL)    │
│    │     ├─ 成功 → 返回                                  │
│    │     └─ 倱莥 → Fallback                              │
│    └─► "none" (Rule-based 兜底)                          │
│          └─ 氞远可执行                                   │
└─────────────────────────────────────────────────────────┘

暡匏

觊发条件

䌘点

限制

MCP Sampling

MCP 客户端泚册了 sampling capability

零配眮、客户端 LLM

䟝赖客户端支持

Direct HTTP

讟眮了 LLM_API_KEY + LLM_BASE_URL + LLM_MODEL

䞎客户端解耊、可托管

需芁 API Key

Rule-based

䞊述郜倱莥 / 星匏 mode='rule'

无 LLM 也胜跑

仅限 §5.1 基础工具胜盎接芆盖的任务数孊、单䜍换、时闎、密码、UUID、文本统计、日期差

关键 API

  • getLLMMode(): 'sampling' | 'http' | 'none' — 检查圓前可甚暡匏

  • getLLMConfig() — 返回 Direct HTTP 配眮劂有


八、Hooks 系统Yao 暡匏

src/agent/react.ts 暎露䞀䞪 Hook 点可圚䞍修改 Agent 内栞的前提䞋泚入自定义行䞺。Hooks 通过 mini-agent-mcp/agent 子路埄富出。

// 发垃包䞭通过子路埄富入
import { addCreateHook, addNextHook, clearHooks } from "mini-agent-mcp/agent";

addCreateHook(async (ctx, messages) => {
  // LLM 调甚前可泚入 / 修改 / 取消消息
  // ctx: { task, step, maxSteps }
  // 返回 null → 取消本次 LLM 调甚
  // 返回 messages 数组 → 替换䞺新消息
  if (ctx.step === 0) {
    messages.push({ role: "user", content: "[System] 请䜿甚䞭文回答。" });
  }
  return messages;
});

addNextHook(async (ctx, response) => {
  // LLM 响应后可校验 / 拊截
  // 返回 "stop" → 立即终止 Agent
  // 返回 "continue" 或 null → 正垞继续
  if (response.content?.includes("ERROR")) return "stop";
  return null;
});

// 枅空所有 Hook
clearHooks();

兞型甚途

  • 泚入系统级提瀺词 / 安党纊束

  • 添加审计日志、调甚统计

  • 限制工具调甚范囎前眮闚犁

  • 圚响应出现危险暡匏时玧急停止


九、持久化层

9.1 Memory.memory/memories.json

interface Memory {
  id: string;               // mem_<timestamp>_<rand>
  type: "fact" | "preference" | "task" | "conversation";
  content: string;
  tags: string[];           // 甚于检玢
  timestamp: number;        // 创建时闎epoch ms
  accessCount: number;      // recall 时递增圱响排序
}

检玢算法

  1. 标筟完党匹配 → 盎接召回

  2. 按 accessCount + recency 排序

  3. 默讀返回 Top 5recall(tags, limit=5)

9.2 Skill.skills/skills.json

interface Skill {
  id: string;                  // skill_<timestamp>
  name: string;
  description: string;
  exampleTask: string;
  steps: string[];             // 步骀描述泚入到消息历史
  tags: string[];              // 匹配关键词
  useCount: number;            // 环计被自劚应甚次数
  createdAt: number;           // 銖次创建时闎氞䞍曎新
  lastUsedAt?: number;         // 最近䞀次被 matchSkill 匹配并 useSkill() 的时闎
  lastUpdatedAt?: number;      // 最近䞀次 extractSkill() 芆盖内容的时闎
}

匹配评分matchSkill(task)

  • 每䞪匹配 tag+10

  • 每䞪 step 前 20 字笊出现圚 task 䞭+5

  • 仅返回 score > 0 的最䜳匹配

自劚应甚每次 runAgent 启劚前郜䌚调甚 matchSkill()若呜䞭则把步骀䜜䞺 hint 泚入 LLM 消息并 useSkill() 增加计数 — 这就是"自我孊习"的机制。


十、DAG 工䜜流

run_workflow 接受䞀䞪 JSON 数组按有向无环囟执行

[
  {"id": "fetch", "label": "抓取",  "task": "甹 search 工具查询 MCP 协议", "timeout": 60},
  {"id": "sum1",  "label": "摘芁1", "task": "把䞊面的内容翻译成䞭文", "dependsOn": ["fetch"], "timeout": 30},
  {"id": "sum2",  "label": "摘芁2", "task": "提取 3 䞪关键点",          "dependsOn": ["fetch"], "timeout": 30},
  {"id": "final", "label": "汇总",  "task": "合并䞀䞪摘芁䞺最终报告",    "dependsOn": ["sum1", "sum2"]}
]

执行特性

  • 并行执行无䟝赖关系或䟝赖已完成的的步骀䌚同时启劚Promise.all

  • 䟝赖泚入buildStepTask() 把䞊枞步骀的 result.answer 拌到䞋枞任务末尟

  • 环检测DFS 检测埪环䟝赖抛出明确错误

  • 死锁倄理若没有 ready 步骀䜆未党郚完成剩䜙的标记䞺 blocked

  • 超时每步独立超时秒默讀 60

返回结构

{
  success: boolean,
  totalDurationMs: number,
  steps: [{ id, label, result, error?, durationMs }]
}

十䞀、深床研究deep_research

䞉阶段管线5 分钟超时

┌───────────────┐      ┌───────────────┐      ┌───────────────┐
│   1. 拆解      │ ──►  │   2. 检玢      │ ──►  │   3. 绌合      │
│               │      │               │      │               │
│ LLM 把问题    │      │ 每䞪子问题    │      │ LLM 收到所有  │
│ 拆成 3-5 䞪   │      │ 觊发 run_agent│      │ findings +    │
│ 子问题        │      │ 自劚调 search │      │ 原问题生成  │
│ (fenced code) │      │ 收集 findings │      │ Markdown 报告 │
└───────────────┘      └───────────────┘      └───────────────┘

parseSubQuestions() 容错

  • 䌘先解析 fenced code block``` ... ```

  • 降级到行扫描只接受 "- " 匀倎䞔 ≥12 字笊的行

  • 默讀最倚 5 䞪子问题

  • 解析倱莥 → fallback 䞺单问题 [原问题]

返回结构包含 subQuestions、totalSteps、durationMs 和完敎的 Markdown 报告执行摘芁 + 关键发现 + 结论。


十二、配眮参考

12.1 党郚环境变量

变量

必需

默讀

甹途

LLM_API_KEY

视暡匏

—

Direct HTTP 暡匏的 API Key裞 Key䞍垊 Bearer

LLM_BASE_URL

视暡匏

—

OpenAI 兌容端点需含 /v1

LLM_MODEL

视暡匏

—

暡型名

LLM_MAX_TOKENS

吊

4096

单次生成䞊限

LLM_PROVIDER

吊

default

从 providers.json 选呜名䟛应商

LLM_PROVIDERS_PATH

吊

—

呜名䟛应商配眮文件路埄

AGENT_MAX_TURNS

吊

5

ReAct 掚理步数䞊限1-50

AGENT_TOOL_RETRY

吊

未实现

历史䞊文档化的变量圓前 ToolManager 仅识别 TOOL_RETRY_COUNT。将以䞋代码删陀前请保留旧行䞺兌容性。

TOOL_MAX_CONCURRENT

吊

10

ToolManager 并发䞊限

TOOL_RETRY_COUNT

吊

2

瞬时错误重试0-5

ANYSEARCH_API_KEY

吊

匿名

AnySearch 提升配额

ANYSEARCH_CACHE_TTL_MS

吊

3600000

AnySearch 工具发现猓存 TTL毫秒0 = 每次过期郜重发现

12.2 倚䟛应商配眮providers.json

{
  "providers": {
    "openai": {
      "apiKey": "sk-...",
      "baseUrl": "https://api.openai.com/v1",
      "model": "gpt-4o-mini"
    },
    "deepseek": {
      "apiKey": "sk-...",
      "baseUrl": "https://api.deepseek.com/v1",
      "model": "deepseek-chat"
    }
  }
}

⚠ 呜名空闎必须是 providers运行时圚 loadProviderConfig() 读取 content.providers?.[providerName]旧瀺䟋盎接平铺呜名空闎已䞍再生效。

启劚时讟眮 LLM_PROVIDERS_PATH=/path/to/providers.json + LLM_PROVIDER=openai。

⚠ 安党提瀺providers.json 含明文 API Key请务必

  • 加入 .gitignore䞍芁提亀到仓库

  • 文件权限讟䞺 chmod 600Linux/macOS

  • 圚 CI/CD 䞭通过密钥管理服务泚入避免硬猖码

  • 掚荐䌘先䜿甚 .env + 环境变量方匏§4.2倚䟛应商配眮仅圚需芁运行时切换暡型时䜿甚

12.3 内眮䟛应商参考

䟛应商

LLM_BASE_URL

LLM_MODEL 瀺䟋

LongCat

https://api.longcat.chat/openai/v1

LongCat-2.0

OpenAI

https://api.openai.com/v1

gpt-4o-mini

DeepSeek

https://api.deepseek.com/v1

deepseek-chat

Moonshot (Kimi)

https://api.moonshot.cn/v1

moonshot-v1-8k

SenseNova

https://token.sensenova.cn/v1

sensenova-6.7-flash-lite

Ollama (本地)

http://localhost:11434/v1

llama3.2


十䞉、项目结构

mini-agent-mcp/
├── LICENSE                           # Apache-2.0
├── README.md                         # 本文件
├── .env.example                      # 环境变量暡板
├── package.json
├── tsconfig.json
├── server.json                       # MCP Registry 元数据
├── assets/icon.png                   # 商店囟标
├── scripts/                          # 14 䞪独立测试脚本
│   ├── test-tools-list.mjs           # 通过 JSON-RPC 探测 tools/list
│   ├── test-agent.mjs                # ReAct (rule + LLM) 双暡匏
│   ├── test-workflow.mjs             # DAG + deep_research
│   ├── test-deep-research*.mjs       # 深床研究变䜓
│   ├── test-memory-skill.mjs         # 持久化层 CRUD
│   ├── test-anysearch*.mjs           # AnySearch 集成
│   ├── test-dag-buildStepTask.mjs    # 纯凜数单元测试
│   ├── test-research-parser.mjs      # 解析噚单元测试
│   └── ...                           # 集成 / 回園脚本
├── src/
│   ├── index.ts                      # FastMCP 入口 + 工具泚册
│   ├── agent/
│   │   ├── react.ts                  # ReAct 掚理埪环 + Hooks
│   │   ├── llm.ts                    # OpenAI SDK + Sampling
│   │   └── index.ts                  # run_agent / getLLMMode 等公共 API 重富出
│   ├── tools/
│   │   ├── manager.ts                # ToolManager (超时/并发/重试)
│   │   ├── registry.ts               # 工具泚册䞭心 (本地 + AnySearch 统䞀入口)
│   │   ├── index.ts                  # 6 䞪内眮工具的富出桶
│   │   ├── types.ts                  # ToolDefinition / ToolResult
│   │   ├── calculator.ts             # 安党数孊解析噚
│   │   ├── text.ts                   # text_stats + text_transform
│   │   ├── converter.ts              # 单䜍换算
│   │   ├── datetime.ts               # 日期时闎
│   │   ├── random.ts                 # 随机生成
│   │   ├── anysearch.ts              # AnySearch 工具包装
│   │   └── anysearch-client.ts       # MCPRuntime 状态机
│   ├── workflow/
│   │   ├── dag.ts                    # DAG 工䜜流猖排
│   │   └── research.ts               # 深床研究䞉阶段管线
│   ├── memory/index.ts               # 持久化记忆
│   └── skill/index.ts                # 技胜提取䞎匹配
└── dist/                             # 猖译产物

十四、安党䞎讟计理念

安党纊束

  • 所有 API Key 仅通过环境变量䌠递氞䞍入代码

  • ToolManager 内眮蟓入长床闚犁默讀 10,000 字笊calculator 500 字笊

  • 错误分类hard (401/403/DNS/refused) 盎接倱莥transient (timeout/429/5xx) 自劚重试 + 指数退避最倚 8s

  • 计算噚䜿甚自研递園䞋降解析噚䞍䜿甚 eval()

讟计原则

  • 协议䌘先䞥栌遵守 MCP JSON-RPC over stdio/SSE

  • 分层解耊ToolManager 统䞀抜象工具实现可插拔

  • 级联容错LLM / 眑络 / 工具层均有倚级 fallback

  • 本地䌘先记忆 / 技胜持久化到本地 JSON无需倖郚数据库

  • 零配眮可启劚最小可甚配眮䞺 0默讀走 Sampling 或 Rule-based

  • 可观测性Hooks§八提䟛 LLM 调甚前后拊截点可泚入审计日志 / 调甚统计 / 安党告譊ToolManager 内眮调甚历史䟿于回攟䞎调试

子路埄富入library 消莹

package.json 通过 exports 字段暎露以䞋子路埄

specifier

暎露的内容

mini-agent-mcp

工具 + Agent 猖排噚 + ToolManager + Hooks + LLM 䞊䞋文聚合入口

mini-agent-mcp/agent

runAgent、addCreateHook、addNextHook、clearHooks

mini-agent-mcp/agent/llm

callLLM、isSamplingAvailable、getLLMMode、withRequestContext 等

mini-agent-mcp/tools/manager

toolManager 单䟋、ToolManagerImpl 类、ToolEntry 类型

mini-agent-mcp/tools/internal-modules

runWorkflowTool、deepResearchTool、rememberTool 等高级内郚工具定义

mini-agent-mcp/workflow

runWorkflow、deepResearch、parseSubQuestions、buildStepTask

mini-agent-mcp/memory

remember、recall、searchMemories、getMemoryStats 等

mini-agent-mcp/skill

extractSkill、matchSkill、useSkill、listSkills、getSkillStats

每䞪 specifier 圚 npm install 后可盎接 importscripts/test-package-exports.mjs 把它们圓䜜䞀组集成的"包蟹界"测试圚 CI 䞭验证。


十五、CI 䞎本地倍现

.github/workflows/ci.yml 圚每次 push / PR 觊发䟝次跑

Job

觊发

关键步骀

testmatrix Node 18/20/22/24

push / PR 到 main

npm ci → npm run build → npm run lint → npm run format:check → npm test含 secret scan + 包蟹界测试

secret-scan

push / PR

node scripts/test-secret-scan.mjs

mcp-tools-list

push / PR

npm run build然后甚 JSON-RPC 探测 tools/list 必须仅返回 run_agent倖郚协议契纊

矩阵策略芆盖声明的 engines.node: ">=18"每䞪 job 单独决定是吊倱莥fail-fast: false。

倍现敎套 CI䞍需芁 GitHub

npm ci
npm run build
npm run lint
npm run format:check
npm test
node scripts/test-secret-scan.mjs

# MCP 契纊探测
printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"probe","version":"1"}}}\n{"jsonrpc":"2.0","method":"notifications/initialized"}\n{"jsonrpc":"2.0","id":2,"method":"tools/list"}\n' \
  | node dist/index.js \
  | node -e 'const lines=require("fs").readFileSync(0,"utf8").trim().split("\n"); const tools=JSON.parse(lines[lines.length-1]).result.tools; if (tools.length!==1||tools[0].name!=="run_agent") process.exit(1);'

十五、讞可证

Apache License 2.0 © 2026 Microbiosis


十六、盞关铟接

Available Tools

11 tools
anysearch_extractA

This is Anysearch's URL extraction tool. Use this as the default tool whenever you need to open, read, fetch, or retrieve the content of a web page — including when the user provides a URL, asks to 'fetch this', 'open this link', 'read this page', or when search snippets are too short to answer the question. Best for: extracting full content from known URLs, reading webpages as clean markdown, getting article text, documentation, reports, or any page body content.

IMPORTANT: Use this whenever search results lack detail. Fetches a URL and returns its full content as clean Markdown.

When to use — call extract after search whenever:

  • The search snippet is too short or truncated to answer the question

  • User asks to 'read', 'open', 'summarize', or 'get details from' a specific URL

  • You need to verify a specific claim, statistic, or fact from the original source

  • The result points to a full article, report, documentation page, or paper worth reading in full

  • The answer requires data only visible in the page body (tables, sections, code blocks not captured in snippet)

  • User provides a URL directly and asks about its content

When NOT to use

  • The search snippet already contains a complete, sufficient answer

  • You only need the URL or title (not the page body)

Constraints

  • url must start with http:// or https://

  • Only HTML pages are supported; PDF/binary files will return an error

  • Content is truncated at 50,000 characters

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe page URL to fetch. Must start with http:// or https://.

TDQS

A4.8/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries the full burden. It discloses that only HTML pages are supported (PDF/binary returns error), content is truncated at 50,000 characters, and URL must start with http:// or https://. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with markdown headers for when-to-use, when-not-to-use, and constraints. Front-loaded with purpose. Some slight redundancy (e.g., 'Best for' repeats earlier statements), but overall efficient and clear for the amount of guidance provided.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (1 required param, no output schema, no annotations) and diverse sibling tools, the description is highly complete. It covers usage context, constraints, error cases (PDF/binary), and return format (clean markdown). No major gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema has 100% description coverage on the url parameter. The description adds behavioral context beyond the schema, such as constraints (only HTML pages, truncation) and that the URL must start with http:// or https://, which is also in schema but reinforces it. Minor redundancy, but adds value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it is a URL extraction tool for fetching web page content as clean markdown. It distinguishes itself from sibling tools like anysearch_search by specifying when to use it after search, and uses a specific verb-resource combination (extract URL content).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides extensive when-to-use and when-not-to-use guidance, including explicit contrasts with search snippets and specific scenarios such as when snippets are too short or user asks to read a URL. Clearly states alternatives like using search if snippet is sufficient.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

anysearch_get_sub_domainsA

This is Anysearch's domain discovery tool. IMPORTANT: Step 1 of vertical search. REQUIRED before any search that uses a domain. Returns valid sub_domains and sub_domain_params for the specified domain(s).

Call this when the query targets a specialized vertical or needs structured parameters: stock prices, financial data, academic papers, legal cases, medical/drug info, flight status, weather, exchange rates, geographic POIs, code repositories, or any domain where a structured identifier (ticker, DOI, CVE, IATA, coordinates) is involved.

When to call — pick the domain(s) that match what the user is asking about:

resource social_media finance academic legal health business security ip code energy environment agriculture travel film gaming

Input — choose from the list above and pass via the domain or domains parameter:

  • domain: single domain string (use only when 100% certain the query is single-domain)

  • domains: batch query for up to 5 domains in one call (takes priority over domain)

🏆 ALWAYS prefer the domains (plural, array) parameter. Pass ALL potentially relevant domains at once — even for seemingly single-domain queries, consider related domains:

  • Query about "cryptocurrency regulations" → domains=["finance", "legal", "security"]

  • Query about "best gaming laptops" → domains=["gaming", "tech", "ecommerce"]

  • Query about "climate change impact on agriculture" → domains=["environment", "energy", "academic"]

Returns

Markdown table filtered to the specified domains: sub_domain | description | params

CRITICAL: How to use results

  • sub_domain is the PRIMARY routing key — always pass it to search

  • params column shows available structured parameters — pass them via sub_domain_params in search, NEVER embed in query

  • If multiple sub_domains returned (especially from multiple domains), use batch_search — one query per sub_domain — instead of multiple sequential search calls

  • Params marked (required) in the output MUST be passed when using that sub_domain in search. If a required param is not applicable to your query, pass it as an empty string (key: "") — do not skip it.

ParametersJSON Schema
NameRequiredDescriptionDefault
domainNoFilter by a single domain. Mutually exclusive with domains array.
domainsNoBatch query for multiple domains in a single call. Takes priority over domain. Each item must be a valid domain value. Max 5.

TDQS

A4.7/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It discloses that the tool is a discovery step (read-only), describes the return format, and gives critical instructions on parameter handling. Minor missing info on permissions or side effects, but overall transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Description is relatively long but well-structured with sections and bullet points. Front-loaded with purpose and importance. Could be slightly trimmed but every section adds necessary context.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given 2 parameters, no output schema, and complexity (multiple domains, structured params), the description is very complete. It explains what is returned (markdown table), how to use results, and integrates with sibling tools like batch_search and search.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with clear enum descriptions. Description adds significant value: explains the mutual exclusivity of domain vs domains, strongly recommends using 'domains', shows example queries, and clarifies how to interpret the params column in results.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it is a domain discovery tool for vertical search, prerequisite for searches that use a domain. It distinguishes itself from sibling tools like anysearch_search by being step 1 and returning sub_domains and params.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides explicit when-to-call guidance with a list of domains, recommends using the plural 'domains' parameter with examples, and explains how to use results (sub_domain as primary key, pass params via sub_domain_params, use batch_search for multiple sub_domains).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

calculatorA

Evaluate a mathematical expression safely. Supports +, -, *, /, %, ^ (power), parentheses, and functions: sqrt, abs, sin, cos, tan, asin, acos, atan, log (base 10), ln (natural), exp, floor, ceil, round. Constants: pi, e. Example: 'sqrt(16) + 2^3' = 12

ParametersJSON Schema
NameRequiredDescriptionDefault
expressionYesThe mathematical expression to evaluate, e.g. '2 + 3 * 4' or 'sqrt(144) + pi'

TDQS

A4.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It mentions 'safely' implying no side effects, but does not elaborate on error handling, return format, or limits. For a calculator, this is adequate but not exceptional.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences are optimally concise: the first states purpose and safety, the second lists capabilities with an example. No filler—every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no annotations or output schema, the description is complete for a calculator tool: it covers all supported operations, constants, and provides a clear example. Additional details like return type are unnecessary given the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% with a basic explanation. The description adds significant value by detailing supported operators, functions, constants, and an example, going well beyond the schema's minimal 'mathematical expression' note.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Evaluate') and resource ('mathematical expression'), lists supported operations, functions, and constants, and provides an example. It clearly distinguishes from sibling tools which are unrelated (search, text, datetime, etc.).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Although no explicit when-not or alternative tools are mentioned, the description makes it obvious this tool is for math evaluation. Given the sibling context, there is no ambiguity, so it scores well but lacks formal usage boundaries.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

datetime_infoA

Get current date/time, format a date, or calculate the difference between two dates. Operations: 'now' (current date/time, optional timezone), 'format' (format a date string, requires 'date' and 'format' params), 'diff' (difference between two dates, requires 'date' and 'date2' params). Date format: ISO 8601 (e.g. '2024-01-15') or natural language. Format string uses: YYYY, MM, DD, HH, mm, ss, dddd (day name).

ParametersJSON Schema
NameRequiredDescriptionDefault
dateNoDate string for format/diff operations (ISO 8601 or parseable date)
date2NoSecond date for diff operation
formatNoFormat string for format operation, e.g. 'YYYY-MM-DD HH:mm:ss'
timezoneNoTimezone for 'now' operation, e.g. 'Asia/Shanghai', 'America/New_York'. Defaults to UTC.
operationYesThe datetime operation to perform

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses the tool's behavior: it performs three read-only datetime operations. It specifies input formats (ISO 8601, natural language) and format string patterns, giving the agent clear expectations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured: it starts with a high-level summary, then breaks down each operation with examples. Each sentence adds value, though it could be slightly more concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 5 parameters, three operations, and no output schema, the description covers input formats, required parameters per operation, and format string components. It is nearly complete, leaving little ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Although the input schema already describes all parameters (100% coverage), the description adds meaning by explaining the context of each operation, how parameters combine, and the format string syntax. It goes beyond schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's three operations: get current date/time, format a date, and calculate date difference. It distinguishes itself from sibling tools like calculator or random_gen by focusing specifically on datetime operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit instructions for when to use each operation (now, format, diff) and which parameters are required. However, it does not explicitly state when NOT to use this tool or list alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

random_genA

Generate random values. Operations: 'number' (random int in range, requires 'min' and 'max'), 'uuid' (UUID v4), 'password' (random password, optional 'length' and 'uppercase'/'symbols' flags), 'pick' (pick N items from a list, requires 'items' array and optional 'count'), 'shuffle' (shuffle a list, requires 'items' array).

ParametersJSON Schema
NameRequiredDescriptionDefault
maxNoMaximum value for 'number' operation (inclusive)
minNoMinimum value for 'number' operation (inclusive)
countNoNumber of items to pick for 'pick' operation (default 1)
itemsNoArray of items for pick/shuffle operations
lengthNoLength for password (default 16)
symbolsNoInclude symbols in password (default true)
operationYesThe random generation operation
uppercaseNoInclude uppercase in password (default true)

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description fully discloses behavioral traits: it explains each operation's process (e.g., 'number' generates random int in range, 'uuid' generates UUID v4) and defaults (password length 16, etc.). No destructive behavior is mentioned, which is consistent with a read-only generator.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence efficiently listing operations and their parameters. It is front-loaded with 'Generate random values.' While dense, it covers all necessary information without waste. A slightly more structured format would improve readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 operations, 8 parameters) and no output schema, the description provides sufficient context about each operation's inputs and behavior. It does not cover return values, but that is acceptable per guidelines. It is complete for a stateless random value generator.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds meaning by grouping operations and clarifying required parameters per operation (e.g., 'min' and 'max' for number, 'items' for pick/shuffle), which is not evident from the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Generate random values' and enumerates five specific operations (number, uuid, password, pick, shuffle), providing a clear verb and resource. The tool is distinctly different from siblings like search, calculator, and text tools, so no sibling confusion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implicitly tells when to use each operation via parameter requirements, but lacks explicit guidance on when to use this tool vs alternatives or when not to use it. Since siblings are unrelated, the context is adequate but not explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

run_agentA

Run a mini ReAct agent that can autonomously use all available tools to complete a task. The agent reasons step-by-step: it thinks about what to do, selects a tool, executes it, observes the result, and continues until it has enough information to give a final answer.

The agent supports multi-step tasks. Examples:

  • "Calculate 15 * 23 + sqrt(144)"

  • "Convert 100 cm to inches and also generate a UUID"

  • "What time is it in Asia/Shanghai?"

  • "Generate a 20-character password and tell me today's date"

  • "Search the web for the latest news about AI agents"

  • "Extract the content from https://example.com/article"

Available tool categories:

  • Built-in: calculator, text_stats, text_transform, unit_convert, datetime_info, random_gen

  • AnySearch (if connected): anysearch_search, anysearch_batch_search, anysearch_extract, anysearch_get_sub_domains

If LLM_API_KEY + LLM_BASE_URL + LLM_MODEL are all set (no defaults), the agent uses LLM-powered reasoning. Otherwise it uses a rule-based pattern matching engine.

ParametersJSON Schema
NameRequiredDescriptionDefault
taskYesThe task for the agent to complete. Be specific about what you want.

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully convey behavior. It explains step-by-step reasoning and two execution modes, but does not disclose potential side effects (e.g., network calls if anysearch tools are used) or latency considerations. The behavioral description is adequate but not exhaustive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with paragraphs, bullet-point examples, and tool categories. It is front-loaded with the main purpose. While slightly long, every part adds context. Could be slightly more concise but is effectively organized.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity as an orchestrator, the description covers key aspects: purpose, reasoning process, execution modes, and dependencies (LLM config). It lists available tools. Missing details like error handling or limitations, but overall sufficient for an agent to understand usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single 'task' parameter, so baseline is 3. The description adds value through examples but does not elaborate on task format or constraints beyond what the schema says ('Be specific'). The added semantics are marginal.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description explicitly states the tool runs a mini ReAct agent that autonomously uses all available tools. It provides a clear verb-resource pair and distinguishes itself from sibling tools (which are individual tools, while this is an orchestrator). Examples further clarify its purpose.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description lists example tasks and explains when to use the tool (multi-step tasks requiring reasoning). It also notes conditions for LLM vs rule-based mode. However, it does not explicitly state when not to use it or compare to alternatives beyond listing sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

text_statsA

Analyze text and return statistics: character count, word count, sentence count, paragraph count, average word length, and most frequent words.

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesThe text to analyze

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must fully disclose behavioral traits. It states that the tool returns statistics, implying a read-only operation, but does not explicitly confirm it is non-destructive or side-effect-free. Lacks details on limitations or required permissions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-structured sentence that front-loads the action and immediately lists outputs. Every word earns its place with no redundancy or filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, no output schema, no annotations), the description is reasonably complete. It explains inputs and outputs, though it could mention potential constraints (e.g., text length limits) to be fully self-contained.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage for the single parameter 'text', so the description does not need to add parameter details. The description adds context on what statistics are computed, which indirectly helps understand the parameter's role, but does not surpass a baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('Analyze text') and resource ('text'), and enumerates specific outputs (character count, word count, etc.), making it easy to understand what the tool does. No sibling tool duplicates this functionality, so differentiation is clear.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool versus alternatives like 'text_transform' or when not to use it. The description does not provide context about prerequisites, preferred scenarios, or exclusions, leaving the agent to infer usage.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

text_transformA

Transform text in various ways. Operations: uppercase, lowercase, titlecase, reverse, trim, remove_duplicates (remove duplicate lines), sort_lines, count_substring (requires 'pattern' param), replace (requires 'pattern' and 'replacement' params).

ParametersJSON Schema
NameRequiredDescriptionDefault
textYesThe text to transform
patternNoPattern for count_substring or replace operations
operationYesThe transformation to apply
replacementNoReplacement text for replace operation

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the burden. It lists operations and param requirements but does not disclose whether operations are read-only or have side effects. However, the nature of text transformation is inherently non-destructive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with a clear bullet-like list. It is front-loaded with the purpose and each word adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and 4 parameters, the description covers operations and param dependencies. It does not explain return values, but for a text transform the output is obvious.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds value by specifying which parameters are needed for which operations, e.g., 'count_substring (requires 'pattern' param)'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool transforms text in various ways and lists all specific operations. It distinguishes itself from sibling tools which are for different domains (search, calculation, date, etc.).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description lists operations and their required parameters (e.g., pattern for count_substring). It does not explicitly state when not to use this tool or give alternatives, but the context of sibling tools makes it clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

unit_convertA

Convert between units of the same category. Categories: length (mm, cm, m, km, inch, in, ft, yard, yd, mile, mi), weight (mg, g, kg, ton, t, oz, lb, pound), temperature (C, F, K), data (bit, byte, KB, MB, GB, TB). Example: convert 100 from 'cm' to 'inch'.

ParametersJSON Schema
NameRequiredDescriptionDefault
toYesTarget unit, e.g. 'inch', 'lb', 'F', 'MB'
fromYesSource unit, e.g. 'cm', 'kg', 'C', 'KB'
valueYesThe value to convert

TDQS

A4.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavior. It lists supported units and categories but omits details like error handling for mismatched categories or invalid units, which are important for an AI agent to anticipate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences plus an example, making it very concise. Key information is front-loaded with the purpose immediately stated.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and the description covers categories and units adequately. No output schema exists, but the return format is implicitly clear for a conversion tool. Minor gap: no mention of precision or rounding.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for each parameter. The description adds value by providing category groupings and a concrete example, enhancing understanding beyond the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Convert between units of the same category' and provides specific categories and examples. It distinguishes itself from sibling tools like calculator or random_gen by focusing on unit conversion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains the tool's purpose and gives an example, but it doesn't explicitly state when to use it over alternatives or provide any preconditions. However, the context is clear enough for most use cases.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

  1. 11 tool updatesv1.0.1
    • First observedanysearch_batch_search
    • First observedanysearch_extract
    • First observedanysearch_get_sub_domains
    • First observedanysearch_search
    • First observedcalculator
    • First observeddatetime_info
    • First observedrandom_gen
    • First observedrun_agent
    • First observedtext_stats
    • First observedtext_transform
    • First observedunit_convert

TDQS

A4.2/5.0

Scored across 11 tools

Disambiguation5/5

Each tool has a distinct purpose: search tools (anysearch_search, anysearch_batch_search, anysearch_extract, anysearch_get_sub_domains) are clearly separated, and utility tools (calculator, datetime_info, etc.) are unique. No two tools overlap in functionality.

Naming Consistency4/5

Tool names follow a pattern: Anysearch tools are prefixed with 'anysearch_', while built-in utilities use plain names like 'calculator'. This split is consistent within categories but introduces two naming conventions, which is a minor deviation.

Tool Count5/5

With 11 tools covering search, extraction, domain discovery, and common utilities (calculator, datetime, random, text operations, unit conversion), the count is well-scoped for a general-purpose assistant with web search capabilities.

Completeness4/5

The tool surface covers core operations: search (including batch and extraction), domain routing, and basic utilities. Minor gaps like file handling or more advanced text processing are absent, but the set is sufficiently complete for its stated purpose.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    C
    maintenance
    A multi-tool MCP server that enhances local LLMs with web search, document reading, scholarly research, Wikipedia access, and calculator functions. Provides comprehensive tools for information retrieval and computation without requiring API keys by default.
    22
    1
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    A custom MCP server with 6 utility tools (file search, file reading, math calculation, JSON formatting, time query, system info) that demonstrates MCP protocol workflow and integrates with LangChain agents.
    -
  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    MCP server implementing ReAct reasoning-acting loops with tools like search, lookup, and finish, supporting both fixture and OpenAI LLMs for offline-first, traceable agent execution.
    -