Logo mcproc

mcproc

Cộng đồng
neptaco

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

Nhà phát hànhneptaco
Kho mãmcproc
Ngôn ngữRust
Bản fork
5
Sao
10
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    mcproc cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    10 sao và 5 bản fork từ kho mã được liên kết.

mcproc

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

License: MIT Homebrew

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

Installation

Using Homebrew (macOS and Linux)

bash
# Add the tap
brew tap neptaco/tap

# Install mcproc
brew install mcproc

Build from source

Prerequisites

  • Rust toolchain (rustc, cargo)
  • protobuf compiler:
    • macOS: brew install protobuf
    • Linux: apt-get install protobuf-compiler
bash
git clone https://github.com/neptaco/mcproc.git
cd mcproc
cargo build --release

# Install to PATH (optional)
cargo install --path mcproc

Usage

Setup as MCP Server

After installing mcproc, you need to register it as an MCP server with your AI assistant.

For Claude Code

bash
# Register mcproc as an MCP server
claude mcp add mcproc mcproc mcp serve

For Other MCP Clients

Configure your MCP client by adding mcproc to your configuration:

json
{
  "mcpServers": {
    "mcproc": {
      "command": "mcproc",
      "args": ["mcp", "serve"]
    }
  }
}

Available MCP Tools

Once registered, AI agents can use these tools:

  • start_process: Start a development server or background process
  • stop_process: Stop a running process
  • restart_process: Restart a process
  • list_processes: List all running processes
  • get_process_logs: Retrieve process logs
  • search_process_logs: Search through process logs with pattern matching
  • get_process_status: Get detailed process information

For Developers (CLI)

While AI agents manage processes in the background, you can monitor and control them:

Recommended command: mcproc logs -f

CLI Commands

CommandDescriptionFlagsExample
🗒️ psList all running processes-s, --status <STATUS> Filter by statusmcproc ps --status running
🚀 start **<NAME>**Start a new process-c, --cmd <CMD> Command to run-d, --cwd <DIR> Working directory-e, --env <KEY=VAL> Environment variables-p, --project <NAME> Project name--wait-for-log <PATTERN> Wait for log pattern--wait-timeout <SECS> Wait timeout--toolchain <TOOL> Version manager to usemcproc start web -c "npm run dev" -d ./app
🛑 stop **<NAME>**Stop a running process-p, --project <NAME> Project name-f, --force Force kill (SIGKILL)mcproc stop web -p myapp
🔄 restart **<NAME>**Restart a process-p, --project <NAME> Project namemcproc restart web
📜 logs **<NAME>**View process logs-p, --project <NAME> Project name-f, --follow Follow log output-t, --tail <NUM> Number of lines to showmcproc logs web -f -t 100
🔍 grep **<NAME>** **<PATTERN>**Search logs with regex-p, --project <NAME> Project name-C, --context <NUM> Context lines-B, --before <NUM> Lines before match-A, --after <NUM> Lines after match--since <TIME> Search since time--until <TIME> Search until time--last <DURATION> Search last durationmcproc grep web "error" -C 3
🧹 cleanStop all processes in project-p, --project <NAME> Project name-f, --force Force killmcproc clean -p myapp
🎛️ daemon startStart mcproc daemonNonemcproc daemon start
🎛️ daemon stopStop mcproc daemonNonemcproc daemon stop
🎛️ daemon statusCheck daemon statusNonemcproc daemon status
🔌 mcp serveRun as MCP serverNonemcproc mcp serve
ℹ️ --versionShow version infoNonemcproc --version
❓ --helpShow help messageNonemcproc --help

Examples

bash
# Start the daemon (if not already running)
mcproc daemon start

# View all processes (including those started by AI agents)
mcproc ps

# Follow logs in real-time
mcproc logs frontend -f

# Multi-process log streaming per project
mcproc logs -f

# Search through logs
mcproc grep backend "error" -C 5

# Stop a process
mcproc stop frontend

Example Workflow

  1. AI agent starts your development server:

    Agent: "I'll start the frontend dev server for you"
    → Uses MCP tool: start_process(name: "frontend", cmd: "npm run dev", wait_for_log: "Server running")
  2. You monitor it from terminal:

    bash
    mcproc logs -f
    # See real-time logs as the server runs
  3. AI agent detects an error and searches logs:

    Agent: "Let me check what's causing that error"
    → Uses MCP tool: search_process_logs(name: "frontend", pattern: "ERROR|WARN", last: "5m")
  4. You can see the same information:

    bash
    mcproc grep frontend "ERROR|WARN" -C 3 --last 5m

Advanced Examples

bash
# Start a process with environment variables
mcproc start api --cmd "python app.py" --env PORT=8000 --env DEBUG=true

# Wait for a specific log pattern before considering the process ready
mcproc start web --cmd "npm run dev" --wait-for-log "Server running on" --wait-timeout 60

# Search logs with time filters
mcproc grep api "database.*connection" --since "14:30" --until "15:00"

# View logs from multiple processes in the same project
mcproc ps
mcproc logs web --project myapp -t 100

# Use version managers for Node.js projects
mcproc start web --cmd "npm run dev" --toolchain nvm
mcproc start api --cmd "yarn start" --toolchain mise

# Clean up all processes in a project
mcproc clean --project myapp

# Force stop all processes in current project
mcproc clean --force

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

bash
# 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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License

Copyright (c) 2025 Atsuhito Machida (neptaco)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Dùng MCP mcproc với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối mcproc, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm mcproc làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của mcproc.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "mcproc": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của mcproc, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của mcproc.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng mcproc giúp tôi làm việc này không?
mcproc
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng mcproc.

Câu hỏi thường gặp

Máy chủ MCP mcproc dùng để làm gì?

mcproc là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP mcproc với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng mcproc với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP mcproc với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối mcproc, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP mcproc với TypingMind?

mcproc hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP mcproc cung cấp những công cụ nào trong TypingMind?

mcproc cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP mcproc không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu mcproc yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇