secretary-mcp
Provides web search fallback via DuckDuckGo, enabling the server's ask_web tool to search the web and retrieve sources when Tavily is not configured.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@secretary-mcp delegate: summarize today's news about AI regulation with sources"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
小秘书 MCP(secretary-mcp)
给主 Agent 减负的子 Agent 模式 MCP。只向主模型暴露三个高层工具:
工具 | 作用 | 子 Agent 内部可用能力 |
| 回忆此前记住的偏好/事实/笔记 | memory_search / memory_list / memory_read |
| 联网查证一个问题,返回凝练结论+来源 | web_search / fetch_url(多轮搜索→精读→再搜) |
| 整体交办一件多步骤杂活 | 上述全部 + memory_write |
核心机制:主模型上下文只增加「一次工具调用 + 一条凝练结论」。子 Agent 的多轮
tool_call(搜索 → 打开网页 → 再搜 → 收敛)全部发生本进程内,原始网页大段文本、
搜索结果列表永远不会进主模型上下文。子 Agent 必须通过 submit_answer 提交结论,
并有轮次上限(默认 10 轮,超限强制收敛)。
配置(MCP 客户端接入)
{
"mcpServers": {
"secretary": {
"command": "node",
"args": ["<本目录绝对路径>/dist/index.js"],
"env": {
"LLM_API_KEY": "你的 API Key",
"LLM_BASE_URL": "https://open.bigmodel.cn/api/paas/v4",
"LLM_MODEL": "glm-4.5-flash",
"SECRETARY_MEMORY_DIR": "<本目录绝对路径>/memory",
"TAVILY_API_KEY": "可选,推荐配置"
}
}
}
}环境变量
变量 | 必填 | 说明 |
| ✅ | 子 Agent 用的便宜模型 API Key |
| OpenAI 兼容端点,默认智谱 | |
| 默认 | |
| 记忆库目录,默认 | |
| 搜索供应商;不配则回退 DuckDuckGo HTML(无密钥但可能被限流) | |
| 子 Agent 最大轮次,默认 10 |
Related MCP server: mcp-delegate
构建
npm install
npm run build设计说明
记忆库:本地 markdown 文件(可手改),按段落切块 + 关键词词频打分检索, 内置中文虚词停用词表,零向量库依赖。
搜索:有
TAVILY_API_KEY走 Tavily;否则解析 DuckDuckGo HTML 页(宽松解析, 改版/限流会失败,生产建议配 Tavily)。网页抓取:剥掉 script/style 取正文,单页截断 9000 字符,防止子 Agent 上下文爆炸。
容错:模型不调
submit_answer而直接输出文本时视为最终答案;轮次用尽则强制 无工具收敛一次;工具报错会作为消息回给子 Agent 让它自行调整。
已知取舍
记忆检索是词频匹配,不是语义检索——查询词需要和记忆原文有字面重叠。
delegate 的子 Agent 有 memory_write 权限,可写任意
.md文件(已做路径逃逸防护)。主 Agent 应给 delegate 传自包含的任务描述,子 Agent 看不到主对话。
Available Tools
3 toolsask_memoryA
问自己的长期记忆库(本地 markdown 文件)。用于回忆此前记住的偏好、事实、笔记、结论。返回检索整理后的答案;记忆库为空或无匹配时也会如实说明。
Inputs: question (required).
ask_webA
联网查资料。内部子 Agent 会多轮搜索、打开网页、交叉核对后给出凝练结论(带来源链接)。适合'查一下某库最新版本/某事实/某价格'这类会吃掉大量上下文的调研。
Inputs: question (required).
delegateA
把一件多步骤杂活整体交办给子 Agent。子 Agent 可联网搜索、抓网页、读写记忆库,自主多轮操作后交回最终成果。适合调研汇总、整理资料、把结论存入记忆等。任务描述要自包含。
Inputs: task (required), background.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
ask_memory and ask_web are cleanly separated by information source (local notes vs internet), and delegate is positioned as a general multi-step task handoff rather than a simple query. There is some overlap because delegate can also search the web and touch memory, but the descriptions make the intended use cases clear.
ask_memory and ask_web follow a clear ask_<source> pattern, while delegate breaks the ask_ prefix but still uses a single, readable verb that signals a different kind of action. The naming is consistent in style (lowercase snake_case) and easy to predict.
Three tools is on the lean side for a 'secretary' server, but each tool covers a broad, high-level capability: recall, research, and delegation. The count feels slightly under-scoped rather than excessive, and no tool feels redundant.
The tool surface covers core secretary workflows like recalling stored information, researching current facts, and handing off messy tasks. However, there is no direct tool to save/update/delete memories—write access only exists indirectly through delegate—and broader secretary features like task or calendar management are absent.
Maintenance
Related MCP Connectors
Stop re-explaining yourself to Agents. Give it the right context, right when needed.
Private memory, scratchpads, context export/restore and task handoff for AI agents.
Shared task layer for AI agents: tasks, handoffs and decisions that persist across tools.
Task-first cross-agent collaboration for discussions, review, referrals, and reusable knowledge.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI coding agents like Claude Code or Codex to delegate tasks to a DeepSeek Harness subagent with its own context window, providing tools for task delegation, result waiting, continuation, and supervision with sandboxed execution.6MIT
- FlicenseAqualityBmaintenanceEnables delegating tasks to a separate, full agentic loop running on a different model, with its own tool access, returning only the final result.4-
- AlicenseNot gradedqualityCmaintenanceEnables coding agents to delegate file reads, command output triage, page fetching, and image inspection to cheap flash models, returning concise answers and verified pointers while keeping raw dumps out of the main model's context.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP-capable coding assistants to delegate repository investigation, bounded implementation work, and noisy command runs (tests, builds, linters) to sandboxed OpenCode agents. Each role can use an independently selected model, and only concise results are returned to the parent agent, which keeps responsibility for architecture and high-risk operations.MIT