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.4

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.4
File Size Uploaded Provenance Actions
madcat_os-0.1.4.tar.gz 61.0 kB With provenance Details for madcat_os-0.1.4.tar.gz

Built distribution (wheel)

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

Total release size: 76.8 kB

Release files / madcat_os-0.1.4.tar.gz

Download URL madcat_os-0.1.4.tar.gz
Size 61.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c79d5b1ef9619c941da1cbff1b44fa6dfd0329029f46e5f0291e82d8a056bde4
BLAKE2b-256 checksum
How to use checksums
3b884946252c291784c551ed6bb599f5f0d2ed0c3848dd1f973bf9aa3b39e80f
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.4-py3-none-any.whl

Download URL madcat_os-0.1.4-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f68a34230195f28db055e30b38c812ee6de8c11445bf8f589dda68f2aa731af2
BLAKE2b-256 checksum
How to use checksums
78f4174417a7a363b97c8dbdfe0ac661b9b001c13a20b5c2dd994d23c13826e2
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.4

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.4.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