cf-mcp 0.19.0 → 0.21.0
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 +51 -0
- data/Manifest.txt +3 -1
- data/README.md +21 -0
- data/Rakefile +28 -4
- data/exe/cf-mcp +1 -1
- data/lib/cf/mcp/cli.rb +128 -53
- data/lib/cf/mcp/downloader.rb +9 -5
- data/lib/cf/mcp/github_client.rb +2 -1
- data/lib/cf/mcp/index.rb +21 -18
- data/lib/cf/mcp/index_builder.rb +8 -4
- data/lib/cf/mcp/index_cache.rb +152 -0
- data/lib/cf/mcp/models/doc_item.rb +6 -13
- data/lib/cf/mcp/models/enum_doc.rb +3 -6
- data/lib/cf/mcp/models/function_doc.rb +15 -22
- data/lib/cf/mcp/models/struct_doc.rb +3 -6
- data/lib/cf/mcp/models/topic_doc.rb +3 -5
- data/lib/cf/mcp/parser.rb +29 -57
- data/lib/cf/mcp/server.rb +36 -27
- data/lib/cf/mcp/templates/index.erb +1 -1
- data/lib/cf/mcp/templates/script.js +15 -2
- data/lib/cf/mcp/tool_command.rb +108 -0
- data/lib/cf/mcp/tools/category_enum.rb +31 -0
- data/lib/cf/mcp/tools/find_related.rb +6 -3
- data/lib/cf/mcp/tools/get_details.rb +4 -0
- data/lib/cf/mcp/tools/get_topic.rb +4 -0
- data/lib/cf/mcp/tools/list_category.rb +7 -1
- data/lib/cf/mcp/tools/list_topics.rb +4 -0
- data/lib/cf/mcp/tools/member_search.rb +14 -16
- data/lib/cf/mcp/tools/parameter_search.rb +23 -30
- data/lib/cf/mcp/tools/search_tool.rb +7 -1
- data/lib/cf/mcp/topic_parser.rb +30 -77
- data/lib/cf/mcp/version.rb +1 -1
- data/lib/cf/mcp.rb +9 -0
- metadata +10 -22
- data/sig/cf/mcp.rbs +0 -299
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: cf-mcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.21.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Piotr Usewicz
|
|
@@ -9,48 +9,34 @@ bindir: exe
|
|
|
9
9
|
cert_chain: []
|
|
10
10
|
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
|
-
- !ruby/object:Gem::Dependency
|
|
13
|
-
name: listen
|
|
14
|
-
requirement: !ruby/object:Gem::Requirement
|
|
15
|
-
requirements:
|
|
16
|
-
- - "~>"
|
|
17
|
-
- !ruby/object:Gem::Version
|
|
18
|
-
version: '3.10'
|
|
19
|
-
type: :runtime
|
|
20
|
-
prerelease: false
|
|
21
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
-
requirements:
|
|
23
|
-
- - "~>"
|
|
24
|
-
- !ruby/object:Gem::Version
|
|
25
|
-
version: '3.10'
|
|
26
12
|
- !ruby/object:Gem::Dependency
|
|
27
13
|
name: mcp
|
|
28
14
|
requirement: !ruby/object:Gem::Requirement
|
|
29
15
|
requirements:
|
|
30
16
|
- - "~>"
|
|
31
17
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: '
|
|
18
|
+
version: '1.5'
|
|
33
19
|
type: :runtime
|
|
34
20
|
prerelease: false
|
|
35
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
22
|
requirements:
|
|
37
23
|
- - "~>"
|
|
38
24
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: '
|
|
25
|
+
version: '1.5'
|
|
40
26
|
- !ruby/object:Gem::Dependency
|
|
41
27
|
name: puma
|
|
42
28
|
requirement: !ruby/object:Gem::Requirement
|
|
43
29
|
requirements:
|
|
44
30
|
- - "~>"
|
|
45
31
|
- !ruby/object:Gem::Version
|
|
46
|
-
version: '
|
|
32
|
+
version: '8.0'
|
|
47
33
|
type: :runtime
|
|
48
34
|
prerelease: false
|
|
49
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
50
36
|
requirements:
|
|
51
37
|
- - "~>"
|
|
52
38
|
- !ruby/object:Gem::Version
|
|
53
|
-
version: '
|
|
39
|
+
version: '8.0'
|
|
54
40
|
- !ruby/object:Gem::Dependency
|
|
55
41
|
name: rack
|
|
56
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -116,6 +102,7 @@ files:
|
|
|
116
102
|
- lib/cf/mcp/github_client.rb
|
|
117
103
|
- lib/cf/mcp/index.rb
|
|
118
104
|
- lib/cf/mcp/index_builder.rb
|
|
105
|
+
- lib/cf/mcp/index_cache.rb
|
|
119
106
|
- lib/cf/mcp/models/doc_item.rb
|
|
120
107
|
- lib/cf/mcp/models/enum_doc.rb
|
|
121
108
|
- lib/cf/mcp/models/function_doc.rb
|
|
@@ -133,6 +120,8 @@ files:
|
|
|
133
120
|
- lib/cf/mcp/templates/index.erb
|
|
134
121
|
- lib/cf/mcp/templates/script.js
|
|
135
122
|
- lib/cf/mcp/templates/style.css
|
|
123
|
+
- lib/cf/mcp/tool_command.rb
|
|
124
|
+
- lib/cf/mcp/tools/category_enum.rb
|
|
136
125
|
- lib/cf/mcp/tools/find_related.rb
|
|
137
126
|
- lib/cf/mcp/tools/get_details.rb
|
|
138
127
|
- lib/cf/mcp/tools/get_topic.rb
|
|
@@ -145,7 +134,6 @@ files:
|
|
|
145
134
|
- lib/cf/mcp/tools/search_tool.rb
|
|
146
135
|
- lib/cf/mcp/topic_parser.rb
|
|
147
136
|
- lib/cf/mcp/version.rb
|
|
148
|
-
- sig/cf/mcp.rbs
|
|
149
137
|
homepage: https://github.com/pusewicz/cf-mcp
|
|
150
138
|
licenses:
|
|
151
139
|
- MIT
|
|
@@ -161,14 +149,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
161
149
|
requirements:
|
|
162
150
|
- - ">="
|
|
163
151
|
- !ruby/object:Gem::Version
|
|
164
|
-
version: 3.
|
|
152
|
+
version: 3.3.0
|
|
165
153
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
166
154
|
requirements:
|
|
167
155
|
- - ">="
|
|
168
156
|
- !ruby/object:Gem::Version
|
|
169
157
|
version: '0'
|
|
170
158
|
requirements: []
|
|
171
|
-
rubygems_version: 4.0.
|
|
159
|
+
rubygems_version: 4.0.20
|
|
172
160
|
specification_version: 4
|
|
173
161
|
summary: MCP server providing documentation tools for Cute Framework
|
|
174
162
|
test_files: []
|
data/sig/cf/mcp.rbs
DELETED
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
module CF
|
|
2
|
-
module MCP
|
|
3
|
-
VERSION: String
|
|
4
|
-
|
|
5
|
-
def self.root: () -> Pathname
|
|
6
|
-
|
|
7
|
-
class Error < StandardError
|
|
8
|
-
end
|
|
9
|
-
|
|
10
|
-
class Parser
|
|
11
|
-
DOC_BLOCK_PATTERN: Regexp
|
|
12
|
-
TAG_PATTERN: Regexp
|
|
13
|
-
MEMBER_COMMENT_PATTERN: Regexp
|
|
14
|
-
ENTRY_COMMENT_PATTERN: Regexp
|
|
15
|
-
CF_ENUM_PATTERN: Regexp
|
|
16
|
-
SIGNATURE_CLEANUP: Regexp
|
|
17
|
-
END_MARKER_PATTERN: Regexp
|
|
18
|
-
|
|
19
|
-
def parse_file: (String path) -> Array[Models::DocItem]
|
|
20
|
-
def parse_directory: (String path) -> Array[Models::DocItem]
|
|
21
|
-
end
|
|
22
|
-
|
|
23
|
-
class TopicParser
|
|
24
|
-
API_LINK_PATTERN: Regexp
|
|
25
|
-
TOPIC_LINK_PATTERN: Regexp
|
|
26
|
-
SECTION_PATTERN: Regexp
|
|
27
|
-
CATEGORY_MAP: Hash[String, String]
|
|
28
|
-
|
|
29
|
-
def parse_file: (String path) -> Models::TopicDoc?
|
|
30
|
-
def parse_directory: (String path) -> Array[Models::TopicDoc]
|
|
31
|
-
def parse_reading_order: (String index_path) -> Hash[String, Integer]
|
|
32
|
-
end
|
|
33
|
-
|
|
34
|
-
class Index
|
|
35
|
-
attr_reader items: Hash[String, Models::DocItem]
|
|
36
|
-
attr_reader by_type: Hash[Symbol, Array[Models::DocItem]]
|
|
37
|
-
attr_reader by_category: Hash[String, Array[Models::DocItem]]
|
|
38
|
-
attr_reader topic_references: Hash[String, Array[String]]
|
|
39
|
-
|
|
40
|
-
def initialize: () -> void
|
|
41
|
-
def add: (Models::DocItem item) -> void
|
|
42
|
-
def find: (String name) -> Models::DocItem?
|
|
43
|
-
def brief_for: (String name) -> Hash[Symbol, untyped]?
|
|
44
|
-
def search: (String query, ?type: Symbol?, ?category: String?, ?limit: Integer) -> Array[Models::DocItem]
|
|
45
|
-
def functions: () -> Array[Models::DocItem]
|
|
46
|
-
def structs: () -> Array[Models::DocItem]
|
|
47
|
-
def enums: () -> Array[Models::DocItem]
|
|
48
|
-
def topics: () -> Array[Models::DocItem]
|
|
49
|
-
def topics_ordered: () -> Array[Models::DocItem]
|
|
50
|
-
def topics_for: (String api_name) -> Array[Models::DocItem]
|
|
51
|
-
def categories: () -> Array[String]
|
|
52
|
-
def items_in_category: (String category) -> Array[Models::DocItem]
|
|
53
|
-
def size: () -> Integer
|
|
54
|
-
def stats: () -> Hash[Symbol, Integer]
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
class IndexBuilder
|
|
58
|
-
DEFAULT_HEADERS_PATH: String
|
|
59
|
-
|
|
60
|
-
attr_reader headers_path: String
|
|
61
|
-
|
|
62
|
-
def initialize: (?root: String?, ?download: bool) -> void
|
|
63
|
-
def build: () ?{ (Symbol, String, Integer) -> void } -> Index
|
|
64
|
-
def valid?: () -> bool
|
|
65
|
-
end
|
|
66
|
-
|
|
67
|
-
class Downloader
|
|
68
|
-
CUTE_FRAMEWORK_ZIP_URL: String
|
|
69
|
-
DEFAULT_DOWNLOAD_DIR: String
|
|
70
|
-
|
|
71
|
-
class DownloadError < StandardError
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def initialize: (?download_dir: String) -> void
|
|
75
|
-
def download_and_extract: () -> String
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
class CLI
|
|
79
|
-
def initialize: (Array[String] args) -> void
|
|
80
|
-
def run: () -> void
|
|
81
|
-
end
|
|
82
|
-
|
|
83
|
-
class Server
|
|
84
|
-
attr_reader server: untyped
|
|
85
|
-
attr_reader index: Index
|
|
86
|
-
|
|
87
|
-
TOOLS: Array[Class]
|
|
88
|
-
CORS_HEADERS: Hash[String, String]
|
|
89
|
-
|
|
90
|
-
def self.build_rack_app: (?root: String?, ?download: bool) -> untyped
|
|
91
|
-
def initialize: (Index index) -> void
|
|
92
|
-
def run_stdio: () -> void
|
|
93
|
-
def rack_app: () -> untyped
|
|
94
|
-
|
|
95
|
-
class TemplateContext
|
|
96
|
-
TEMPLATES_DIR: String
|
|
97
|
-
|
|
98
|
-
attr_reader version: String
|
|
99
|
-
attr_reader stats: Hash[Symbol, Integer]
|
|
100
|
-
attr_reader categories: Array[String]
|
|
101
|
-
attr_reader topics: Array[Hash[Symbol, String?]]
|
|
102
|
-
attr_reader tools: Array[Hash[Symbol, String]]
|
|
103
|
-
attr_reader tool_schemas_json: String
|
|
104
|
-
|
|
105
|
-
def initialize: (version: String, stats: Hash[Symbol, Integer], categories: Array[String], topics: Array[Hash[Symbol, String?]], tools: Array[Hash[Symbol, String]], tool_schemas_json: String) -> void
|
|
106
|
-
def categories_json: () -> String
|
|
107
|
-
def topics_json: () -> String
|
|
108
|
-
def css_content: () -> String
|
|
109
|
-
def changelog_content: () -> String
|
|
110
|
-
def changelog_json: () -> String
|
|
111
|
-
def js_content: () -> String
|
|
112
|
-
def h: (untyped text) -> String
|
|
113
|
-
def get_binding: () -> Binding
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
|
|
117
|
-
module Models
|
|
118
|
-
class DocItem
|
|
119
|
-
GITHUB_REPO: String
|
|
120
|
-
GITHUB_RAW_BASE: String
|
|
121
|
-
|
|
122
|
-
attr_accessor name: String?
|
|
123
|
-
attr_accessor type: Symbol?
|
|
124
|
-
attr_accessor category: String?
|
|
125
|
-
attr_accessor brief: String?
|
|
126
|
-
attr_accessor remarks: String?
|
|
127
|
-
attr_accessor example: String?
|
|
128
|
-
attr_accessor example_brief: String?
|
|
129
|
-
attr_accessor related: Array[String]
|
|
130
|
-
attr_accessor source_file: String?
|
|
131
|
-
attr_accessor source_line: Integer?
|
|
132
|
-
|
|
133
|
-
def initialize: (?name: String?, ?type: Symbol?, ?category: String?, ?brief: String?, ?remarks: String?, ?example: String?, ?example_brief: String?, ?related: Array[String], ?source_file: String?, ?source_line: Integer?) -> void
|
|
134
|
-
def matches?: (String? query) -> bool
|
|
135
|
-
def relevance_score: (String? query) -> Integer
|
|
136
|
-
def source_urls: () -> Hash[Symbol, String]?
|
|
137
|
-
def to_h: () -> Hash[Symbol, untyped]
|
|
138
|
-
def to_summary: () -> String
|
|
139
|
-
def to_text: (?detailed: bool, ?index: Index?) -> String
|
|
140
|
-
def format_related_items: (Index? index) -> String
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
class FunctionDoc < DocItem
|
|
144
|
-
attr_accessor signature: String?
|
|
145
|
-
attr_accessor parameters: Array[Parameter]
|
|
146
|
-
attr_accessor return_value: String?
|
|
147
|
-
|
|
148
|
-
class Parameter < Data
|
|
149
|
-
attr_reader name: String
|
|
150
|
-
attr_reader description: String
|
|
151
|
-
end
|
|
152
|
-
|
|
153
|
-
def initialize: (?signature: String?, ?parameters: Array[Parameter], ?return_value: String?, **untyped) -> void
|
|
154
|
-
def to_h: () -> Hash[Symbol, untyped]
|
|
155
|
-
def to_summary: () -> String
|
|
156
|
-
def to_text: (?detailed: bool, ?index: Index?) -> String
|
|
157
|
-
end
|
|
158
|
-
|
|
159
|
-
class StructDoc < DocItem
|
|
160
|
-
attr_accessor members: Array[Member]
|
|
161
|
-
|
|
162
|
-
class Member < Data
|
|
163
|
-
attr_reader declaration: String
|
|
164
|
-
attr_reader description: String
|
|
165
|
-
end
|
|
166
|
-
|
|
167
|
-
def initialize: (?members: Array[Member], **untyped) -> void
|
|
168
|
-
def to_h: () -> Hash[Symbol, untyped]
|
|
169
|
-
end
|
|
170
|
-
|
|
171
|
-
class EnumDoc < DocItem
|
|
172
|
-
attr_accessor entries: Array[Entry]
|
|
173
|
-
|
|
174
|
-
class Entry < Data
|
|
175
|
-
attr_reader name: String
|
|
176
|
-
attr_reader value: String
|
|
177
|
-
attr_reader description: String
|
|
178
|
-
end
|
|
179
|
-
|
|
180
|
-
def initialize: (?entries: Array[Entry], **untyped) -> void
|
|
181
|
-
def to_h: () -> Hash[Symbol, untyped]
|
|
182
|
-
end
|
|
183
|
-
|
|
184
|
-
class TopicDoc < DocItem
|
|
185
|
-
attr_accessor content: String?
|
|
186
|
-
attr_accessor sections: Array[Section]
|
|
187
|
-
attr_accessor function_references: Array[String]
|
|
188
|
-
attr_accessor struct_references: Array[String]
|
|
189
|
-
attr_accessor enum_references: Array[String]
|
|
190
|
-
attr_accessor topic_references: Array[String]
|
|
191
|
-
attr_accessor reading_order: Integer?
|
|
192
|
-
|
|
193
|
-
class Section < Data
|
|
194
|
-
attr_reader title: String
|
|
195
|
-
attr_reader content: String
|
|
196
|
-
end
|
|
197
|
-
|
|
198
|
-
def initialize: (?content: String?, ?sections: Array[Section], ?function_references: Array[String], ?struct_references: Array[String], ?enum_references: Array[String], ?topic_references: Array[String], ?reading_order: Integer?, **untyped) -> void
|
|
199
|
-
def all_api_references: () -> Array[String]
|
|
200
|
-
def to_h: () -> Hash[Symbol, untyped]
|
|
201
|
-
def to_summary: () -> String
|
|
202
|
-
def to_text: (?detailed: bool, ?index: Index?) -> String
|
|
203
|
-
end
|
|
204
|
-
end
|
|
205
|
-
|
|
206
|
-
module Tools
|
|
207
|
-
module ResponseHelpers
|
|
208
|
-
def text_response: (String text) -> untyped
|
|
209
|
-
def error_response: (String message) -> untyped
|
|
210
|
-
end
|
|
211
|
-
|
|
212
|
-
module SearchResultFormatter
|
|
213
|
-
def format_search_results: (Array[Models::DocItem] results, query: String, type_label: String, limit: Integer, details_tip: String, ?filter_suggestion: String?) -> String
|
|
214
|
-
end
|
|
215
|
-
|
|
216
|
-
class SearchTool
|
|
217
|
-
extend ResponseHelpers
|
|
218
|
-
extend SearchResultFormatter
|
|
219
|
-
|
|
220
|
-
DETAILS_TIP: String
|
|
221
|
-
|
|
222
|
-
def self.call: (query: String, ?type: String?, ?category: String?, ?limit: Integer, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
223
|
-
end
|
|
224
|
-
|
|
225
|
-
class SearchFunctions
|
|
226
|
-
extend ResponseHelpers
|
|
227
|
-
extend SearchResultFormatter
|
|
228
|
-
|
|
229
|
-
DETAILS_TIP: String
|
|
230
|
-
|
|
231
|
-
def self.call: (query: String, ?category: String?, ?limit: Integer, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
232
|
-
end
|
|
233
|
-
|
|
234
|
-
class SearchStructs
|
|
235
|
-
extend ResponseHelpers
|
|
236
|
-
extend SearchResultFormatter
|
|
237
|
-
|
|
238
|
-
DETAILS_TIP: String
|
|
239
|
-
|
|
240
|
-
def self.call: (query: String, ?category: String?, ?limit: Integer, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
241
|
-
end
|
|
242
|
-
|
|
243
|
-
class SearchEnums
|
|
244
|
-
extend ResponseHelpers
|
|
245
|
-
extend SearchResultFormatter
|
|
246
|
-
|
|
247
|
-
DETAILS_TIP: String
|
|
248
|
-
|
|
249
|
-
def self.call: (query: String, ?category: String?, ?limit: Integer, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
250
|
-
end
|
|
251
|
-
|
|
252
|
-
class ListCategory
|
|
253
|
-
extend ResponseHelpers
|
|
254
|
-
|
|
255
|
-
def self.call: (?category: String?, ?type: String?, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
256
|
-
end
|
|
257
|
-
|
|
258
|
-
class GetDetails
|
|
259
|
-
extend ResponseHelpers
|
|
260
|
-
|
|
261
|
-
NAMING_TIP: String
|
|
262
|
-
|
|
263
|
-
def self.call: (name: String, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
264
|
-
end
|
|
265
|
-
|
|
266
|
-
class FindRelated
|
|
267
|
-
extend ResponseHelpers
|
|
268
|
-
|
|
269
|
-
def self.call: (name: String, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
270
|
-
end
|
|
271
|
-
|
|
272
|
-
class ParameterSearch
|
|
273
|
-
extend ResponseHelpers
|
|
274
|
-
|
|
275
|
-
def self.call: (type: String, ?direction: String, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
276
|
-
end
|
|
277
|
-
|
|
278
|
-
class MemberSearch
|
|
279
|
-
extend ResponseHelpers
|
|
280
|
-
|
|
281
|
-
def self.call: (query: String, ?limit: Integer, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
282
|
-
end
|
|
283
|
-
|
|
284
|
-
class ListTopics
|
|
285
|
-
extend ResponseHelpers
|
|
286
|
-
|
|
287
|
-
CATEGORY_TIP: String
|
|
288
|
-
|
|
289
|
-
def self.call: (?category: String?, ?ordered: bool, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
290
|
-
end
|
|
291
|
-
|
|
292
|
-
class GetTopic
|
|
293
|
-
extend ResponseHelpers
|
|
294
|
-
|
|
295
|
-
def self.call: (name: String, ?server_context: Hash[Symbol, untyped]) -> untyped
|
|
296
|
-
end
|
|
297
|
-
end
|
|
298
|
-
end
|
|
299
|
-
end
|