Skip to main content

OSIM MCP Server

Python FastMCP

基于 FastMCP 的 Model Context Protocol (MCP) 服务器,提供 OSIM (Open Security Information Model) 数据标准 schema 的查询和访问能力。

🚀 快速开始

使用 uvx(推荐,无需安装)

包已发布到 PyPI,可以直接使用 uvx 运行:

uvx osim-mcp-server

在 MCP 客户端中配置

Claude Desktop

在配置文件(~/Library/Application Support/Claude/claude_desktop_config.json)中添加:

{
  "mcpServers": {
    "osim-mcp-server": {
      "command": "uvx",
      "args": ["osim-mcp-server"]
    }
  }
}

Cursor

在 MCP 设置中添加:

{
  "mcpServers": {
    "osim-mcp-server": {
      "command": "uvx",
      "args": ["osim-mcp-server"]
    }
  }
}

从源码运行

# 克隆仓库
git clone https://github.com/osim-group/osim-mcp-server.git
cd osim-mcp-server

# 首先获取 osim-schema(必需)
# 确保已安装 git
python update_schemas.py

# 安装依赖并运行
uv sync
uv run python server.py

重要:仓库本身不包含 osim-schema 目录,需要先运行 update_schemas.py 获取 osim-schema 仓库内容才能正常运行。

更新 OSIM Schema

项目中的 osim-schema 内容来源于 OSIM Schema 仓库。如果需要获取或更新最新的内容,可以使用项目提供的更新脚本:

# 确保已安装 git
python update_schemas.py

脚本会自动:

  • 从 GitHub 仓库克隆整个 osim-schema 仓库(包括 schemas、faqs、examples 等)
  • 备份现有的 osim-schema 目录(如果存在)
  • 更新本地 osim-schema 目录
  • 验证更新结果

注意:更新脚本需要系统已安装 git 命令。

📚 功能特性

MCP 工具

  1. list_schema_names - 列出所有可用的数据标准 schema 名称

    • 参数:无
    • 返回:List[str] - schema 名称列表,格式为 {group}.{category}.{title}
    • 示例:["log.network_session_audit.http_audit", "alert.network_attack.apt_attack"]
    • 说明:为了避免上下文过长,此工具只返回名称,不包含描述信息
  2. describe_schemas - 获取指定 schema 的描述信息

    • 参数:schema_names (List[str]) - schema 名称列表
    • 返回:Dict[str, str] - 字典,键为 schema 名称,值为描述信息
    • 说明:方便理解应该使用哪个 schema
  3. get_schema - 获取指定 schema 的完整字段定义

    • 参数:schema_path (str) - schema 路径,格式为 {group}.{category}.{title}
    • 返回:Dict[str, Any] - 字段定义字典,包含字段名、标签、类型、要求、描述等信息
    • 说明:可以从 list_schema_names 中获取所有可用的 schema 名称
  4. get_schema_version - 获取当前 schemas 的版本信息

    • 参数:无
    • 返回:Dict[str, Any] - 包含以下字段:
      • version (str) - 本地版本号
      • auto_update_enabled (bool) - 是否启用自动更新
      • update_timeout (float) - 更新检查超时时间(秒)
  5. get_dictionaries - 获取 dictionaries.json 文件内容

    • 参数:无
    • 返回:Dict[str, Any] - OSIM 数据标准中定义的字典项
    • 说明:包含字段名、标签、描述、类型等信息,这些字典项定义了数据标准中使用的通用字段定义

MCP 资源

通过资源 URI 访问 schema 文件内容:

  • URI 格式:data-standard://{group}/{category}/{title}
  • 示例:
    • data-standard://log/network_session_audit/http_audit
    • data-standard://alert/network_attack/apt_attack
    • data-standard://asset/business_asset/web_application

📊 数据标准分类

项目提供完整的 OSIM 数据标准支持,包括:

  • 告警 (Alert):异常行为、数据安全、恶意软件、网络攻击等
  • 资产 (Asset):业务资产、云资产、数据资产、网络资产等
  • 日志 (Log):账户操作审计、数据安全审计、主机行为审计、网络会话审计等
  • 事件 (Incident):安全事件记录和分类
  • 设备检测 (Device Detection):EDR、防火墙、WAF、IDS/IPS 等各类安全设备

数据来源:所有 schema 文件均来源于 OSIM Schema 仓库

🛠️ 开发

获取/更新 OSIM Schema

项目提供了脚本用于从 GitHub 仓库同步整个 osim-schema 仓库:

python update_schemas.py

注意:构建分发包前需要先获取 osim-schema,因为分发包需要包含 osim-schema 目录。

构建分发包

# 确保已获取 osim-schema
python update_schemas.py

# 构建分发包
uv build

发布到 PyPI

# 安装 twine
uv pip install twine

# 上传到 PyPI
uv run twine upload dist/*

发布后即可通过 uvx osim-mcp-server 使用。

📝 许可证

Apache License 2.0

🙏 致谢

Metadata

Release files for osim-mcp-server 1.0.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for osim-mcp-server 1.0.7
File Size Uploaded Provenance Actions
osim_mcp_server-1.0.7.tar.gz 1.6 MB Without provenance Details for osim_mcp_server-1.0.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for osim-mcp-server 1.0.7
File Interpreter ABI Platform Actions
osim_mcp_server-1.0.7-py3-none-any.whl Python 3 none any Details for osim_mcp_server-1.0.7-py3-none-any.whl

Total release size: 3.4 MB

Release files / osim_mcp_server-1.0.7.tar.gz

Download URL osim_mcp_server-1.0.7.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
785db79ac5ff0c92fa1a84878753d5319a4b074a3d1b744bcee8dd4803afced1
BLAKE2b-256 checksum
How to use checksums
846def0bac3e9f93193eb652c75faabfe490775a4866aa380c0f267f589187c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.6

Release files / osim_mcp_server-1.0.7-py3-none-any.whl

Download URL osim_mcp_server-1.0.7-py3-none-any.whl
Size 1.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
0f2364898419afe2fdadeeb69728b34b541e8942b2513d0b2e5637e941dec0ef
BLAKE2b-256 checksum
How to use checksums
33b19c8e7364ab3bf041d1083a6eb612826c8c5d2872243675e7a8862da45620
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.6

Security for osim-mcp-server 1.0.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page