🛠️ onlinecybertools-mcp-server
MCP(Model Context Protocol)服务器,让 AI agents——Claude Code、Codex、Cursor、Continue 等——将 Online Cyber Tools 目录作为一组原生 MCP 工具使用。
🧩 功能暴露
- 每个文档化的 MCP 兼容
/api/tools/{category}/{tool} 操作对应一个 MCP 工具。POST 工具使用其 JSON 请求体 schema;兼容的 GET 工具使用 OpenAPI 查询/路径参数。Schema 直接取自站点位于 /api/openapi.json 的 OpenAPI 3.1 规范,因此 agents 可获得每个工具的参数校验。当规范声明它们时,工具还会携带 MCP annotations(title 以及 readOnlyHint / destructiveHint / idempotentHint,来源于 x-mcp-annotations)和一个 outputSchema(内联的 200 响应对象 schema)。
search 元工具:执行与人类使用的相同关键词搜索,由 GET /api/tools/search?q=... 支持。
describe_tool 元工具:从 GET /api/mcp/tool-docs/{tool_id} 获取长页面指南、源链接、页面 URL、API 端点和 SEO 描述。它接受菜单 ID(如 ping)或 MCP 工具名(如 network_ping)。
report_bug 元工具:向 POST /api/agent/bug-report 提交结构化 bug 报告(严格限流)。
调用会代理到实时 HTTP API——此处不重新实现任何算法。这确保 agents 看到已部署站点的实际行为。生成的工具描述就是该操作的 OpenAPI summary + description,不含其他内容——没有 menu-ID 前缀或 describe_tool 指针(两者对调用方 agent 来说都是噪音)。describe_tool 元工具仍可供需要按需获取完整页面指南的 agents 使用。
🧰 工具列表
本服务器在 15 个分类中提供 279 个工具:
编码/解码、二进制/文本转换、密码学与哈希、Web 开发实用工具、文本工具、OSINT 工具、网络工具、安全工具、SEO 工具、Linux 工具、日期与时间、数学与计算器、数据工具、文件工具、逆向工程。
本节与 TOOLS.md 会在每次发布时从在线菜单自动生成,因此数量与列表不会漂移。
🚀 快速开始
该包已发布到 npm,名称为 onlinecybertools-mcp-server,因此任何 MCP 客户端都可以通过 npx -y onlinecybertools-mcp-server 启动它——无需克隆,也无需全局安装。下方配置片段可直接使用,默认暴露完整工具目录。
更喜欢引导式设置?可通过网站的交互式构建器生成现成的 Claude Code 插件或 Codex 配置块:
https://onlinecybertools.com/integrations/mcp-plugin-builder
构建器允许你选择工具子集,并为你生成匹配的 OCTOOLS_TOOLS 过滤器(见配置)。
⚙️ 配置
通过环境变量配置。所有变量均为可选。
| 变量 |
默认值 |
用途 |
OCTOOLS_BASE_URL |
https://onlinecybertools.com |
代理请求的目标站点。 |
OCTOOLS_TOOLS |
(未设置 → 所有工具) |
逗号分隔的菜单 ID(base64_encode,sha256,hash),用于限制暴露的工具范围。保持未设置以暴露所有工具——下方示例有意省略它。 |
OCTOOLS_STREAM_BYTE_CAP |
262144(256 KiB) |
从流式(x-mcp-compatible: stream-buffered)端点累积的最大字节数。 |
OCTOOLS_STREAM_TIME_CAP_MS |
30000(30 s) |
用于缓冲流式端点的最大墙钟时间。 |
设置 OCTOOLS_TOOLS 后,服务器会在获取规范时追加 ?tools=...,以便站点返回预过滤的规范;客户端也会执行该过滤,作为纵深防御。
🏃 运行
🔍 Inspector(手动冒烟测试)
npx @modelcontextprotocol/inspector npx -y onlinecybertools-mcp-server
打开 inspector URL,点击 List Tools——你应该会看到 search、describe_tool、report_bug,以及每个兼容 Symfony API 操作对应的一个条目。未设置 OCTOOLS_TOOLS 时,会列出完整目录。
如果想改为在本地开发服务器,可克隆并从源码运行:
git clone https://github.com/Jambozx/onlinecybertools-mcp-server.git
cd onlinecybertools-mcp-server
npm install
npx @modelcontextprotocol/inspector node index.mjs
🧩 Claude Code
添加到 ~/.claude.json(或项目的 .mcp.json):
{
"mcpServers": {
"octools": {
"command": "npx",
"args": ["-y", "onlinecybertools-mcp-server"]
}
}
}
这会暴露所有工具。要限制范围,请添加包含 OCTOOLS_TOOLS 的 env 块:
{
"mcpServers": {
"octools": {
"command": "npx",
"args": ["-y", "onlinecybertools-mcp-server"],
"env": {
"OCTOOLS_TOOLS": "base64_encode,sha256,hash"
}
}
}
}
🧩 Codex
添加到 ~/.codex/config.toml:
[mcp_servers.octools]
command = "npx"
args = ["-y", "onlinecybertools-mcp-server"]
要限制范围,请添加包含 OCTOOLS_TOOLS 的 env 行:
[mcp_servers.octools]
command = "npx"
args = ["-y", "onlinecybertools-mcp-server"]
env = { OCTOOLS_TOOLS = "base64_encode,sha256,hash" }
🧩 Cursor / Continue / 通用 MCP 客户端
大多数客户端接受相同的 command/args/env 结构。通过 npx -y onlinecybertools-mcp-server 将它们指向此包。
🌊 流式端点
规范中标记为 x-mcp-compatible: stream-buffered 的端点(目前是 traceroute 和 proxy-test 流)会被读取至完成,并作为累积 SSE 事件的单个 JSON 信封返回。GET 流端点将工具参数作为查询参数发送;POST 流发送 JSON 请求体。硬性上限:
- 256 KiB 缓冲输出(
OCTOOLS_STREAM_BYTE_CAP)
- 30 秒墙钟时间(
OCTOOLS_STREAM_TIME_CAP_MS)
无论哪个上限先触发,响应信封都会包含 { "truncated": true },以便 agent 知道输出是部分的。
标记为 x-mcp-compatible: none 的端点(多部分文件上传等)会在注册时跳过——它们不会出现在 tools/list 中。
⚠️ 限制
- 规范仅在启动时获取一次。如果站点添加新端点,请重启服务器。
- 仅支持 stdio 传输;没有 HTTP 服务器(避免在特权端点前需要认证)。
- 已发布到 npm,名称为
onlinecybertools-mcp-server(npx -y onlinecybertools-mcp-server)。直接从 GitHub 安装(npx -y github:Jambozx/onlinecybertools-mcp-server)仍可用于获取最新前沿版本。
📄 许可证
MIT。