0.0
The project is in a healthy, maintained state
A Model Context Protocol (MCP) server that allows AI agents to start, stop, and monitor Rails development servers
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 3.0
~> 1.21

Runtime

~> 1.0
>= 5.0
 Project Readme

Rails Dev MCP

A Model Context Protocol (MCP) server that allows AI agents to manage Rails development servers. Start, stop, and monitor your Rails app directly from Claude!

Features

  • start_dev_server: Start Rails development server on a specified port
  • stop_dev_server: Stop the running Rails server
  • dev_server_logs: View recent logs and notable events (errors, warnings, requests)
  • dev_server_status: Check if the server is running and get connection details

Installation

As a gem

gem install rails-dev-mcp

From source

git clone https://github.com/obie/rails-dev-mcp.git
cd rails-dev-mcp
bundle install
rake install

Usage

With Claude Desktop

Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "rails-dev": {
      "command": "rails-dev-mcp",
      "cwd": "/path/to/your/rails/project"
    }
  }
}

With ClaudeOnRails

The Rails Dev MCP integrates seamlessly with ClaudeOnRails. Add to your claude-swarm.yml:

mcps:
  - name: rails-dev
    type: stdio
    command: rails-dev-mcp
    args: []

Available Tools

start_dev_server

Starts the Rails development server.

Parameters:

  • port (optional): Port number (default: 3000)

Example:

Start the Rails server on port 3001

stop_dev_server

Stops the running Rails development server.

Example:

Stop the Rails server

dev_server_logs

Retrieves recent logs from the Rails server.

Parameters:

  • lines (optional): Number of log lines to retrieve (default: 50)
  • notable_only (optional): Show only errors, warnings, and requests

Example:

Show me the last 100 lines from the Rails server logs
Show me only errors from the Rails logs

dev_server_status

Checks the current status of the Rails development server.

Example:

Is the Rails server running?

How It Works

  1. Process Management: Uses Ruby's Open3 to manage the Rails server process
  2. Log Capture: Redirects server output to a log file for later retrieval
  3. PID Tracking: Maintains PID files to track running processes
  4. Smart Log Filtering: Identifies notable events like errors, warnings, and HTTP requests

Development

# Run tests
bundle exec rspec

# Run linter
bundle exec rubocop

# Build gem
gem build rails-dev-mcp.gemspec

License

MIT License - see LICENSE file for details.