Skip to main content
Glama
onion-mcp-server

onion-mcp-server

Official
by onion-ai

onion-mcp-server

A feature-rich MCP Server for onion-ai — 30 tools across 6 categories.

PyPI License: MIT

✨ 工具列表(30 个)

分组

工具

说明

🤖 AI

ai_chat

多轮对话,支持历史和 system prompt

🤖 AI

ai_translate

智能翻译,40+ 语言,自动检测源语言

🤖 AI

ai_summarize

长文摘要(要点/段落/一句话)

🤖 AI

ai_rewrite

文本改写(正式/口语/简洁/扩写)

🤖 AI

ai_extract

结构化信息提取(人名/地名/关键词等)

🤖 AI

ai_classify

文本分类(情感/主题/意图/自定义)

💻 Code

code_explain

解释代码逻辑

💻 Code

code_review

代码审查(Bug/安全/性能/风格)

💻 Code

code_generate

根据描述生成代码

💻 Code

code_convert

代码语言转换

💻 Code

code_fix

修复代码错误

💻 Code

code_docstring

生成文档注释

📝 Text

text_format

JSON/YAML/纯文本格式化

📝 Text

text_diff

文本差异对比(unified diff)

📝 Text

text_template

模板渲染({变量} 语法)

📝 Text

text_count

字数/行数/Token 统计

📝 Text

text_clean

清理文本(去空行/去重/标准化)

📊 Data

data_json_query

JSONPath 风格查询

📊 Data

data_csv_analyze

CSV 数据分析与统计

📊 Data

data_table_format

数据转 Markdown 表格

📊 Data

data_convert

JSON/CSV/YAML/TOML 互转

🌐 Web

web_fetch

抓取网页内容(返回纯文本)

🌐 Web

web_search

DuckDuckGo 搜索(无需 API Key)

🌐 Web

web_extract

提取网页结构化信息

⚙️ System

sys_time

获取当前时间(支持时区)

⚙️ System

sys_uuid

生成 UUID(v1/v4)

⚙️ System

sys_hash

计算 Hash(md5/sha256 等)

⚙️ System

sys_base64

Base64 编解码

⚙️ System

sys_url_encode

URL 编解码

⚙️ System

sys_json_valid

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

⚙️ 环境变量

变量

说明

默认值

ONION_MCP_API_KEY

API Key(必填,AI 工具需要)

—

ONION_MCP_BASE_URL

API Base URL

https://api.openai.com/v1

ONION_MCP_MODEL

模型名称

gpt-4o-mini

ONION_MCP_MAX_TOKENS

最大输出 Token

4096

兼容任何 OpenAI 格式接口:DeepSeek、通义千问、Moonshot、本地 Ollama 等

📦 依赖说明

依赖

用途

是否必须

mcp

MCP 协议

✅ 必须

openai

AI 工具调用 LLM

AI 工具需要

httpx

web 工具网络请求

web 工具需要

beautifulsoup4

web 工具 HTML 解析

web 工具需要

pyyaml

YAML 格式支持

data/text 工具可选

🔗 相关项目

Available Tools

30 tools
ai_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.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 30 tools

    Disambiguation5/5

    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).

    Naming Consistency5/5

    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.

    Tool Count4/5

    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.

    Completeness5/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An 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.
      5
      685 npm
      10
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      A 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.
      100
      4
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      A robust MCP server with tools to search, install, configure, repair, and uninstall MCP servers, automating setup and maintenance across multiple AI and developer tools.
      4
      17
      MIT
    • A
      license
      Not graded
      quality
      F
      maintenance
      A 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