npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tavimercy-mcp

v1.0.1

Published

DICOM 文件解析和分析工具 - MCP 服务器

Downloads

14

Readme

DICOM 工具 MCP 服务器

一个基于 MCP (Model Context Protocol) 的 DICOM 医学影像文件分析工具。

功能特性

  • 🏥 扫描目录识别所有标准 DICOM 文件
  • 📊 统计患者数量、检查数量、序列数量
  • 🔍 解析单个 DICOM 文件提取关键信息
  • 📁 自动递归遍历子目录

安装

方式 1:通过 npx 使用(推荐)

无需安装,直接使用:

npx tavimercy-mcp

方式 2:全局安装

npm install -g tavimercy-mcp

方式 3:本地开发

git clone <repository-url>
cd @tavimercy:mcp
npm install
npm run build

配置

在 MCP 客户端配置文件(如 Claude Desktop 的 claude_desktop_config.json)中添加:

使用 npx(推荐)

{
    "mcpServers": {
        "dicom-tools": {
            "command": "npx",
            "args": [
                "-y",
                "tavimercy-mcp"
            ]
        }
    }
}

使用全局安装

{
    "mcpServers": {
        "dicom-tools": {
            "command": "dicom-tools"
        }
    }
}

使用本地开发版本

{
    "mcpServers": {
        "dicom-tools": {
            "command": "node",
            "args": [
                "/path/to/@tavimercy:mcp/build/index.js"
            ]
        }
    }
}

配置文件位置:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

可用工具

scan-dicom-directory

扫描指定目录下的所有 DICOM 文件,统计患者数量、检查数量、序列数量,并返回详细的结构化信息

参数:

  • directoryPath: 要扫描的目录路径,支持绝对路径或相对路径

功能说明:

  • 递归遍历目录下所有文件
  • 自动识别标准 DICOM 文件(前 128 字节后包含 'DICM' 标识)
  • 提取每个文件的 PatientID、StudyInstanceUID、SeriesInstanceUID
  • 按患者→检查→序列的层级结构组织数据
  • 统计总文件数、患者数、检查数、序列数

输出示例:

=== DICOM 文件统计 ===

总文件数: 150
患者数量: 3
检查数量: 5
序列数量: 10

患者ID: P001
  检查数量: 2
  └─ 检查UID: 1.2.840.113619.2.xxx
     序列数量: 3
     └─ 序列UID: 1.2.840.113619.2.xxx.1
        文件数量: 25

parse-dicom-file

解析单个 DICOM 文件,提取 PatientID、StudyInstanceUID、SeriesInstanceUID 等关键信息

参数:

  • filePath: DICOM 文件的路径,支持绝对路径或相对路径

输出示例:

DICOM 文件信息:
文件路径: /path/to/file.dcm
患者ID: P001
检查实例UID: 1.2.840.113619.2.xxx
序列实例UID: 1.2.840.113619.2.xxx.1

项目结构

src/
├── index.ts              # 服务器入口
├── dicomService.ts       # DICOM 文件解析服务
└── tools/
    └── dicomTools.ts     # DICOM 工具注册

DICOM 标准说明

DICOM (Digital Imaging and Communications in Medicine) 是医学影像的国际标准格式。

标准 DICOM 文件结构:

  • 前 128 字节:文件前导码(File Preamble)
  • 第 129-132 字节:固定字符串 "DICM"(DICOM 前缀)
  • 之后:DICOM 数据元素

关键 DICOM 标签:

  • (0010,0020) - Patient ID:患者唯一标识符
  • (0020,000D) - Study Instance UID:检查实例唯一标识符
  • (0020,000E) - Series Instance UID:序列实例唯一标识符

使用示例

扫描 DICOM 目录

// 在 MCP 客户端中调用
{
  "tool": "scan-dicom-directory",
  "arguments": {
    "directoryPath": "/path/to/dicom/files"
  }
}

解析单个 DICOM 文件

{
  "tool": "parse-dicom-file",
  "arguments": {
    "filePath": "/path/to/dicom/file.dcm"
  }
}

依赖项

  • @modelcontextprotocol/sdk: MCP 协议 SDK
  • zod: 参数验证
  • dicom-parser: DICOM 文件解析库