Skip to content

Install dicom-standard-kb

dicom-standard-kb needs Python 3.12 or newer. It is installed from its GitHub repository; it is not published on PyPI. The package holds code only, never DICOM content.

With uv:

Terminal window
uv tool install "dicom-standard-kb[mcp] @ git+https://github.com/beatrice-b-m/dicom-standard-kb"

The [mcp] extra adds the MCP server. Leave it out if you only want the CLI:

Terminal window
uv tool install "dicom-standard-kb @ git+https://github.com/beatrice-b-m/dicom-standard-kb"

Check the install:

Terminal window
dicom-kb --version
dicom-kb doctor

doctor prints the version and the project’s legal notice.

Use a checkout to develop the project or to build the synthetic fixture:

Terminal window
git clone https://github.com/beatrice-b-m/dicom-standard-kb.git
cd dicom-standard-kb
make install
uv run dicom-kb --help

make install installs the locked runtime, MCP and development dependencies. Prefix commands with uv run inside the checkout, or run uv tool install '.[mcp]' to put dicom-kb on your PATH.

A checkout can build a tiny knowledge base from synthetic DocBook files without downloading anything:

Terminal window
uv run dicom-kb build-fixture --cache-dir /tmp/dicom-kb-fixture --db /tmp/dicom-kb-fixture.sqlite --force
uv run dicom-kb iod "CT Image" --db /tmp/dicom-kb-fixture.sqlite

The fixture shows how commands and answers look. It is not DICOM content, and its 2026b edition label is only a label. build-fixture works only in a source checkout, because the fixtures are not packaged.

Path Contents
~/.cache/dicom-standard-kb/artifacts/ Downloaded DocBook XML and a manifest per edition
~/.cache/dicom-standard-kb/db/ One <edition>.sqlite per built edition
~/.cache/dicom-standard-kb/db/*.gaps.txt The gaps each build logged

Use --cache-dir, --db, environment variables or a profile to change them; see Configuration.

Run uv tool update-shell and open a new shell.

Query commands never create a database. Run dicom-kb fetch and then dicom-kb build, or pass --db to a database you already have.

The database came from an older version of the code. Rebuild it with dicom-kb build --force; the fetched files are reused.

Pass --force to download it again.

MCP support requires the optional dependency

Section titled “MCP support requires the optional dependency”

Reinstall with the [mcp] extra, adding --force to replace the existing tool.