Om Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Om Mcp (MCP Server) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
<div align="center">
开源社区数据查询 MCP 服务器
为 Claude Desktop 提供开源社区数据查询能力的 Model Context Protocol 服务器
</div>
👤 我是用户
🛠️ 我是开发者
om-metrics MCP Server 是一款面向开源社区运营团队和数据分析人员的 MCP 工具,通过 Claude Desktop 提供自然语言查询开源社区数据的能力。
| 角色 | 使用场景 |
|---|---|
| 社区运营 | 查询社区健康度、PR/Issue 统计、贡献者排行 |
| 数据分析师 | 获取社区趋势数据、生成运营报告、制作 PPT |
| 开发者 | 查询 CI/CD 指标、仓库活跃度、技术栈分布 |
| 管理者 | 跨社区对比分析、企业贡献统计、CLA 签署情况 |
支持 23 个开源社区,包括:
适合新用户快速安装和配置。开发者详细指南见开发指南。
https://datastat.osinfra.cn/server/)1. 克隆项目
git clone https://github.com/zhongjun2/om-mcp.git
cd om-mcp2. 安装依赖
pip install -e .3. 验证安装
python3 -c "from server import mcp; print('安装成功')"4. 配置 Claude Desktop
在 Claude Desktop 中,项目根目录已包含 .mcp.json 配置文件,会自动识别。
或手动配置全局 MCP 服务器(编辑 ~/.config/Claude/claude_desktop_config.json):
{
"mcpServers": {
"om-metrics": {
"command": "python3",
"args": ["-m", "om-mcp"],
"cwd": "/完整路径/om-mcp"
}
}
}5. 验证连接
在 Claude Desktop 中运行:
/mcp应该看到:
❯ om-metrics · ✔ connected在 Claude Desktop 或 Claude Code 中直接用自然语言提问,MCP 工具会自动调用。
查询 openEuler 社区的健康度评分
openEuler 社区 2025 年的 PR 总数
CANN 社区有多少个参与的企业?
查询 MindSpore 社区最近的热点仓库openEuler 2025 年每月的 PR 合并趋势
MindSpore 社区 2025 年 1-3 月的 Issue 关闭率
openUBMC 社区 2025 年的 CLA 签署趋势哪些企业对 openEuler 贡献最多?
openEuler 的 Top 10 个人贡献者
CANN 社区最活跃的开发者名单openEuler 和 CANN 社区的 PR 合并率对比
MindSpore 和 openGauss 的 Issue 关闭率对比
各社区的企业参与数量对比更多使用示例请参考 FEATURES.md。
详细的开发者安装指南请参考 INSTALL.md。
项目需要设置 MAGIC_API_TOKEN 环境变量才能正常工作。
设置方式(推荐)
方式 1:临时设置(当前会话有效)
export MAGIC_API_TOKEN=your_token_here方式 2:永久设置(写入 Shell 配置)
在 ~/.bashrc 或 ~/.zshrc 中添加:
export MAGIC_API_TOKEN=your_token_here然后运行:
source ~/.bashrc # 或 source ~/.zshrc验证配置
echo $MAGIC_API_TOKEN # 应显示你的 token 值安全提示:
.env 添加到 .gitignoreom-mcp/
├── server.py # MCP 服务器入口
├── lib/
│ ├── http.py # HTTP 请求封装
│ ├── apidocs_loader.py # API 文档加载器(从 .ms 文件解析)
│ ├── template_loader.py # 工具模板加载器(YAML 配置)
│ ├── tool_generator.py # 动态工具生成器
│ └── response_formatter.py # 响应格式化
├── tools/
│ ├── health.py # 社区健康度查询
│ ├── common.py # 通用工具(社区列表)
│ ├── server_apis.py # 服务端 API(社区列表、指标字典、热点仓库等)
│ ├── query_apis.py # 查询 API(PR/Issue 聚合、按 SIG 统计等)
│ ├── cla_apis.py # CLA 相关 API
│ ├── project_apis.py # 项目 CI 指标
│ └── general_apis.py # 通用查询 API
├── api-docs/ # API 文档目录(自动生成工具)
│ ├── datastat/ # datastat 模块 API
│ └── 社区运营质量/ # 社区运营质量模块 API
└── test/ # 测试目录
├── test_mcp.py # 测试脚本
└── README.md # 测试说明项目支持从 API 文档自动生成 MCP 工具,无需手动编写工具函数。
#### 工作原理
lib/apidocs_loader.py)api-docs/ 目录加载 .ms 格式的 API 文档ToolTemplate 数据结构lib/tool_generator.py)ToolTemplate 动态生成异步工具函数/{contributeType}/detail 中的 contributeType 会被识别为路径参数{xxx} 会被替换为 xxx,避免生成多个工具#### 添加新 API 工具
只需在 api-docs/ 目录下添加 .ms 文档文件,重启服务即可自动注册。
对于复杂的业务逻辑,仍可手动编写工具函数:
tools/ 目录下创建新的 Python 文件register(mcp: FastMCP) 函数@mcp.tool() 装饰器注册工具server.py 中导入并注册示例:
from mcp.server.fastmcp import FastMCP
from lib.http import get, post, extract_data
def register(mcp: FastMCP):
@mcp.tool()
async def my_new_tool(param: str) -> str:
"""工具描述"""
result = await get("/api/endpoint")
return f"结果: {result}"运行测试脚本验证所有功能:
cd test
python3 test_mcp.py测试脚本会模拟真实使用场景,调用所有 MCP 工具并验证返回结果。详见 test/README.md。
python3 --version(需要 3.8+)pip list | grep mcpcurl https://datastat.osinfra.cn/server/list_communities 工具查看支持的社区)cd test && python3 test_mcp.py| 错误信息 | 原因 | 解决方案 |
|---|---|---|
ModuleNotFoundError: No module named 'mcp' | MCP SDK 未安装 | 运行 pip install "mcp[cli]" |
Connection refused | 无法访问远程 API | 检查网络连接和防火墙设置 |
Community not found | 社区名称错误 | 使用 list_communities 查看支持的社区 |
| 文档 | 说明 |
|---|---|
| FEATURES.md | 完整功能列表和使用示例 |
| INSTALL.md | 详细安装指南(含虚拟环境配置) |
| test/README.md | 测试说明和故障排查 |
本 MCP 服务器调用远程 API 服务:
https://datastat.osinfra.cn/server/lib/http.py 中的 API_BASE_URL 变量欢迎提交 Issue 和 Pull Request!
贡献前请:
git checkout -b feature/your-featuregit commit -m 'Add some feature'git push origin feature/your-feature<div align="center">
om-metrics MCP Server — 让开源社区数据查询更简单 📊
Made with ❤️ for Open Source Communities
</div>
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.