内容

<p align="center">
<img src="https://github.com/user-attachments/assets/49f79b69-d9c0-4dca-b707-cb28c05289ae" alt="Centered Image" width="500">
</p>
<hr />
# SecureAnnex MCP Server
用于分析浏览器扩展安全性的模型上下文协议(Model Context Protocol, MCP)服务器。该服务器提供用于查询、分析和评估浏览器扩展安全方面的工具,包括漏洞检测、签名检查、代码审查等。
## 快速设置
无需手动设置Python环境。此 MCP 服务器旨在与 Claude Desktop 配合使用,后者使用 `uv` 包管理器和包含的 `pyproject.toml` 文件自动处理所有依赖项。
开始使用:
1. 下载或克隆此存储库
2. 确保 `pyproject.toml` 文件位于项目目录中
3. 如下所示配置 Claude Desktop
4. 可选:如果 Claude 找不到 `uv` 命令,请改用绝对路径。您可以通过在终端中运行 `which uv` 来找到绝对路径。
## Claude Desktop 配置
编辑 `~/Library/Application Support/Claude/claude_desktop_config.json`:
```json
{
"mcpServers": {
"secureannex": {
"command": "uv",
"args": [
"--directory",
"/path/to/secure-annex-mcp",
"run",
"secure_annex_mcp"
],
"env": {
"SECUREANNEX_API_KEY": "your_api_key_here"
}
}
}
}
```
**注意**:将 `/path/to/secure-annex-mcp` 替换为您的 SecureAnnex MCP 服务器目录的绝对路径。
## 项目结构
```
secure-annex-mcp/
├── pyproject.toml # 包配置
├── README.md # 项目文档
└── secure_annex_mcp/ # 主包
├── __init__.py # 包初始化
├── __main__.py # 作为模块运行时入口点
└── server.py # MCP 服务器实现
```
## 可用工具
### 扩展搜索和信息
- **search_extensions**:根据各种条件搜索浏览器扩展
- 参数:name, extension_id, owner, featured, active, page, page_size
- **get_extension_details**:获取有关特定扩展的详细信息
- 参数:extension_id (必需)
- **get_extension_versions**:获取特定扩展的版本历史记录
- 参数:extension_id (必需), version
### 安全分析
- **get_extension_vulnerabilities**:获取特定扩展的安全漏洞
- 参数:extension_id (必需), version
- **get_extension_signatures**:获取特定扩展的安全签名
- 参数:extension_id (必需), version, rule
- **get_extension_urls**:获取特定扩展使用的网络 URL
- 参数:extension_id (必需), version, domain
- **get_extension_manifest_risks**:获取特定扩展的清单权限风险
- 参数:extension_id (必需), version, risk_type
- **get_extension_analysis**:获取特定扩展的 AI 安全分析
- 参数:extension_id (必需)
- **get_extension_code_review**:获取特定扩展的代码安全审查
- 参数:extension_id (必需), version
### 用户反馈
- **get_extension_reviews**:获取特定扩展的用户评论
- 参数:extension_id (必需), rating
### 更新
- **get_recent_updates**:获取最近更新的扩展
- 参数:None
## 使用示例
以下是一些使用 Claude 工具的实际示例:
### 搜索扩展
```
# 获取由特定开发者开发的所有扩展
I need to find all extensions by help@getadblock.com
# Claude would use:
{
"name": "search_extensions",
"arguments": {
"owner": "help@getadblock.com"
}
}
```
### 安全分析
```
# 获取扩展的所有安全签名
Show me all security signatures for the AdBlock extension
# Claude would use:
{
"name": "get_extension_signatures",
"arguments": {
"extension_id": "gighmmpiobklfepjocnamgkkbiglidom"
}
}
# 从扩展中提取所有网络域
Extract all domains embedded in the AdBlock extension
# Claude would use:
{
"name": "get_extension_urls",
"arguments": {
"extension_id": "gighmmpiobklfepjocnamgkkbiglidom"
}
}
# 分析清单权限
Show me a table of all permissions requested by AdBlock with explanations
# Claude would use:
{
"name": "get_extension_manifest_risks",
"arguments": {
"extension_id": "gighmmpiobklfepjocnamgkkbiglidom"
}
}
```
### 与其他 MCP 集成
```
# 利用 VirusTotal MCP 获取域信誉
Can you extract all domains from the AdBlock extension and check their reputation on VirusTotal?
# Claude would use both SecureAnnex and VirusTotal MCPs:
# 1. First, get domains from SecureAnnex
{
"name": "get_extension_urls",
"arguments": {
"extension_id": "gighmmpiobklfepjocnamgkkbiglidom"
}
}
# 2. Then for each domain, check VirusTotal
{
"name": "domain_report", // VirusTotal MCP tool
"arguments": {
"domain": "example.com" // For each domain found
}
}
# 3. Claude would compile results into a table:
| Domain | Reputation | Detection Ratio | Categories |
|--------|------------|-----------------|------------|
| domain1.com | Clean | 0/85 | Advertising |
| domain2.com | Suspicious | 3/85 | Marketing |
```
### 综合分析
```
# 请求对扩展进行完整的安全审查
Perform a full security audit of the AdBlock extension
# Claude would combine multiple tools:
{
"name": "get_extension_details",
"arguments": {
"extension_id": "gighmmpiobklfepjocnamgkkbiglidom"
}
}
{
"name": "get_extension_vulnerabilities",
"arguments": {
"extension_id": "gighmmpiobklfepjocnamgkkbiglidom"
}
}
{
"name": "get_extension_analysis",
"arguments": {
"extension_id": "gighmmpiobklfepjocnamgkkbiglidom"
}
}
```
## API 密钥
SecureAnnex MCP 服务器需要 API 密钥才能通过 SecureAnnex API 进行身份验证。从 SecureAnnex 服务获取您的 API 密钥,并将其包含在如上所示的 Claude Desktop 配置中。
## 故障排除
如果您遇到任何问题:
1. 确保您的 API 密钥已在环境变量中正确设置
2. 验证 Claude Desktop 配置中的路径是否正确