devctl-mcp

devctl-mcp

An MCP server that lets Claude manage long-running development processes across frameworks like Flutter, Next.js, Spring Boot, and Vite, with lifecycle control, log streaming, and hot reload support.

Category
访问服务器

README

devctl-mcp

An MCP (Model Context Protocol) server that lets Claude manage long-running dev processes seamlessly — across Flutter, Next.js, Spring Boot, Vite, and any custom stack.

The problem it solves: When Claude spawns flutter run, next dev, or gradle bootRun via bash, it immediately loses control. No hot reload, no log access, no restart. This server runs as a persistent daemon that owns all dev processes and exposes simple tools Claude can call.


Features

  • Flutter — auto-detect FVM, target specific devices, hot reload & hot restart via Dart VM service
  • Next.js — auto-detect package manager (npm / pnpm / yarn / bun) from lockfiles
  • Spring Boot — auto-detect Maven or Gradle, use mvnw/gradlew wrappers when present
  • Vite / React — detect vite.config.* or react-scripts in package.json
  • Generic — run any custom command with full log capture
  • Log streaming — circular buffer (1000 lines), filter by string, timestamps on demand
  • Full process lifecycle — start, stop, restart with status tracking (starting → running → stopped/crashed)

Installation

Prerequisites

  • Node.js 20+
  • Claude Code CLI

Setup

git clone git@github.com:adarsh-devappsys/devctl-mcp.git
cd devctl-mcp
npm install
npm run build

Register globally with Claude Code

claude mcp add -s user devctl -- node /absolute/path/to/devctl-mcp/dist/index.js

Verify it's connected:

claude mcp list
# devctl: node .../dist/index.js - ✓ Connected

The server will be available in all your Claude Code sessions globally.

Project-level (alternative)

The repo ships with a .mcp.json — if you open this repo in Claude Code, it's auto-loaded without any extra setup.


Available Tools

Core — works for all frameworks

Tool Description
list_processes List all managed processes with status, uptime, PID
start_process Start a dev server — auto-detects the framework
stop_process Gracefully stop a process (SIGTERM → SIGKILL after 5s)
restart_process Stop + restart with original configuration
get_logs Get recent log output, with optional line count and filter
clear_logs Clear the log buffer for a process
send_input Send raw text to process stdin (escape hatch)

Flutter-specific

Tool Description
flutter_hot_reload Hot reload via Dart VM service, falls back to stdin r
flutter_hot_restart Hot restart via Dart VM service, falls back to stdin R
list_devices List connected Flutter devices and emulators

Usage Examples

Flutter

List my connected Flutter devices
Start my Flutter app at /Users/me/projects/myapp, name it "myapp", on my Pixel device
Hot reload myapp
Hot restart myapp
Get the last 100 logs from myapp, filter by "error"

With FVM (auto-detected):

If your project has .fvm/flutter_sdk or fvm_config.json, FVM is used automatically. You can also force it:

Start myapp at /path/to/project with use_fvm true, device id "32211JEHN06807"

Next.js

Start the Next.js project at /Users/me/projects/website, name it "web"

Package manager is auto-detected from lockfiles (bun.lockb → bun, pnpm-lock.yaml → pnpm, yarn.lock → yarn, else npm). Override with package_manager: "pnpm".

Spring Boot

Start /Users/me/projects/api, name it "api"

Maven vs Gradle auto-detected from pom.xml / build.gradle. Uses ./mvnw or ./gradlew wrappers when present.

Any other stack

Start /Users/me/projects/backend, name it "django", command "python manage.py runserver"

Checking logs

Show me the logs for myapp
Get last 50 lines from api, filter by "Exception"
Get logs from web with timestamps

Framework Auto-Detection

The adapter is chosen automatically based on what's in your project directory:

Framework Detection
Flutter pubspec.yaml exists
Spring Boot pom.xml or build.gradle / build.gradle.kts
Next.js package.json with next in dependencies
Vite vite.config.* file, or vite/react-scripts in package.json
Generic Fallback — requires command option

Priority: Flutter → Spring Boot → Next.js → Vite → Generic

FVM Auto-Detection (Flutter)

FVM is auto-enabled when both are true:

  1. fvm binary is in PATH
  2. Project has .fvm/flutter_sdk, fvm_config.json, or .fvmrc

Override: pass use_fvm: true or use_fvm: false explicitly.

Package Manager Auto-Detection (JS projects)

Detected from lockfiles in priority order:

  1. bun.lockb → bun
  2. pnpm-lock.yaml → pnpm
  3. yarn.lock → yarn
  4. Fallback → npm

How Flutter Hot Reload Works

The server uses a two-tier system for maximum reliability:

Tier 1 — Dart VM service (preferred)

When flutter run starts, it prints a line like:

A Dart VM Service on Pixel 7a is available at: http://127.0.0.1:56789/TOKEN=/

The server captures this URL and derives a WebSocket endpoint. Hot reload/restart is sent as JSON-RPC over WebSocket — the same protocol Flutter DevTools uses.

Hot reload sequence: getVM → reloadSources → callServiceExtension('ext.flutter.reassemble')

Hot restart sequence: getVM → callService('hotRestart')

Tier 2 — stdin fallback

If the VM service URL isn't available yet (app still starting up), the server sends r or R to the process stdin — Flutter's interactive keyboard commands.


Development

# Run without building (tsx watches for changes)
npm run dev

# Build
npm run build

# Type-check only
npm run typecheck

Project Structure

src/
  index.ts              ← MCP server entry, stdio transport
  types.ts              ← Shared TypeScript interfaces
  process-manager.ts    ← Process registry, spawn, lifecycle, VM service URL parsing
  log-store.ts          ← Circular buffer (1000 lines, stdout + stderr + timestamps)
  adapters/
    flutter.ts          ← Flutter + FVM detection
    nextjs.ts           ← Next.js + package manager detection
    spring-boot.ts      ← Maven/Gradle + wrapper detection
    vite.ts             ← Vite/React-scripts detection
    generic.ts          ← Fallback for custom commands
    registry.ts         ← Ordered detection chain
  tools/
    process-tools.ts    ← 7 core MCP tools
    flutter-tools.ts    ← Flutter hot reload/restart + list_devices

Important Notes

  • Session persistence: Managed processes live as long as the Claude Code session is open. If you close the session, running processes are stopped. This is a fundamental constraint of the stdio MCP transport.
  • stdout is reserved: The MCP protocol uses process.stdout for JSON-RPC messages. All internal server logs go to stderr.
  • PATH inheritance: The server inherits your shell PATH, so fvm, flutter, mvn, gradle, etc. must be on your PATH as they would be in a terminal.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选