How harold15000/p2pc works
P2PC is a self-hosted batch-job platform: clients submit OCI-image jobs to a control-plane server, which schedules work to enrolled Linux or Windows nodes; agents run jobs in isolated sandboxes and return logs, status and outputs. The graph also preserves the documented CLI, Python SDK, MCP, service/port access and allowlisted egress capabilities. Relationships are limited to README statements and the shown source/index references; several implementation branches are represented at directory level because their source was not sampled.
Main entry points: app.rs HTTP application · main.rs Node agent · cli.rs CLI · client.py Python SDK
Components 19
Clients
- CLI
crates/p2pc-cli/src/cli.rs - Python SDK
sdk/python/p2pc/client.py - MCP server
crates/p2pc-cli/src/mcp/server.rs - REST client API
crates/p2pc-client/src/client.rs
Control plane
- HTTP application
crates/p2pc-server/src/app.rs - API handlers
crates/p2pc-server/src - Job scheduler
crates/p2pc-server/src/scheduler/service.rs - SQLite state
crates/p2pc-server/src/store - Node and port gateway
crates/p2pc-server/src/gateway
Node runtime
- Node agent
crates/p2pc-agent/src/main.rs - Agent connection
crates/p2pc-agent/src/connection/session.rs - Job executor
crates/p2pc-agent/src/executor - Sandbox runtime
crates/p2pc-agent/src/sandbox/engine.rs - Egress proxy
crates/p2pc-agent/src/egress - Windows WSL support
crates/p2pc-wsl/src/runner.rs
Shared contracts
- API and job contracts
crates/p2pc-proto/src/api.rs
Other components
- User or API caller
- Containerized job
- Allowed domains
Connections 21
- User or API caller → CLI: uses
README.md - User or API caller → Python SDK: uses
README.md - User or API caller → MCP server: invokes
README.md - User or API caller → REST client API: calls
README.md - CLI → HTTP application: submits requests
README.md - Python SDK → HTTP application: submits requests
README.md - MCP server → HTTP application: submits requests
README.md - REST client API → HTTP application: sends HTTP
crates/p2pc-client/src/client.rs - HTTP application → API handlers: routes
crates/p2pc-server/src/app.rs - HTTP application → SQLite state: writes audit
crates/p2pc-server/src/app.rs - Job scheduler → SQLite state: uses leases
crates/p2pc-server/src/scheduler/service.rs - Node agent → HTTP application: dials outbound
README.md - Node agent → Agent connection: runs connection
crates/p2pc-agent/src/main.rs - Agent connection → Job executor: dispatches leases
- Job executor → Sandbox runtime: runs job
crates/p2pc-agent/src/sandbox/engine.rs - Sandbox runtime → Containerized job: starts container
README.md - Containerized job → Egress proxy: requests allowed egress
README.md - Egress proxy → Allowed domains: permits domains
README.md - HTTP application → API and job contracts: uses API types
- Node agent → Windows WSL support: uses on Windows
- HTTP application → Node and port gateway: provides tunnels
crates/p2pc-server/src/app.rs