20
.
05
.
2025
20
.
05
.
2025
Ruby on Rails
LLM

Ruby on Rails and Model Context Protocol

Paweł Strzałkowski
Chief Technology Officer

If you have been following the advancements in Artificial Intelligence, you might have heard about the increasing need for a standardized way for AI models, to interact with external data sources and tools. This is where the Model Context Protocol (MCP) comes into play.

MCP is an open protocol designed to standardize how applications provide context to LLMs. As the official website, modelcontextprotocol.io, puts it:

MCP is an open protocol that standardizes how applications provide context to LLMs. Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.

This protocol was introduced by Anthropic in November 2024. The goal was to address the challenge of integrating AI models with diverse systems, which previously often required custom, one-off solutions. Since its introduction, MCP has seen growing adoption and support from major players in the AI field, including OpenAI and Google DeepMind.

How MCP Works

At its core, MCP defines a client-server architecture. AI applications act as clients, requesting information or actions from MCP servers. These servers, in turn, expose data sources or tools in a standardized way. This interaction allows AI models to access and utilize context from various systems like databases, content repositories, or business applications.

The MCP specification outlines several transport methods for this communication. Three key methods are:

  • stdio (Standard Input/Output): A local transfer method, for clients and servers running on the same machine.
  • SSE (Server-Sent Events): An HTTP-based method for servers to stream updates to clients.
  • Streamable-http: Another HTTP-based transport, allowing for efficient data streaming.

MCP in the Ruby Ecosystem

While the overall MCP landscape is evolving quickly, the scene within the Ruby community is also beginning to grow. Although there isn't an official Ruby SDK provided by the initial creators, the community has started to develop its own solutions.

Several gems are already available for developers looking to experiment with or implement MCP in their Ruby applications. Some examples include:

This growing collection of tools shows a great interest in bringing MCP's capabilities to Ruby on Rails and the broader Ruby ecosystem.

Resources and Community

For those interested in diving deeper into MCP, there are several valuable resources:

If you have additional insight and understand MCP much deeper, I strongly recommend reading articles written by seuros, the author of action_mcp gem.

Furthermore, community discussions are taking place on Discord channels, which can be great places to ask questions, share knowledge, and connect with other developers:

As AI continues to integrate more deeply into various applications, protocols like MCP will likely play a crucial role in ensuring standardized communication. The Ruby community's early engagement suggests a promising future for MCP adoption within our ecosystem.

Paweł Strzałkowski
Chief Technology Officer

Check my Twitter

Check my Linkedin

Did you like it? 

Sign up To VIsuality newsletter

READ ALSO

SQL Views in Ruby on Rails

SQL views in Ruby on Rails

14
.
11
.
2023
Jan Grela
Backend
Ruby
Ruby on Rails
Postgresql
Design your bathroom in React

Design your bathroom in React

07
.
05
.
2025
Bartosz Bazański
Frontend
React
Lazy Attributes in Ruby - Krzysztof Wawer

Lazy attributes in Ruby

07
.
05
.
2025
Krzysztof Wawer
Ruby
Software

Exporting CSV files using COPY - Postgres Stories

14
.
11
.
2023
Jarosław Kowalewski
Postgresql
Ruby
Ruby on Rails
Michał Łęcicki - From Celluloid to Concurrent Ruby

From Celluloid to Concurrent Ruby: Practical Examples Of Multithreading Calls

14
.
11
.
2023
Michał Łęcicki
Backend
Ruby
Ruby on Rails
Software

Super Slide Me - Game Written in React

07
.
05
.
2025
Antoni Smoliński
Frontend
React
Jarek Kowalewski - ILIKE vs LIKE/LOWER - Postgres Stories

ILIKE vs LIKE/LOWER - Postgres Stories

14
.
11
.
2023
Jarosław Kowalewski
Ruby
Ruby on Rails
Postgresql

A look back at Friendly.rb 2023

14
.
11
.
2023
Cezary Kłos
Conferences
Ruby

Debugging Rails - Ruby Junior Chronicles

14
.
11
.
2023
Piotr Witek
Ruby on Rails
Backend
Tutorial

GraphQL in Ruby on Rails: How to Extend Connections

14
.
11
.
2023
Cezary Kłos
Ruby on Rails
GraphQL
Backend
Tutorial

Tetris on Rails

17
.
03
.
2024
Paweł Strzałkowski
Ruby on Rails
Backend
Frontend
Hotwire

EURUKO 2023 - here's what you've missed

14
.
11
.
2023
Michał Łęcicki
Ruby
Conferences

Easy introduction to Connection Pool in ruby

14
.
11
.
2023
Michał Łęcicki
Ruby on Rails
Backend
Ruby
Tutorial

When crazy ideas bring great time or how we organized our first Conference!

04
.
12
.
2023
Alexander Repnikov
Ruby on Rails
Conferences
Visuality

Stacey Matrix & Takeaways - why does your IT project suck?

02
.
10
.
2024
Wiktor De Witte
Project Management
Business

A simple guide to pessimistic locking in Rails

14
.
11
.
2023
Michał Łęcicki
Ruby on Rails
Backend
Ruby
Tutorial

Poltrax design - story of POLTRAX (part 3)

04
.
12
.
2023
Mateusz Wodyk
Startups
Business
Design

Writing Chrome Extensions Is (probably) Easier Than You Think

07
.
05
.
2025
Antoni Smoliński
Tutorial
Frontend
Backend

Bounded Context - DDD in Ruby on Rails

17
.
03
.
2024
Paweł Strzałkowski
Ruby on Rails
Domain-Driven Design
Backend
Tutorial

The origin of Poltrax development - story of POLTRAX (part 2)

07
.
05
.
2025
Stanisław Zawadzki
Ruby on Rails
Startups
Business
Backend

Ruby Meetups in 2022 - Summary

14
.
11
.
2023
Michał Łęcicki
Ruby on Rails
Visuality
Conferences

Repository - DDD in Ruby on Rails

17
.
03
.
2024
Paweł Strzałkowski
Ruby on Rails
Domain-Driven Design
Backend
Tutorial

Example Application - DDD in Ruby on Rails

17
.
03
.
2024
Paweł Strzałkowski
Ruby on Rails
Domain-Driven Design
Backend
Tutorial