onion-mcp-server
OfficialProvides web search capabilities using DuckDuckGo, enabling AI agents to search the web without an API key.
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., "@onion-mcp-server Translate 'Hello, world!' to French."
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.
onion-mcp-server
A feature-rich MCP Server for onion-ai — 30 tools across 6 categories.
✨ 工具列表(30 个)
分组 | 工具 | 说明 |
🤖 AI |
| 多轮对话,支持历史和 system prompt |
🤖 AI |
| 智能翻译,40+ 语言,自动检测源语言 |
🤖 AI |
| 长文摘要(要点/段落/一句话) |
🤖 AI |
| 文本改写(正式/口语/简洁/扩写) |
🤖 AI |
| 结构化信息提取(人名/地名/关键词等) |
🤖 AI |
| 文本分类(情感/主题/意图/自定义) |
💻 Code |
| 解释代码逻辑 |
💻 Code |
| 代码审查(Bug/安全/性能/风格) |
💻 Code |
| 根据描述生成代码 |
💻 Code |
| 代码语言转换 |
💻 Code |
| 修复代码错误 |
💻 Code |
| 生成文档注释 |
📝 Text |
| JSON/YAML/纯文本格式化 |
📝 Text |
| 文本差异对比(unified diff) |
📝 Text |
| 模板渲染( |
📝 Text |
| 字数/行数/Token 统计 |
📝 Text |
| 清理文本(去空行/去重/标准化) |
📊 Data |
| JSONPath 风格查询 |
📊 Data |
| CSV 数据分析与统计 |
📊 Data |
| 数据转 Markdown 表格 |
📊 Data |
| JSON/CSV/YAML/TOML 互转 |
🌐 Web |
| 抓取网页内容(返回纯文本) |
🌐 Web |
| DuckDuckGo 搜索(无需 API Key) |
🌐 Web |
| 提取网页结构化信息 |
⚙️ System |
| 获取当前时间(支持时区) |
⚙️ System |
| 生成 UUID(v1/v4) |
⚙️ System |
| 计算 Hash(md5/sha256 等) |
⚙️ System |
| Base64 编解码 |
⚙️ System |
| URL 编解码 |
⚙️ System |
| JSON 格式验证 |
Related MCP server: oh-my-mcp
🚀 快速开始
方式一:通过 onion CLI(推荐)
# 1. 设置 API Key
export ONION_MCP_API_KEY=sk-...
export ONION_MCP_MODEL=gpt-4o-mini # 可选,默认 gpt-4o-mini
export ONION_MCP_BASE_URL=https://... # 可选,兼容 DeepSeek/Qwen/Ollama
# 2. 添加到 onion
onion mcp add onion-mcp \
-c uvx \
-a '["onion-mcp-server"]' \
--env '{"ONION_MCP_API_KEY":"sk-...","ONION_MCP_MODEL":"gpt-4o-mini"}'
# 3. 测试
onion mcp inspect onion-mcp
onion mcp call onion-mcp sys_time '{}'
onion mcp call onion-mcp ai_translate '{"text":"Hello world","target_language":"中文"}'方式二:Claude Desktop / Cursor
# 导出配置
onion mcp config --claude-format或手动添加到 ~/.config/claude/claude_desktop_config.json:
{
"mcpServers": {
"onion-mcp": {
"command": "uvx",
"args": ["onion-mcp-server"],
"env": {
"ONION_MCP_API_KEY": "sk-...",
"ONION_MCP_MODEL": "gpt-4o-mini"
}
}
}
}方式三:本地开发
git clone https://github.com/onion-ai/mcp-server
cd mcp-server
pip install -e ".[all]"
export ONION_MCP_API_KEY=sk-...
python -m onion_mcp_server⚙️ 环境变量
变量 | 说明 | 默认值 |
| API Key(必填,AI 工具需要) | — |
| API Base URL |
|
| 模型名称 |
|
| 最大输出 Token |
|
兼容任何 OpenAI 格式接口:DeepSeek、通义千问、Moonshot、本地 Ollama 等
📦 依赖说明
依赖 | 用途 | 是否必须 |
| MCP 协议 | ✅ 必须 |
| AI 工具调用 LLM | AI 工具需要 |
| web 工具网络请求 | web 工具需要 |
| web 工具 HTML 解析 | web 工具需要 |
| YAML 格式支持 | data/text 工具可选 |
🔗 相关项目
onion-ai/onion — onion CLI 主项目
onion-ai/skill-hub — Skill 模板仓库
Available Tools
30 toolsai_chatA
与 AI 进行多轮对话。支持传入历史消息以保持上下文,支持自定义 system prompt。
Inputs: message (required), system, history, temperature.
ai_classifyA
对文本进行分类,支持情感分析、主题分类、意图识别,或自定义分类标签。
Inputs: text (required), task, labels, explain.
ai_extractA
从文本中提取结构化信息,支持:人名、地名、时间、关键词、数字、邮箱、URL、自定义字段。
Inputs: text (required), fields, output_format.
ai_rewriteB
改写文本,支持正式化、口语化、简洁化、扩写四种模式。
Inputs: text (required), mode, instruction.
ai_summarizeB
对长文本进行摘要,支持要点列表、段落摘要、一句话摘要三种模式。
Inputs: text (required), mode, max_points, language.
ai_translateA
将文本翻译为目标语言。自动检测源语言,支持中文、英文、日文、韩文、法文、德文、西班牙文等 40+ 语言。
Inputs: text (required), target_language, style.
code_convertC
将代码从一种编程语言转换为另一种语言。
Inputs: code (required), from_language (required), to_language (required).
code_docstringC
为函数、类或模块生成文档注释(docstring)。
Inputs: code (required), language, style.
code_explainB
解释代码的功能和逻辑,支持所有主流编程语言。
Inputs: code (required), language, detail.
code_fixC
修复代码中的错误,可提供错误信息以提高准确性。
Inputs: code (required), error_message, language.
code_generateB
根据自然语言描述生成代码。
Inputs: description (required), language, style.
code_reviewB
审查代码,找出 Bug、安全漏洞、性能问题和代码风格问题。
Inputs: code (required), language, focus.
data_convertB
在 JSON、CSV、YAML、TOML 格式之间互相转换。
Inputs: text (required), from_format (required), to_format (required).
data_csv_analyzeA
分析 CSV 数据,输出列信息、行数、数值列统计等摘要。
Inputs: csv_text (required), delimiter, max_rows.
data_json_queryA
用简单路径表达式查询 JSON 数据。 路径语法: 用 . 分隔键名,用 [N] 访问数组元素。 示例: 'users[0].name' 'data.items[*].id'
Inputs: json_text (required), path (required).
data_table_formatB
将 JSON 数组数据格式化为 Markdown 表格。
Inputs: data (required), headers, align.
sys_base64B
Base64 编码或解码文本。
Inputs: text (required), action, url_safe.
sys_hashB
计算字符串或文本的哈希值。
Inputs: text (required), algorithm, encoding.
sys_json_validA
验证 JSON 字符串是否合法,并返回格式化后的结果。
Inputs: text (required), pretty.
sys_timeA
获取当前日期和时间,支持指定时区。
Inputs: timezone, format.
sys_url_encodeA
URL 编码或解码文本。
Inputs: text (required), action, quote_plus.
sys_uuidC
生成 UUID。
Inputs: version, count, upper.
text_cleanB
清理文本:去除多余空行、首尾空白、重复行等。
Inputs: text (required), remove_blank_lines, remove_duplicates, strip_lines, +1 more.
text_countA
统计文本的字数、行数、字符数、段落数等信息。
Inputs: text (required).
text_diffA
对比两段文本的差异,输出 unified diff 格式。
Inputs: text_a (required), text_b (required), label_a, label_b, +1 more.
text_formatA
格式化文本内容,支持 JSON、YAML(需 pyyaml)、去除多余空白。
Inputs: text (required), format, indent.
text_templateC
简单模板渲染,将 {变量名} 替换为对应值。
Inputs: template (required), variables (required), strict.
web_extractC
从网页 URL 提取结构化信息:标题、描述、正文摘要、所有链接。
Inputs: url (required), extract_links, timeout.
web_fetchA
抓取指定 URL 的网页内容,返回纯文本(自动去除 HTML 标签)。
Inputs: url (required), max_len, timeout.
web_searchA
使用 DuckDuckGo 搜索,返回搜索结果列表(无需 API Key)。
Inputs: query (required), max_results, region.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 30 tools
Each tool targets a distinct operation within its category (AI, code, data, sys, text, web). There is no overlap; even similar verbs like 'extract' and 'fetch' are applied to different domains (web vs. text vs. AI).
All tool names follow a consistent prefix_category_action pattern with underscores (e.g., ai_chat, code_convert). No mixing of conventions or verb styles.
With 30 tools, the server is slightly above the typical well-scoped range, but each tool serves a clear purpose and the diversity of domains justifies the count. It remains manageable and not excessive.
The tool set covers a broad spectrum of common utilities: AI interactions, code manipulation, data format conversion, system helpers, text processing, and web access. No obvious missing operations for a general-purpose server.
Maintenance
Related MCP Connectors
AI tool directory MCP server, live since July 2026. Tools, agents, models, companies, services.
All 20 YourAITools agent APIs in one MCP server. Most tools free; pay with credits or x402.
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server that enables web searching, URL content extraction, and summarization without requiring API keys. It also provides advanced mathematical evaluation and multi-language Wikipedia summary retrieval tools.5685 npm10MIT
- AlicenseBqualityBmaintenanceA powerful MCP server with 116 practical tools across 9 categories including compression, web, file system, data processing, text, system, utilities, subagent AI, and browser automation.1004MIT
- AlicenseAqualityDmaintenanceA robust MCP server with tools to search, install, configure, repair, and uninstall MCP servers, automating setup and maintenance across multiple AI and developer tools.417MIT
- AlicenseNot gradedqualityFmaintenanceA comprehensive MCP server integrating OpenAI GPT models for AI-powered tasks like code analysis, generation, and translation, along with system utilities, Docker management, network diagnostics, and web tools.MIT