Skip to main content

Universal Claude agent manager with CLI, HTTP API, and MCP integration

Project description

Claudy

Universal Claude agent manager - FastMCP-based MCP server for managing persistent Claude agent sessions

Claudy lets you spawn and manage multiple Claude agent sessions from within Claude Code, with automatic session management, TTL-based cleanup, and fork support.

Features

  • 🤖 MCP Native - Built with FastMCP for seamless Claude Code integration
  • 🔄 Context Preservation - Agents remember conversation history across calls
  • 🌳 Session Forking - Branch conversations to explore alternative paths
  • ⏱️ Auto Cleanup - 2-hour idle timeout prevents resource leaks
  • 🔐 Permission Inheritance - Auto-created sessions bypass permissions by default
  • 🚀 Zero Configuration - Works out of the box with uvx

Quick Start

Installation (Claude Code)

Add to your .mcp.json or claude_desktop_config.json:

{
  "mcpServers": {
    "claudy": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/kangjihyeok/claude-agentic-skills.git@main#subdirectory=claudy",
        "fastmcp",
        "run",
        "claudy.mcp_server:mcp"
      ]
    }
  }
}

That's it! uvx will automatically handle dependencies.

Usage (from Claude Code)

Basic Session Management

# Auto-create and call a session
Use claudy_call with name="researcher" and message="Search for latest AI papers"

# Check status
Use claudy_status with name="researcher"

# List all sessions
Use claudy_list

# Cleanup
Use claudy_cleanup with name="researcher"

Context Preservation Example

1. claudy_call(name="memory_test", message="Remember this number: 42")
2. claudy_call(name="memory_test", message="What number did I ask you to remember?")
   → "42" ✓ Context preserved!

Session Forking

# Create base session
claudy_call(name="analysis", message="Analyze this codebase")

# Fork to explore alternatives
claudy_call(
    name="analysis",
    message="Try refactoring approach B",
    fork=True,
    fork_name="analysis_fork_b"
)

# Original session unchanged
claudy_call(name="analysis", message="Continue with approach A")

MCP Tools

claudy_call

Send a message to an agent session (auto-creates if doesn't exist).

Parameters:

  • name (str): Session name
  • message (str): Message to send
  • verbosity (str): "quiet", "normal", or "verbose" (default: "normal")
  • fork (bool): Fork before sending (default: false)
  • fork_name (str, optional): Name for forked session
  • parent_session_id (str, optional): Parent to inherit from (auto-detected)

Returns: JSON with success, name, response, session_id

claudy_list

List all active agent sessions.

Returns: JSON with success, sessions (array of session metadata)

claudy_status

Get detailed status of a specific session.

Parameters:

  • name (str): Session name

Returns: JSON with session metadata (created_at, last_used, message_count, etc.)

claudy_cleanup

Cleanup one or all sessions.

Parameters:

  • name (str, optional): Session name to cleanup
  • all (bool): Cleanup all sessions (default: false)

Returns: JSON with success, message

Architecture

Claude Code
    ↓ MCP (stdio)
FastMCP Server
    ↓ Direct
ClaudeSDKClient Sessions (in-memory)
    └─ Auto cleanup (2hr idle timeout)

Key features:

  • Single process (no HTTP server needed)
  • Global session storage (shared across all MCP connections)
  • Background TTL cleanup task
  • Auto-detection of current Claude session ID for permission inheritance

Configuration

Edit claudy/mcp_server.py to customize:

SESSION_IDLE_TIMEOUT = 7200  # 2 hours
SESSION_CLEANUP_INTERVAL = 300  # 5 minutes

Development

Local Development

# Clone repo
git clone https://github.com/kangjihyeok/claude-agentic-skills.git
cd claude-agentic-skills/claudy

# Install with uv
uv pip install -e .

# Run MCP server
fastmcp dev claudy/mcp_server.py:mcp

Local Testing in Claude Code

Use local path in .mcp.json:

{
  "mcpServers": {
    "claudy": {
      "type": "stdio",
      "command": "/path/to/fastmcp",
      "args": ["run", "/path/to/claudy/mcp_server.py:mcp"]
    }
  }
}

How It Works

Auto-Creation

Sessions are automatically created on first claudy_call:

  • Inherits current Claude session ID (auto-detected from ~/.claude/projects/)
  • Sets bypassPermissions mode by default
  • Can use all tools (WebSearch, Read, Write, etc.)

TTL Cleanup

Background task runs every 5 minutes:

  • Checks last_used timestamp of each session
  • Disconnects and removes sessions idle > 2 hours
  • Prevents memory leaks from forgotten sessions

Forking

When fork=True:

  • Creates new session with resume + fork_session options
  • Inherits full conversation history from parent
  • Parent and fork are independent after creation

Requirements

  • Python 3.10+
  • Claude Code 2.0+ (for claude-agent-sdk)
  • fastmcp >= 2.12.0
  • claude-agent-sdk >= 0.1.4

License

MIT License

Author

Kang Jihyeok


Built with ❤️ using FastMCP and claude-agent-sdk

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claudy-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claudy-0.1.0-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file claudy-0.1.0.tar.gz.

File metadata

  • Download URL: claudy-0.1.0.tar.gz
  • Upload date:
  • Size: 13.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for claudy-0.1.0.tar.gz
Algorithm Hash digest
SHA256 abd8364237bb12a42dea403845af2c7cec4416ceecc463b5e07526457bbfc7a1
MD5 8b75efea597382350ad2df60fd29286b
BLAKE2b-256 1e34f4f9dfd771cda5775781e13c065a3c8d206fd4c09869323e2b51f3d4b754

See more details on using hashes here.

File details

Details for the file claudy-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: claudy-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.5

File hashes

Hashes for claudy-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f5c4adf92f18d085aa2d53081905ddc5996d8be82b6cd87d5679b0f991c80b8
MD5 9b88092ea269e77617dff41f581fdcdd
BLAKE2b-256 f7e4a8c0e8b06fa87a040d473a7718be50e308b67f2dde559cbc282bcf0a540f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page