divinatory
An MCP server providing AI agents with an entropy source modelled on
traditional divination.
Getting started
Set up a 3.12 or later Python environment, then:
pip install divinatory
Then, from the root of a project:
divinatory init
That registers the server with Claude Code and GitHub Copilot CLI
(.mcp.json), Codex (.codex/config.toml) and Cursor (.cursor/mcp.json),
using an absolute path into the environment it was installed in. Only the
server's own entry is written. Re-run it after moving or rebuilding the
environment; --dry-run shows what would change. divinatory uninit
takes the entries out again.
Tools
secure_seed: a fresh 128-bit seed, as hex.
secure_random: one-off integers, floats, choices from a list, or a deal
without repeats, from the operating system's secure source.
random: integers, floats or choices from a seed and offset, with
replacement. Repeatable, and continued across calls from the next_offset
each result gives.
deal: a deck (a list, or the integers low to high) shuffled by a seed
and dealt without repeats, continued the same way.
Documentation
All three are generated from the source and committed. After changing a
docstring, a tool or the command line, regenerate them; the tests fail until
they match:
pip install -e ".[docs]"
make -C docs documents
Development
conda env create -f environment.yml
conda activate divinatory
pip install -e ".[dev]"
pytest
ruff check . && ruff format --check .