File tree Expand file tree Collapse file tree 3 files changed +25
-3
lines changed
Expand file tree Collapse file tree 3 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 22 "servers" : {
33 "rails-app-mcp" : {
44 "type" : " http" ,
5- "url" : " http://localhost:3000/mcp"
5+ "url" : " http://localhost:3000/mcp" ,
6+ // "headers": {
7+ // // "Basic #{Base64.strict_encode64("mcp_username:mcp_password") }"
8+ // "Authorization": "Basic bWNwX3VzZXJuYW1lOm1jcF9wYXNzd29yZA=="
9+ // }
610 }
711 }
812}
Original file line number Diff line number Diff line change 11class McpController < ApplicationController
2+ # Add authenticate_or_request_with_http_basic
3+ include ActionController ::HttpAuthentication ::Basic ::ControllerMethods
4+
5+ # before_action :authenticate!
6+
27 INSTRUCTIONS = <<~INSTRUCTIONS
38 Você é um assistente especializado em gerenciamento de postagens de blog.
49
@@ -36,4 +41,13 @@ def handle
3641
3742 render json : server . handle_json ( request . body . read )
3843 end
44+
45+
46+ private
47+
48+ def authenticate!
49+ authenticate_or_request_with_http_basic do |username , password |
50+ username == "mcp_username" && password == "mcp_password"
51+ end
52+ end
3953end
Original file line number Diff line number Diff line change @@ -11,11 +11,15 @@ class UpdateTool < MCP::Tool
1111 } ,
1212 title : {
1313 type : "string" ,
14- description : "Novo título da postagem (opcional)"
14+ description : "Novo título da postagem (opcional)" ,
15+ minLength : 3 ,
16+ maxLength : 255
1517 } ,
1618 description : {
1719 type : "string" ,
18- description : "Nova descrição da postagem (opcional)"
20+ description : "Nova descrição da postagem (opcional)" ,
21+ minLength : 10 ,
22+ maxLength : 10000
1923 }
2024 } ,
2125 required : [ "id" ]
You can’t perform that action at this time.
0 commit comments