Skip to main content

madcat-os (binary: madcat)

MADCAT MCP server and command line in Python. The installed binary is madcat; one package, three faces:

  • madcat mcp serve — MCP over stdio (default) or Streamable HTTP at /mcp
  • madcat mcp list / mcp call <tool> '<json>' — drive the tool registry from the shell
  • madcat status — effective config and tool count
  • madcat claude hooks pre-tool inject_session_id / session-start welcome — Claude Code hooks

Functionality is being moved here from the Rust madcat binary; command shapes match it.

Quick start

uv sync
uv run madcat status
uv run madcat mcp list
uv run madcat mcp call server_info
uv run madcat mcp serve --transport http --token t --bind 127.0.0.1:4197

Then POST an initialize to http://127.0.0.1:4197/mcp with Authorization: Bearer t and Accept: application/json, text/event-stream; reuse the returned mcp-session-id.

Claude Code

stdio:

{ "mcpServers": { "madcat": { "command": "uv", "args": ["run", "--directory", "/path/to/madcat-os", "madcat", "mcp", "serve"] } } }

http:

{ "mcpServers": { "madcat": { "type": "http", "url": "http://127.0.0.1:4097/mcp",
  "headers": { "Authorization": "Bearer ${MADCAT_MCP_TOKEN}" } } } }

Hooks, in ~/.claude/settings.json (event JSON on stdin, hook output on stdout, always exit 0):

"hooks": {
  "PreToolUse": [ { "matcher": "", "hooks": [
    { "type": "command", "command": "madcat claude hooks pre-tool inject_session_id", "timeout": 5 } ] } ],
  "SessionStart": [ { "hooks": [
    { "type": "command", "command": "madcat claude hooks session-start welcome", "timeout": 5 } ] } ] }

inject_session_id records the session in ~/.claude/current-session-id and current-session.json (MADCAT_CLAUDE_STATE_DIR, [claude].state_dir) and adds session_id to madcat tool calls (--server / MADCAT_CLAUDE_MCP_SERVER when the tool name does not identify madcat). welcome prints the boot prompt for the active persona cart (~/.local/share/madcat/tts-state.toml → ~/.config/madcat/carts/<tag>.toml); MADCAT_CLAUDE_WELCOME, [claude].welcome or $CLAUDE_PLUGIN_DATA/welcome.md replaces it.

Configuration

Environment, prefix MADCAT_MCP_ (or a .env file): HOST (127.0.0.1), PORT (4097), TOKEN, LOG_LEVEL. --bind and --token on mcp serve override.

Adding a tool

Create src/madcat_os/tools/<module>.py with register(mcp: MCPServer) and @mcp.tool() handlers (docstring per tool, type hints per argument), then add <module>.register to MODULES in src/madcat_os/tools/__init__.py. Human output goes to stderr; stdout is the stdio wire.

Layout

src/madcat_os/
  cli.py        Typer app: status, mcp list|call|serve
  server.py     build_server(), HTTP app with bearer auth + /health, stdio/http runners
  config.py     Settings (pydantic-settings); hook/cart getters over ~/.config/madcat/config.toml
  claude_hooks.py  Claude Code PreToolUse / SessionStart handlers
  cart.py       persona carts: tts-state.toml and carts/*.toml
  tools/        registry; one module per tool family
tests/
justfile

Metadata

Release files for madcat-os 0.1.5

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

Source distribution (sdist)

Source distribution for madcat-os 0.1.5
File Size Uploaded Provenance Actions
madcat_os-0.1.5.tar.gz 62.6 kB With provenance Details for madcat_os-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for madcat-os 0.1.5
File Interpreter ABI Platform Actions
madcat_os-0.1.5-py3-none-any.whl Python 3 none any Details for madcat_os-0.1.5-py3-none-any.whl

Total release size: 80.3 kB

Release files / madcat_os-0.1.5.tar.gz

Download URL madcat_os-0.1.5.tar.gz
Size 62.6 kB
Tags Source
SHA-256 checksum
How to use checksums
47af600057a745f271f6282fbd2c60e0e5b9002efea10eba8572710bd548c98d
BLAKE2b-256 checksum
How to use checksums
eead3dc4454a5c5c14567f07ea0fe13e3c1cfa9519f4914a80e1f55465a89ef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / madcat_os-0.1.5-py3-none-any.whl

Download URL madcat_os-0.1.5-py3-none-any.whl
Size 17.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
422da1cbfa6ae27dd650895bbf244bb53932cbea8fef797c5fed8bcb1f86c68f
BLAKE2b-256 checksum
How to use checksums
98c20571303455044beb6c6b078d9e49f5f685e3eb9a32f5dd719d78f0435613
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for madcat-os 0.1.5

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for madcat_os-0.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

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