AntSwordMCP
Exposes AntSword (蚁剑) shell management capabilities as an MCP server via SSE, enabling AI clients to execute commands, manage files, databases, and shells.
README
AntSword MCP
English | 中文
将蚁剑(AntSword)的能力以 MCP 服务器 形式暴露,让任意 MCP 客户端(Claude Desktop / Cursor / Trae / Cline 等)通过一条 SSE URL 即可调用蚁剑的全部 Shell 操作能力。
- 零外部依赖:仅用 Node 内置模块 + 蚁剑已有的
antSword.core - 协议合规:实现 MCP 2024-11 SSE 规范
- 非破坏性:纯插件形态,不修改蚁剑核心源码
- 安全:仅监听
127.0.0.1+ Host/Origin 头校验
安装
- 关闭蚁剑
- 将本目录拷贝到蚁剑插件目录:
<蚁剑工作目录>/antData/plugins/AntSwordMCP/ - 启动蚁剑
激活服务
方式 A:手动激活(默认)
右键 Shell 列表中任意 Shell → 选择 AntSword MCP 服务器,服务即在 http://127.0.0.1:30080/sse 监听。每次重启蚁剑后需再次激活。
方式 B:自启动(可选)
在蚁剑源码 source/app.entry.js 末尾追加:
try {
const mcpPlugPath = path.join(remote.process.env.AS_WORKDIR, 'antData/plugins/AntSwordMCP');
if (fs.existsSync(path.join(mcpPlugPath, 'package.json'))) {
require(path.join(mcpPlugPath, 'index.js'));
}
} catch (e) { console.error('[AntSwordMCP] autoload failed:', e); }
客户端配置
{
"mcpServers": {
"antsword": {
"url": "http://127.0.0.1:30080/sse"
}
}
}
支持 Claude Desktop / Cursor / Trae 等所有 MCP 客户端。端口被占用时自动重试(最多 10 次)。
工具列表
共 37 个工具,分为七大类。shell_id 由 shell_list 返回的 _id 获取。
| 类别 | 工具 |
|---|---|
| Shell 管理 (6) | shell_list shell_get shell_add shell_edit shell_del shell_capabilities |
| 基础信息 (2) | base_info base_probedb |
| 命令执行 (3) | cmd_exec cmd_list cmd_quote |
| 文件管理 (13) | file_dir file_read file_write file_delete file_copy file_rename file_retime file_chmod file_mkdir file_wget file_hash file_upload file_download |
| 数据库 (8) | db_list_confs db_get_conf db_add_conf db_del_conf db_show_databases db_show_tables db_show_columns db_query |
| 通用接口 (1) | raw_request |
| 系统管理 (4) | mcp_status mcp_logs mcp_config_get mcp_config_set |
各工具的详细参数与说明已内置于工具描述中,AI 通过
tools/list即可获取,无需查阅文档。
典型调用流程
shell_list → shell_capabilities → base_info → cmd_exec / file_dir / db_query
已知限制
中文多段路径下 filemanager 操作失效
当路径同时含中文目录段 + 中文文件名时,file_write 新建、file_copy、file_delete、file_dir 元数据可能失效。单段中文不受影响。
绕过方案:改用 cmd_exec 执行系统命令(rd /s /q、copy、rm -rf 等),命令解释器不受此限制。
蚁剑重启后需重新激活
蚁剑重启会销毁 MCP 服务,需右键 Shell 重新激活(或使用自启动方式 B)。
配置
默认配置见 config.default.json(host=127.0.0.1, port=30080)。可在蚁剑控制台执行 antSword.storage('mcp-config-path', '/path/to/config.json') 指定自定义配置。
License
Disclaimer
本工具仅供授权安全测试使用。使用前须获得目标系统的书面授权,使用者自行承担因不当使用造成的一切法律责任。
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.