ActionMCP

by seuros

116 stars
353 downloads
Not rated
GitHub

About

ActionMCP is a Ruby gem that provides Model Context Protocol (MCP) server capability to Ruby on Rails applications. It is designed for production Rails environments and supports network-based deployments only (STDIO transport is not supported). The gem offers base classes and…

Details

Author
seuros
GitHub stars
116
Downloads
353
Categories
Other, AI

- Provides base classes for Prompt, Tool, and ResourceTemplate.
- Supports MCP 2025-06-18 with backward compatibility to 2025-03-26.
- Full JSON‑RPC 2.0 transport layer with capability negotiation.
- Consent management for sensitive tool operations.
- Structured output via output_schema and resource_link support.
- Task‑augmented tools with async execution and progress updates.

Add the gem to your Gemfile with bundle add actionmcp, run bundle install, copy migrations with bin/rails action_mcp:install:migrations, generate base classes and configuration with bin/rails generate action_mcp:install, then run bin/rails db:migrate. Subclass the provided Prompt, Tool, and ResourceTemplate classes to expose your app’s functionality to LLMs.

ActionMCP

ActionMCP is a Ruby gem focused on providing Model Context Protocol (MCP) capability to Ruby on Rails applications, specifically as a server.

ActionMCP is designed for production Rails environments and does not support STDIO transport. STDIO is not included because it is not production-ready and is only suitable for desktop or script-based use cases. Instead, ActionMCP is built for robust, network-based deployments.

The client functionality in ActionMCP is intended to connect to remote MCP servers, not to local processes via STDIO.

It offers base classes and helpers for creating MCP applications, making it easier to integrate your Ruby/Rails application with the MCP standard.

With ActionMCP, you can focus on your app's logic while it handles the boilerplate for MCP compliance.

Introduction

Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to large language models (LLMs).

Think of it as a universal interface for connecting AI assistants to external data sources and tools.

MCP allows AI systems to plug into various resources in a consistent, secure way, enabling two-way integration between your data and AI-powered applications.

This means an AI (like an LLM) can request information or actions from your application through a well-defined protocol, and your app can provide context or perform tasks for the AI in return.

ActionMCP is targeted at developers building MCP-enabled Rails applications. It simplifies the process of integrating Ruby and Rails apps with the MCP standard by providing a set of base classes and an easy-to-use server interface.

Protocol Support

ActionMCP supports MCP 2025-06-18 (current) with backward compatibility for MCP 2025-03-26. The protocol implementation is fully compliant with the MCP specification, including:

- JSON-RPC 2.0 transport layer
- Capability negotiation during initialization
- Error handling with proper error codes (-32601 for method not found, -32002 for consent required)
- Session management with resumable sessions
- Change notifications for dynamic capability updates

For a detailed (and entertaining) breakdown of protocol versions, features, and our design decisions, see The Hitchhiker's Guide to MCP.

Don't Panic: The guide contains everything you need to know about surviving MCP protocol versions.

> Note: STDIO transport is not supported in ActionMCP. This gem is focused on production-ready, network-based deployments. STDIO is only suitable for desktop or script-based experimentation and is intentionally excluded.

Instead of implementing MCP support from scratch, you can subclass and configure the provided Prompt, Tool, and ResourceTemplate classes to expose your app's functionality to LLMs.

ActionMCP handles the underlying MCP message format and routing, so you can adhere to the open standard with minimal effort.

In short, ActionMCP helps you build an MCP server (the component that exposes capabilities to AI) more quickly and with fewer mistakes.

> Client connections: The client part of ActionMCP is meant to connect to remote MCP servers only. Connecting to local processes (such as via STDIO) is not supported.

Requirements

- Ruby: 3.4.8+ or 4.0.0+
- Rails: 8.1.1+
- Database: PostgreSQL, MySQL, or SQLite3

ActionMCP is tested against Ruby 3.4.8 and 4.0.0 with Rails 8.1.1+.

Installation

To start using ActionMCP, add it to your project:

```bash

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.