Skip to main content

claude_pool/
lib.rs

1//! MCP server for managing a pool of Claude CLI slots.
2//!
3//! `claude-pool` manages N Claude CLI instances behind an MCP server interface.
4//! A coordinator (typically an interactive Claude session) calls MCP tools to
5//! submit work, fan out tasks, chain pipelines, and track budgets. The pool
6//! handles slot lifecycle, session resumption, restarts, and shared context.
7//!
8//! # Architecture
9//!
10//! ```text
11//! Coordinator (interactive Claude session)
12//!   +-- .mcp.json includes "claude-pool"
13//!         +-- claude-pool MCP server
14//!               +-- slot-0 (Claude instance)
15//!               +-- slot-1 (Claude instance)
16//!               +-- slot-N
17//! ```
18//!
19//! One server. N slots. Nothing else.
20
21pub mod chain;
22pub mod config;
23pub mod error;
24pub mod messaging;
25pub mod pool;
26pub mod skill;
27pub mod store;
28pub mod supervisor;
29pub mod types;
30pub mod workflow;
31pub mod worktree;
32
33pub use chain::{
34    ChainIsolation, ChainOptions, ChainProgress, ChainResult, ChainStatus, ChainStep, StepAction,
35    StepFailurePolicy, StepResult, execute_chain,
36};
37pub use error::{Error, Result};
38pub use messaging::{Message, MessageBus};
39pub use pool::{DrainSummary, Pool, PoolBuilder, PoolStatus};
40pub use skill::{RegisteredSkill, Skill, SkillArgument, SkillRegistry, SkillScope, SkillSource};
41pub use store::{InMemoryStore, PoolStore};
42pub use supervisor::{SupervisorHandle, check_and_restart_slots};
43pub use types::*;
44pub use workflow::{Workflow, WorkflowArgument, WorkflowRegistry};
45pub use worktree::WorktreeManager;