Mini Agent MCP 智能代理服务器
Mini Agent MCP 是一个基于 Model Context Protocol (MCP) 的智能代理服务,集成了小型 ReAct 代理。它可以自主调用多个工具完成复杂的多步任务,支持 LLM 驱动和规则引擎两种模式。内置 AnySearch 搜索能力 — 网页搜索、域名搜索、批量搜索、URL 内容提取。Agent 支持多模型 LLM 通信,优先使用 MCP Sampling(客户端模型),也支持 Direct HTTP 回退。
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"mini-agent-mcp": {
"args": [
"-y",
"mini-agent-mcp"
],
"command": "npx",
"env": {
"ANYSEARCH_API_KEY": "",
"LLM_API_KEY": "",
"LLM_BASE_URL": "",
"LLM_MAX_TOKENS": "4096",
"LLM_MODEL": ""
},
"type": "stdio"
}
}
}
该服务需要配置环境变量:ANYSEARCH_API_KEY、LLM_API_KEY、LLM_BASE_URL、LLM_MAX_TOKENS、LLM_MODEL
可用工具 (14 个)
该服务在 MCP 协议中暴露的工具,AI 可按需调用
calculator 1 个参数 需填 1 项
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
必填参数:expression
text_stats 1 个参数 需填 1 项
Analyze text and return statistics: character count, word count, sentence count, paragraph count, average word length, and most frequent words.
必填参数:text
text_transform 4 个参数 需填 2 项
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).
必填参数:text、operation
unit_convert 3 个参数 需填 3 项
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'.
必填参数:value、from、to
datetime_info 5 个参数 需填 1 项
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).
必填参数:operation
random_gen 8 个参数 需填 1 项
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).
必填参数:operation
run_agent 2 个参数 需填 1 项
Run a ReAct agent that can autonomously use all available tools to complete a task. Supports multi-step tasks with LLM or rule-based mode.
必填参数:task
run_workflow 1 个参数 需填 1 项
Run a multi-step DAG workflow. Define steps with dependencies; runs them in order. Each step is an agent task.
必填参数:steps
deep_research 1 个参数 需填 1 项
Run a deep research workflow on a question. Breaks down the question, searches for each sub-topic, and produces a comprehensive report.
必填参数:question
remember 3 个参数 需填 2 项
Store a memory (fact, preference, task, or conversation) with tags for later recall.
必填参数:type、content
recall 1 个参数 需填 1 项
Recall memories by tags. Returns the most relevant memories matching the given tags.
必填参数:tags
memory_stats
Get memory statistics: total count and breakdown by type.
该工具无需必填参数,直接调用即可
extract_skill 5 个参数 需填 5 项
Extract a reusable skill from a completed task. The agent learns how to handle similar tasks in the future.
必填参数:name、description、exampleTask、steps、tags
list_skills
List all extracted skills, sorted by use count.
该工具无需必填参数,直接调用即可
服务介绍
Mini Agent MCP
中文名称: Mini Agent MCP 智能代理服务器
英文名称: Mini Agent MCP
服务分类: 搜索工具 / AI Agent / 开发者工具
来源地址: https://github.com/Microbiosis/mini-agent-mcp
托管部署: 可托管部署(无本地环境依赖,支持云端一键部署)
服务介绍
Mini Agent MCP 是一个集成了 ReAct 小型 Agent 的 MCP (Model Context Protocol) 智能代理服务。Agent 可以自主调用多个工具完成复杂的多步任务,支持 LLM 驱动和规则引擎两种模式。
内置 AnySearch 搜索能力 — 网页搜索、域名搜索、批量搜索、URL 内容提取。Agent 支持多模型 LLM 通信,优先使用 MCP Sampling(客户端模型),也支持 Direct HTTP 回退。
服务描述
基于 MCP 协议的智能代理服务器,集成了 6 个内置工具(计算器、文本分析、单位转换、日期时间、随机生成、ReAct Agent)和 4 个 AnySearch 搜索工具。支持多步推理(最多 8 步),可自主组合调用工具完成任务。支持 MCP Sampling 多模型通信,无需服务器端 API Key 即可调用 LLM。
✨ 核心功能
- 🧮 内置工具 — 计算器、文本分析、文本转换、单位转换、日期时间、随机生成,共 6 个无需 API Key 的本地工具
- 🤖 ReAct Agent — 支持 Thought → Action → Observation 多步推理循环,最多可组合调用 8 个工具步骤
- 🔍 AnySearch 搜索 — 通过 MCP Streamable HTTP 集成 AnySearch,支持通用搜索、批量搜索(1-5 并行)、URL 内容提取、垂直领域搜索
- 🔗 多模型通信 — 支持 MCP Sampling(客户端模型)和 Direct HTTP(自有 API)两种 LLM 通信方式
- ☁️ 可托管部署 — 无本地环境依赖,可一键部署到 ModelScope MCP 广场,自动生成 SSE 访问地址
🚀 快速上手
方式 1: MCP 客户端配置(推荐)
将以下 JSON 配置添加到您的 MCP 客户端配置文件中:
ZCode / Claude Desktop / Cursor / VS Code
{
"mcpServers": {
"mini-agent-mcp": {
"type": "stdio",
"command": "npx",
"args": ["mini-agent-mcp"],
"env": {
"ANYSEARCH_API_KEY": "",
"LLM_API_KEY": "",
"LLM_BASE_URL": "",
"LLM_MODEL": ""
}
}
}
}
本地运行 / 可托管部署 (STDIO)
{
"mcpServers": {
"mini-agent-mcp": {
"type": "stdio",
"command": "node",
"args": ["dist/index.js"],
"env": {
"ANYSEARCH_API_KEY": "",
"LLM_API_KEY": "",
"LLM_BASE_URL": "",
"LLM_MODEL": ""
}
}
}
}
方式 2: 本地开发
git clone https://github.com/Microbiosis/mini-agent-mcp.git
cd mini-agent-mcp
npm install
npm run build
node dist/index.js # 运行 MCP 服务器
node dist/index.js --test # 运行测试
🛠️ 工具列表
内置工具
| 工具名称 | 说明 | 参数 |
|---|---|---|
calculator |
安全数学表达式求值(支持 sqrt, sin, cos, pi 等) | expression (string, 必需) |
text_stats |
文本统计分析(字数、词频、句子数等) | text (string, 必需) |
text_transform |
文本转换(大小写、反转、排序、去重等) | text (string, 必需), operation (string, 必需) |
unit_convert |
单位转换(长度、重量、温度、数据) | value (number, 必需), from (string, 必需), to (string, 必需) |
datetime_info |
日期时间查询、格式化、差值计算 | operation (string, 必需) |
random_gen |
随机数、UUID、密码、列表抽取 | operation (string, 必需) |
run_agent |
ReAct Agent — 自主调用上述工具完成多步任务 | task (string, 必需) |
AnySearch 工具(自动发现)
启动时自动连接 https://api.anysearch.com/mcp 动态发现:
| 工具名称 | 说明 | 参数 |
|---|---|---|
anysearch_search |
通用搜索(支持金融、学术、法律等垂直领域) | query (string, 必需), max_results (number, 可选) |
anysearch_batch_search |
1-5 个独立查询并行搜索 | queries (array, 必需) |
anysearch_extract |
URL 网页内容提取(Markdown,最多 50,000 字符) | url (string, 必需) |
anysearch_get_sub_domains |
查询垂直领域目录(领域搜索前必须先调用) | domain (string, 可选) |
🤖 Agent 工作流程
用户任务 → [Thought: 分析任务]
→ [Action: 选择工具] → [执行工具] → [Observation: 观察结果]
→ [Thought: 继续推理]
→ ... (最多 8 步)
→ [Final Answer: 最终答案]
📡 LLM 通信模式(多模型)
方式 1: MCP Sampling(推荐)
服务器通过 MCP 协议的 sampling/createMessage 请求,让**客户端(如 ZCode / Claude Desktop / Cursor)**代为调用 LLM。
- 零配置 — 服务器不需要 API Key,不需要知道模型名称
- 客户端决定模型 — 客户端使用用户选择的模型
- 支持多模型通信 — 客户端可以灵活选择不同的模型进行推理
这是 MCP 的原生多模型通信方式。只要客户端支持 sampling,Agent 就能使用客户端的 LLM。
方式 2: Direct HTTP(回退)
服务器直接调用 OpenAI 兼容 API。需要设置全部三个环境变量:
| 变量 | 说明 | 示例 |
|---|---|---|
LLM_API_KEY |
API 密钥 | your-api-key |
LLM_BASE_URL |
API 端点 | https://api.longcat.chat/openai |
LLM_MODEL |
模型名称 | LongCat-2.0-Preview |
没有默认值。三项全设才启用 HTTP 模式。
总结
| 场景 | LLM 模式 |
|---|---|
| 在 ZCode / Claude / Cursor 中作为 MCP 服务器运行 | MCP Sampling(客户端模型)✅ |
独立运行 + 设置了 LLM_* 三项 |
Direct HTTP |
| 独立运行 + 未设置环境变量 | 规则引擎模式(无 LLM) |
🔧 环境变量
| 变量 | 必需 | 说明 | 默认值 |
|---|---|---|---|
ANYSEARCH_API_KEY |
否 | AnySearch API Key | 匿名访问(更低限额) |
LLM_API_KEY |
否 | LLM API 密钥 | 无(回退到 Sampling) |
LLM_BASE_URL |
否 | LLM 端点 URL | 无 |
LLM_MODEL |
否 | LLM 模型名称 | 无 |
📋 使用示例
内置工具调用示例
Task: "Calculate 25 * 4 + sqrt(81) and then convert 500 grams to pounds"
Agent 会自动:
- 调用
calculator计算25 * 4 + sqrt(81) = 109 - 调用
unit_convert转换500 grams = 1.10 pounds - 返回完整的推理过程和最终答案
搜索任务示例
Task: "Search for the latest AI agent frameworks and summarize the top 3"
Agent 会调用 anysearch_search 获取搜索结果,然后推理总结。
批量搜索示例
Task: "Search for 'React vs Vue' and 'TypeScript trends 2025' in parallel"
Agent 会调用 anysearch_batch_search 同时发起多个查询。
🏗️ 项目结构
mini-agent-mcp/
├── LICENSE # Apache-2.0 许可证
├── README.md # 项目文档
├── package.json # NPM 包配置
├── tsconfig.json # TypeScript 配置
├── assets/
│ └── icon.png # 项目图标 (512x512)
├── src/
│ ├── index.ts # MCP 服务器入口
│ ├── tools/
│ │ ├── types.ts # 工具类型定义
│ │ ├── registry.ts # 工具注册表
│ │ ├── calculator.ts # 数学计算器
│ │ ├── text.ts # 文本工具
│ │ ├── converter.ts # 单位转换
│ │ ├── datetime.ts # 日期时间
│ │ ├── random.ts # 随机生成
│ │ ├── anysearch-client.ts # AnySearch MCP 客户端封装
│ │ └── anysearch.ts # AnySearch 工具动态包装
│ └── agent/
│ ├── llm.ts # LLM 通信 (Sampling + HTTP)
│ ├── react.ts # ReAct 推理循环
│ └── index.ts # Agent 工具定义
└── dist/ # 编译输出
🔐 安全说明
- 无本地数据存储
- API Key 通过环境变量传递,不写入代码或日志
- 使用 MCP 标准协议通信
- 托管部署在阿里云函数计算 MicroVM 沙箱隔离环境中运行
- SSE 访问地址为专属敏感信息,请勿泄露
⚠️ 使用限制
- 免费托管服务有调用配额限制(超限返回 HTTP 429)
- 匿名 AnySearch 访问有速率限制(建议配置 API Key)
- Agent 单次任务最多 8 个工具调用步骤
📄 许可证
Apache License 2.0 © 2026 Microbiosis
本项目集成了 AnySearch(Apache-2.0 许可证)。
🤝 贡献
欢迎提交 Issue 和 PR:https://github.com/Microbiosis/mini-agent-mcp/issues
Fork → 修改 → 提交请求即可。