stack-service-base 0.0.58 → 0.0.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f07b63778720acb4d2629f0cd7fd0cb9042194f9e8cf4b8c36fd766555a3e7ef
4
- data.tar.gz: b44692326f9a69a994ab2915dccbbf714bc1500d9d02b5f2acc4c717d642e8a9
3
+ metadata.gz: a484a4b111bb64584904cfa41d26ac06d59aca66f203b740d5ae8ea8496b0597
4
+ data.tar.gz: b3d6034376d7112be1dfc68e39f119d60b1609ca92d6f7ebde8ddcc66143a812
5
5
  SHA512:
6
- metadata.gz: dbe54cb277386c5ef81d3c5746ccb4c2f8931d7d83145f6184e4bd461cdaff7e320b2ede10dd79eed87aba917917a569b9419813aed167f9e39f8464772f301c
7
- data.tar.gz: 0fb8592aeb9801157144a4e25fa27a78179722c28493ffe350694e3a705f1d8bd309a4326ca03a695f70fbe9bdff7a3bfa17603272cd5f94fcd6249192cfaa96
6
+ metadata.gz: 2aa379daf4976849e6475d6169bc0d91a1885acde8b9deb1359f842f10ba50925bb0f7bb34c99d59e26a3b08c29280b609e186122b644d5829941e0b73bac18f
7
+ data.tar.gz: 6a98356cd43a5a14f96bb6ab713cb6517dfcdb8191424795af4b37559e4b2879164ff91ae09d0fbebe1233a74f0e6b12e269444cfa3af6edd0f793cd5a8b07c6
@@ -14,6 +14,8 @@ module RpcErrorHelpers
14
14
  end
15
15
 
16
16
  class McpProcessor
17
+ PROTOCOL_VERSION = '2025-06-18'
18
+
17
19
  include RpcErrorHelpers
18
20
  ParseError = Class.new(StandardError) do
19
21
  attr_reader :body, :status
@@ -54,18 +56,40 @@ class McpProcessor
54
56
  end
55
57
 
56
58
  def rpc_response(id:, method:, params:)
57
- json_rpc_response(id: id) { handle(method: method, params: params) }
59
+ json_rpc_response(id: id) { |body| handle(method: method, params: params, body: body) }
58
60
  end
59
61
 
60
- def handle(method:, params:)
62
+ def handle(method:, params:, body: )
61
63
  case method
62
- when "tools/list" then list_tools
63
- when "tools/call" then call_tool(params || {})
64
+ when "tools/list" then list_tools
65
+ when "tools/call" then call_tool(params || {})
66
+ when "initialize" then initialize_(body)
67
+ when "initialized" then {}
64
68
  else
65
69
  rpc_error!(-32601, "Unknown method #{method}")
66
70
  end
67
71
  end
68
72
 
73
+ # https://gist.github.com/ruvnet/7b6843c457822cbcf42fc4aa635eadbb
74
+
75
+ def initialize_(body)
76
+ body[:serverInfo] = {
77
+ name: 'mcp-server',
78
+ title: 'MCP Server',
79
+ version: '1.0.0'
80
+ }
81
+ # result
82
+ {
83
+ protocolVersion: PROTOCOL_VERSION,
84
+ capabilities: {
85
+ logging: {},
86
+ prompts: { listChanged: false },
87
+ resources: { listChanged: false },
88
+ tools: { listChanged: false }
89
+ }
90
+ }
91
+ end
92
+
69
93
  private
70
94
 
71
95
  def json_rpc_response(id:)
@@ -8,7 +8,7 @@ COPY . .
8
8
 
9
9
  CMD ["bash", "-c", "-x", "\
10
10
  env && cd /build/docker && \
11
- build-labels -n -c docker-compose.yml gitlab set_version to_dockerfiles to_compose | tee bake.yml && \
11
+ build-labels -n -c docker-compose.yml changed gitlab set_version to_dockerfiles to_compose | tee bake.yml && \
12
12
  export OTEL_RESOURCE_ATTRIBUTES=service.name=docker-builder,pipeline.id=${CI_PIPELINE_ID},project.name=${CI_PROJECT_NAME} && \
13
13
  export REGISTRY_HOST=$CI_REGISTRY_HOST && \
14
14
  grep \"services: {}\" bake.yml || docker buildx bake -f bake.yml $([ -z \"$CI_SKIP_PUSH\" ] && echo \"--push\") && \
@@ -117,6 +117,7 @@ module RackHelpers
117
117
  # end
118
118
 
119
119
  Rack.define_middleware :HeadersLogger do |env, app, opts|
120
+ LOGGER.info env.select { %w'REQUEST_METHOD REQUEST_PATH REQUEST_URI QUERY_STRING'.include? _1 }
120
121
  LOGGER.info env.select { _1 =~ /HTTP/ }.transform_keys { _1.gsub 'HTTP_', '' }
121
122
  status, headers, body =app.call env
122
123
 
@@ -1,5 +1,5 @@
1
1
  Options name: 'stack-name'
2
2
 
3
- Service :service_name, image: 'service_name/master', ports: 8000, ingress: { host: 'service_name.*' }
3
+ Service :service_name, image: 'service_name/master', ports: 7000, ingress: { host: 'service_name.*' }
4
4
 
5
5
  raise 'Configure the stack (https://github.com/artyomb/dry-stack)'
@@ -1,3 +1,3 @@
1
1
  module StackServiceBase
2
- VERSION = '0.0.58'
2
+ VERSION = '0.0.60'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stack-service-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.58
4
+ version: 0.0.60
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artyom B