Labsco
neptaco logo

mcproc

โ˜… 9

from neptaco

Manage background processes for AI agents using the Model Context Protocol (MCP).

๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅโœ“ VerifiedFreeAdvanced setup

mcproc

A Model Context Protocol (MCP) server for comfortable background process management on AI agents.

English | ๆ—ฅๆœฌ่ชž

Overview

mcproc bridges the gap between AI agent development and traditional command-line workflows. It enables AI agents to manage long-running development processes (like dev servers, build watchers, etc.) while providing developers with full CLI access to monitor and control these same processes.

Why mcproc?

Simple AI agent-launched processes are stateless and can't manage long-running processes effectively. mcproc solves this by:

  • Unified Control: No more confusion about which agent or terminal is running what - all processes are centrally managed
  • Context Preservation: Logs are captured and stored, allowing AI agents to debug issues while reviewing logs from earlier
  • Developer-Friendly: Full CLI access means you're never locked out of your own development environment

Key Features

  • ๐Ÿ”„ Unified Process Management: Start and manage background processes from AI agents via MCP, then monitor them from your terminal
  • ๐Ÿ‘๏ธ Cross-Environment Visibility: Processes started by AI agents are fully accessible via CLI and other agents, and vice versa
  • ๐Ÿ“ Intelligent Log Management: Capture, persist, and search process logs with powerful regex patterns
  • ๐Ÿ“ Project-Aware: Automatically groups processes by project context
  • ๐Ÿ“Š Real-time Monitoring: Follow logs in real-time from CLI while AI agents manage the processes
  • ๐Ÿ›ก๏ธ XDG Compliant: Follows XDG Base Directory specification for proper file organization
  • โšก Wait-for-Log: Start processes and wait for specific log patterns to ensure readiness
  • ๐Ÿ” Advanced Search: Time-based filtering, context lines, and regex support for log analysis
  • ๐Ÿงฐ Toolchain Support: Execute commands through version managers (mise, asdf, nvm, rbenv, etc.)
  • ๐Ÿงน Clean Command: Stop all processes in a project with a single command
  • ๐ŸŒฒ Process Groups: Automatic cleanup of child processes when stopping parent processes

Architecture

mcproc consists of three main components:

  1. mcproc daemon: A lightweight daemon that manages processes and handles log persistence
  2. mcproc CLI: Command-line interface for developers to interact with the daemon
  3. MCP Server: Exposes process management capabilities to AI agents via the Model Context Protocol

File Locations (XDG Compliant)

  • Config: $XDG_CONFIG_HOME/mcproc/config.toml (defaults to ~/.config/mcproc/)
  • Logs: $XDG_STATE_HOME/mcproc/log/ (defaults to ~/.local/state/mcproc/log/)
  • Runtime: $XDG_RUNTIME_DIR/mcproc/ (defaults to /tmp/mcproc-$UID/)

Development

Building from Source

# Clone the repository
git clone https://github.com/neptaco/mcproc.git
cd mcproc

# Build all components
cargo build --release

# Run tests
cargo test

# Run with verbose logging
RUST_LOG=mcproc=debug cargo run -- daemon start

Project Structure

mcproc/
โ”œโ”€โ”€ mcproc/         # CLI and daemon implementation
โ”œโ”€โ”€ mcp-rs/         # Reusable MCP server library
โ”œโ”€โ”€ proto/          # Protocol buffer definitions
โ””โ”€โ”€ docs/           # Architecture and design documentation