11# README
22
3- ## MCP com Ruby on Rails
3+ ## MCP with Ruby on Rails
44
5- Este é um projeto de exemplo que demonstra a implementação do protocolo MCP (Model-Controller-Provider) usando Ruby on Rails. O MCP permite que modelos de linguagem (LLMs) interajam com ferramentas externas através de uma interface JSON-RPC.
5+ This is an example project that demonstrates the implementation of the MCP (Model-Controller-Provider) protocol using Ruby on Rails. MCP allows language models (LLMs) to interact with external tools through a JSON-RPC interface .
66
77---
88
9- ### 🚀 Como rodar o projeto
10- - Instalar dependências no seu VScode
9+ ### 🚀 How to run the project
10+
11+ - Install dependencies in your VSCode
1112 - [ Devcontainer] ( https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers )
1213
13- - Iniciar o servidor Rails:
14+ - Start the Rails server :
1415``` bash
1516bin/rails server -b 0.0.0.0 -p 3000
1617```
1718
18- - Iniciar o servidor Rails com rdbg (para depuração ):
19+ - Start the Rails server with rdbg (for debugging ):
1920``` bash
2021bundle exec rdbg --open --port 12345 --host 0.0.0.0 --nonstop --command -- \
2122 bin/rails server -b 0.0.0.0 -p 3000
2223```
2324
24- - Executar testes :
25+ - Run tests :
2526``` bash
2627bin/rails test
2728```
2829
2930---
3031
31- ### 🧩 Conceitos básicos MCP
32-
33- 1️⃣ Server (Servidor MCP)
34-
35- 👉 É quem ** oferece ferramentas** (_ tools_ ) que uma IA pode usar.
32+ ### 🧩 MCP Basic Concepts
3633
37- - Ele ** exponde endpoints JSON-RPC** via ` /mcp ` .
38- - Ele ** descreve** suas ferramentas no método ` tools/list ` .
39- - Ele ** executa** uma ferramenta quando o cliente pede via ` tools/call ` .
34+ ** 1️⃣ Server (MCP Server)**
4035
41- 2️⃣ Client (Cliente MCP)
36+ 👉 It's the one that ** provides tools** (_ tools_ ) that an AI can use.
37+ - It ** exposes JSON-RPC endpoints** via ` /mcp ` .
38+ - It ** describes** its tools in the ` tools/list ` method.
39+ - It ** executes** a tool when the client requests it via ` tools/call ` .
4240
43- 👉 É quem ** consome ** ( _ tools _ ) essas ferramentas.
41+ ** 2️⃣ Client (MCP Client) **
4442
45- - Pode ser uma ** IA** (como ChatGPT, Claude, Llama, etc).
46- - Ou um ** agente** intermediário (ex: script em Python ou Ruby que conecta o LLM ao teu MCP Server).
47- - O cliente faz:
48- - ` tools/list ` → pergunta “que ferramentas você oferece?”
49- - ` tools/call ` → executa uma ferramenta com certos parâmetros
43+ 👉 It's the one that ** consumes** those tools (_ tools_ ).
44+ - It can be an ** AI** (like ChatGPT, Claude, Llama, etc).
45+ - Or an ** intermediary agent** (e.g., a Python or Ruby script that connects the LLM to your MCP Server).
46+ - The client performs:
47+ - ` tools/list ` → asks "what tools do you offer?"
48+ - ` tools/call ` → executes a tool with certain parameters
5049
51- 🔶 Diagrama visual
50+ ** 🔶 Visual Diagram **
5251```
5352 ┌────────────────────────┐
54- │ Usuário │
55- │ "Crie um post..." │
53+ │ User │
54+ │ "Create a post..." │
5655 └──────────┬─────────────┘
5756 │
5857 ▼
5958 ┌────────────────────────┐
60- │ LLM (Cliente) │
59+ │ LLM (Client) │
6160 │ Ex: ChatGPT / Claude │
62- │ ou LLM local (Ollama)│
61+ │ or local LLM (Ollama) │
6362 └──────────┬─────────────┘
6463 │
6564 │ JSON-RPC (tools/list, tools/call)
6665 ▼
6766 ┌──────────────────────────────────────────┐
6867 │ 🚀 Rails App (MCP Server) │
69- │ Expondo endpoint: /mcp │
68+ │ Exposing endpoint: /mcp │
7069 │------------------------------------------│
7170 │ Tools: │
7271 │ - post-create-tool │
@@ -75,13 +74,13 @@ bin/rails test
7574 │ - post-show-tool │
7675 │ - post-update-tool │
7776 │------------------------------------------│
78- │ Usa models e lógica do Rails: │
77+ │ Uses Rails models and logic: │
7978 │ Post.create, Post.all, etc. │
8079 └──────────────────────────────────────────┘
8180 │
8281 ▼
8382 ┌──────────────────────────────────┐
84- │ Banco de Dados (PG) │
83+ │ Database (PG) │
8584 │ posts(id, title, description) │
8685 └──────────────────────────────────┘
8786```
0 commit comments