vector_mcp 0.2.0 → 0.3.1
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 +4 -4
- data/CHANGELOG.md +281 -0
- data/README.md +302 -373
- data/lib/vector_mcp/definitions.rb +3 -1
- data/lib/vector_mcp/errors.rb +24 -0
- data/lib/vector_mcp/handlers/core.rb +132 -6
- data/lib/vector_mcp/logging/component.rb +131 -0
- data/lib/vector_mcp/logging/configuration.rb +156 -0
- data/lib/vector_mcp/logging/constants.rb +21 -0
- data/lib/vector_mcp/logging/core.rb +175 -0
- data/lib/vector_mcp/logging/filters/component.rb +69 -0
- data/lib/vector_mcp/logging/filters/level.rb +23 -0
- data/lib/vector_mcp/logging/formatters/base.rb +52 -0
- data/lib/vector_mcp/logging/formatters/json.rb +83 -0
- data/lib/vector_mcp/logging/formatters/text.rb +72 -0
- data/lib/vector_mcp/logging/outputs/base.rb +64 -0
- data/lib/vector_mcp/logging/outputs/console.rb +35 -0
- data/lib/vector_mcp/logging/outputs/file.rb +157 -0
- data/lib/vector_mcp/logging.rb +71 -0
- data/lib/vector_mcp/security/auth_manager.rb +79 -0
- data/lib/vector_mcp/security/authorization.rb +96 -0
- data/lib/vector_mcp/security/middleware.rb +172 -0
- data/lib/vector_mcp/security/session_context.rb +147 -0
- data/lib/vector_mcp/security/strategies/api_key.rb +167 -0
- data/lib/vector_mcp/security/strategies/custom.rb +71 -0
- data/lib/vector_mcp/security/strategies/jwt_token.rb +118 -0
- data/lib/vector_mcp/security.rb +46 -0
- data/lib/vector_mcp/server/registry.rb +24 -0
- data/lib/vector_mcp/server.rb +141 -1
- data/lib/vector_mcp/transport/sse/client_connection.rb +113 -0
- data/lib/vector_mcp/transport/sse/message_handler.rb +166 -0
- data/lib/vector_mcp/transport/sse/puma_config.rb +77 -0
- data/lib/vector_mcp/transport/sse/stream_manager.rb +92 -0
- data/lib/vector_mcp/transport/sse.rb +119 -460
- data/lib/vector_mcp/version.rb +1 -1
- data/lib/vector_mcp.rb +35 -2
- metadata +63 -21
data/lib/vector_mcp/version.rb
CHANGED
data/lib/vector_mcp.rb
CHANGED
@@ -12,6 +12,7 @@ require_relative "vector_mcp/image_util"
|
|
12
12
|
require_relative "vector_mcp/handlers/core"
|
13
13
|
require_relative "vector_mcp/transport/stdio"
|
14
14
|
# require_relative "vector_mcp/transport/sse" # Load on demand to avoid async dependencies
|
15
|
+
require_relative "vector_mcp/logging"
|
15
16
|
require_relative "vector_mcp/server"
|
16
17
|
|
17
18
|
# The VectorMCP module provides a full-featured, opinionated Ruby implementation
|
@@ -47,10 +48,42 @@ module VectorMCP
|
|
47
48
|
# @return [Logger] the shared logger instance for the library.
|
48
49
|
@logger = Logger.new($stderr, level: Logger::INFO, progname: "VectorMCP")
|
49
50
|
|
51
|
+
# @return [VectorMCP::Logging::Core] the new structured logging system
|
52
|
+
@logging_core = nil
|
53
|
+
|
50
54
|
class << self
|
51
55
|
# @!attribute [r] logger
|
52
|
-
# @return [Logger] the shared logger instance for the library.
|
53
|
-
|
56
|
+
# @return [Logger] the shared logger instance for the library (legacy compatibility).
|
57
|
+
def logger
|
58
|
+
if @logging_core
|
59
|
+
@logging_core.legacy_logger
|
60
|
+
else
|
61
|
+
@logger
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
# Initialize the new structured logging system
|
66
|
+
# @param config [Hash, VectorMCP::Logging::Configuration] logging configuration
|
67
|
+
# @return [VectorMCP::Logging::Core] the logging core instance
|
68
|
+
def setup_logging(config = {})
|
69
|
+
configuration = config.is_a?(Logging::Configuration) ? config : Logging::Configuration.new(config)
|
70
|
+
@logging_core = Logging::Core.new(configuration)
|
71
|
+
end
|
72
|
+
|
73
|
+
# Get a component-specific logger
|
74
|
+
# @param component [String, Symbol] the component name
|
75
|
+
# @return [VectorMCP::Logging::Component] component logger
|
76
|
+
def logger_for(component)
|
77
|
+
setup_logging unless @logging_core
|
78
|
+
@logging_core.logger_for(component)
|
79
|
+
end
|
80
|
+
|
81
|
+
# Configure the logging system
|
82
|
+
# @yield [VectorMCP::Logging::Configuration] configuration block
|
83
|
+
def configure_logging(&)
|
84
|
+
setup_logging unless @logging_core
|
85
|
+
@logging_core.configure(&)
|
86
|
+
end
|
54
87
|
|
55
88
|
# Creates a new {VectorMCP::Server} instance. This is a **thin wrapper** around
|
56
89
|
# `VectorMCP::Server.new`; it exists purely for syntactic sugar so you can write
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vector_mcp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergio Bayona
|
@@ -10,91 +10,107 @@ cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
|
-
name:
|
13
|
+
name: base64
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: 2
|
18
|
+
version: '0.2'
|
19
19
|
type: :runtime
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: 2
|
25
|
+
version: '0.2'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
|
-
name:
|
27
|
+
name: bigdecimal
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
29
29
|
requirements:
|
30
30
|
- - "~>"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '3.1'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
37
|
- - "~>"
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
39
|
+
version: '3.1'
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
|
-
name:
|
41
|
+
name: concurrent-ruby
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
43
43
|
requirements:
|
44
44
|
- - "~>"
|
45
45
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
46
|
+
version: '1.2'
|
47
47
|
type: :runtime
|
48
48
|
prerelease: false
|
49
49
|
version_requirements: !ruby/object:Gem::Requirement
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '1.2'
|
54
54
|
- !ruby/object:Gem::Dependency
|
55
|
-
name:
|
55
|
+
name: json-schema
|
56
56
|
requirement: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '3.0'
|
61
61
|
type: :runtime
|
62
62
|
prerelease: false
|
63
63
|
version_requirements: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '
|
67
|
+
version: '3.0'
|
68
68
|
- !ruby/object:Gem::Dependency
|
69
|
-
name:
|
69
|
+
name: puma
|
70
70
|
requirement: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '
|
74
|
+
version: '6.4'
|
75
75
|
type: :runtime
|
76
76
|
prerelease: false
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
78
78
|
requirements:
|
79
79
|
- - "~>"
|
80
80
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
81
|
+
version: '6.4'
|
82
|
+
- !ruby/object:Gem::Dependency
|
83
|
+
name: rack
|
84
|
+
requirement: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - "~>"
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '3.0'
|
89
|
+
type: :runtime
|
90
|
+
prerelease: false
|
91
|
+
version_requirements: !ruby/object:Gem::Requirement
|
92
|
+
requirements:
|
93
|
+
- - "~>"
|
94
|
+
- !ruby/object:Gem::Version
|
95
|
+
version: '3.0'
|
82
96
|
- !ruby/object:Gem::Dependency
|
83
|
-
name:
|
97
|
+
name: jwt
|
84
98
|
requirement: !ruby/object:Gem::Requirement
|
85
99
|
requirements:
|
86
100
|
- - "~>"
|
87
101
|
- !ruby/object:Gem::Version
|
88
|
-
version: '
|
102
|
+
version: '2.7'
|
89
103
|
type: :runtime
|
90
104
|
prerelease: false
|
91
105
|
version_requirements: !ruby/object:Gem::Requirement
|
92
106
|
requirements:
|
93
107
|
- - "~>"
|
94
108
|
- !ruby/object:Gem::Version
|
95
|
-
version: '
|
96
|
-
description:
|
97
|
-
|
109
|
+
version: '2.7'
|
110
|
+
description: A Ruby gem implementing the Model Context Protocol (MCP) server-side
|
111
|
+
specification. Provides a framework for creating MCP servers that expose tools,
|
112
|
+
resources, prompts, and roots to LLM clients with comprehensive security features,
|
113
|
+
structured logging, and production-ready capabilities.
|
98
114
|
email:
|
99
115
|
- bayona.sergio@gmail.com
|
100
116
|
executables:
|
@@ -103,6 +119,7 @@ executables:
|
|
103
119
|
extensions: []
|
104
120
|
extra_rdoc_files: []
|
105
121
|
files:
|
122
|
+
- CHANGELOG.md
|
106
123
|
- LICENSE.txt
|
107
124
|
- README.md
|
108
125
|
- bin/console
|
@@ -112,14 +129,39 @@ files:
|
|
112
129
|
- lib/vector_mcp/errors.rb
|
113
130
|
- lib/vector_mcp/handlers/core.rb
|
114
131
|
- lib/vector_mcp/image_util.rb
|
132
|
+
- lib/vector_mcp/logging.rb
|
133
|
+
- lib/vector_mcp/logging/component.rb
|
134
|
+
- lib/vector_mcp/logging/configuration.rb
|
135
|
+
- lib/vector_mcp/logging/constants.rb
|
136
|
+
- lib/vector_mcp/logging/core.rb
|
137
|
+
- lib/vector_mcp/logging/filters/component.rb
|
138
|
+
- lib/vector_mcp/logging/filters/level.rb
|
139
|
+
- lib/vector_mcp/logging/formatters/base.rb
|
140
|
+
- lib/vector_mcp/logging/formatters/json.rb
|
141
|
+
- lib/vector_mcp/logging/formatters/text.rb
|
142
|
+
- lib/vector_mcp/logging/outputs/base.rb
|
143
|
+
- lib/vector_mcp/logging/outputs/console.rb
|
144
|
+
- lib/vector_mcp/logging/outputs/file.rb
|
115
145
|
- lib/vector_mcp/sampling/request.rb
|
116
146
|
- lib/vector_mcp/sampling/result.rb
|
147
|
+
- lib/vector_mcp/security.rb
|
148
|
+
- lib/vector_mcp/security/auth_manager.rb
|
149
|
+
- lib/vector_mcp/security/authorization.rb
|
150
|
+
- lib/vector_mcp/security/middleware.rb
|
151
|
+
- lib/vector_mcp/security/session_context.rb
|
152
|
+
- lib/vector_mcp/security/strategies/api_key.rb
|
153
|
+
- lib/vector_mcp/security/strategies/custom.rb
|
154
|
+
- lib/vector_mcp/security/strategies/jwt_token.rb
|
117
155
|
- lib/vector_mcp/server.rb
|
118
156
|
- lib/vector_mcp/server/capabilities.rb
|
119
157
|
- lib/vector_mcp/server/message_handling.rb
|
120
158
|
- lib/vector_mcp/server/registry.rb
|
121
159
|
- lib/vector_mcp/session.rb
|
122
160
|
- lib/vector_mcp/transport/sse.rb
|
161
|
+
- lib/vector_mcp/transport/sse/client_connection.rb
|
162
|
+
- lib/vector_mcp/transport/sse/message_handler.rb
|
163
|
+
- lib/vector_mcp/transport/sse/puma_config.rb
|
164
|
+
- lib/vector_mcp/transport/sse/stream_manager.rb
|
123
165
|
- lib/vector_mcp/transport/stdio.rb
|
124
166
|
- lib/vector_mcp/util.rb
|
125
167
|
- lib/vector_mcp/version.rb
|