Skip to main content
Glama
mcp-divination

mcp-divination

by ZandevOxford

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.

Related MCP server: D20DAO MCP server

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 .

Available Tools

4 tools
dealA
Read-onlyIdempotent

Deal from a deck without repeats: the deck is items, or the integers low to high, shuffled by the seed. Continue from next_offset, passing the same deck each call. Each seed deals the deck once; past the end, take a new seed.

Inputs: seed (required), low, high, count, +2 more. Returns: seed, size, offset, values, +3 more

randomA
Read-onlyIdempotent

Values from the seeded random stream, with replacement: integers, floats or choices from a list. The value at each position depends only on the seed, the position and the arguments, so a stream continues across calls from next_offset.

Inputs: kind (required), seed (required), low, high, +4 more. Returns: seed, offset, values, algorithm, +1 more

secure_randomA
Read-only

One-off values from the operating system's secure source: integers, floats, choices from a list, or a deal without repeats. Not repeatable; use random or deal with a seed for results that can be reproduced.

Inputs: kind (required), low, high, count, +2 more. Returns: values

secure_seedA
Read-only

A new seed from the secure source, to pass to random and deal. Take a new one whenever a fresh, unpredictable stream or deck is wanted.

Inputs: no named parameters. Returns: seed

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 4 tools

    Disambiguation4/5

    The four tools have mostly distinct roles: seed generation, OS-secure randomness, seeded repeatable streams, and seeded no-repeat deals. The main overlap is that secure_random can also produce a no-repeat 'deal' and one-off values similar to random, so an agent may occasionally hesitate between secure_random and random/deal. The descriptions explicitly cross-reference each other, which helps resolve most confusion.

    Naming Consistency3/5

    Names are all lowercase and readable, but the convention is mixed: secure_seed and secure_random use a secure_ prefix, while random (which is seeded) and deal do not follow a parallel pattern. A cleaner scheme might be generate_seed / secure_random / seeded_random / seeded_deal, but the current set is still interpretable.

    Tool Count4/5

    Four tools is a tight, well-scoped surface for a randomness/divination server. Each tool covers a distinct mode of operation and none feels redundant. It is slightly thin, but appropriate for the narrow purpose.

    Completeness4/5

    The surface covers seed generation, secure one-off randomness, seeded streams, and seeded deals without repeats, which is a coherent lifecycle for the domain. Minor gaps exist, such as no explicit state introspection or reset, but these are workable by taking a new seed.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Provides true random generation tools for AI agents, including coin flip, dice roller, random numbers, and wheel of fortune, enabling decisions and TTRPG sessions.
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLMs like Claude to generate genuine random numbers instead of inventing them, covering dice rolls, coin flips, number draws, random selection from lists, and shuffling. It runs as a free-tier Cloudflare Worker using a cryptographically secure generator, and also exposes a REST API, a demo page, and progress-reporting tools for long-running calls.
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables LLMs and MCP clients to generate cryptographically secure random integers, floats, coins, picks, samples, shuffles, weighted choices, dice rolls, and UUIDs. Supports optional seeding for reproducible results and signed receipts for verification.
      MIT