@nevzatcirak/review-mcp 1.0.0-rc.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nevzat Çırak
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/NOTICE ADDED
@@ -0,0 +1,93 @@
1
+ review-mcp
2
+ Copyright (c) 2026 Nevzat Çırak
3
+
4
+ This project is licensed under the MIT License (see LICENSE).
5
+
6
+ Attribution
7
+ -----------
8
+
9
+ Parts of the design of review-mcp are derived from PR-Agent
10
+ (https://github.com/The-PR-Agent/pr-agent), an open-source, AI-powered code
11
+ review agent, licensed under the MIT License. In particular:
12
+
13
+ - the pull-request diff compression strategy (file ranking, hunk context
14
+ expansion, token-budget clipping, large-PR handling),
15
+ - the token budgeting approach,
16
+ - the per-tool prompt design and structured output schemas for review and
17
+ question-answering tools.
18
+
19
+ review-mcp is an independent reimplementation in Go. No PR-Agent source code
20
+ is included in this repository; the logic, prompt design, and schemas were
21
+ studied and ported (see docs/research/pr-agent-porting-map.md for the pinned
22
+ upstream revision used during the study).
23
+
24
+ Many thanks to the PR-Agent authors, maintainers, and community.
25
+
26
+ PR-Agent license
27
+ ----------------
28
+
29
+ Material adapted from PR-Agent is included in this repository (see the list
30
+ below). PR-Agent's license notice follows, verbatim:
31
+
32
+ MIT License
33
+
34
+ Copyright (c) 2026 The PR Agent
35
+
36
+ Permission is hereby granted, free of charge, to any person obtaining a copy
37
+ of this software and associated documentation files (the "Software"), to deal
38
+ in the Software without restriction, including without limitation the rights
39
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40
+ copies of the Software, and to permit persons to whom the Software is
41
+ furnished to do so, subject to the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be included in all
44
+ copies or substantial portions of the Software.
45
+
46
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
49
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
51
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
52
+ SOFTWARE.
53
+
54
+ Files containing material adapted from PR-Agent
55
+ -----------------------------------------------
56
+
57
+ Pinned upstream: https://github.com/The-PR-Agent/pr-agent at commit
58
+ 8e5a9295973b24af4b70cafd0b660a230811ef9e (tag v0.47.0). Add one line per file
59
+ as new adapted material lands.
60
+
61
+ - internal/filter/data/generated_code.go
62
+ - internal/filter/data/bad_extensions.go
63
+ - internal/filter/data/languages.go
64
+ - internal/filter/data/auto_generated.go
65
+ - internal/patch/literals.go
66
+ - internal/patch/testdata/upstream/ (golden outputs generated by running upstream)
67
+ - internal/diffpipe/testdata/upstream/ (golden outputs generated by running upstream)
68
+ - internal/patch/testdata/deviations/ (upstream-derived golden outputs with documented intentional deviations)
69
+ - internal/yamlrepair/testdata/cases/ (YAML repair fixtures: inputs of upstream's unit tests and golden outputs generated by running upstream)
70
+ - internal/prompt/language.go (output-language instruction)
71
+ - internal/review/prompts/system.tmpl
72
+ - internal/review/prompts/user.tmpl
73
+ - internal/review/fields.go (review schema descriptions and example)
74
+ - internal/review/testdata/prompts/ (upstream prompt renderings generated by running upstream)
75
+ - internal/ask/prompts/system.tmpl
76
+ - internal/ask/prompts/user.tmpl
77
+ - internal/ask/testdata/prompts/ (upstream prompt renderings generated by running upstream)
78
+ - internal/review/render/provider.go (emoji map and table / details presentation of the provider profile)
79
+ - internal/review/render/testdata/ (golden renderings; the gitea_* files follow upstream's review presentation)
80
+ - internal/ask/render/render.go (the question and answer headings of the Gitea provider profile and the quick-action sanitization of the published text)
81
+
82
+ Tokenizer vocabulary (third-party data)
83
+ ---------------------------------------
84
+
85
+ review-mcp links the Go module tiktoken-go/tokenizer (MIT License, see
86
+ THIRD_PARTY_LICENSES), which embeds the o200k_base byte-pair-encoding
87
+ vocabulary as Go data. That module generates the vocabulary from the file
88
+ published by OpenAI at
89
+ https://openaipublic.blob.core.windows.net/encodings/o200k_base.tiktoken
90
+ (see internal/cmd/vocab.go in the module). The module's MIT license covers
91
+ its own code; it does not state a license for the vocabulary data, which
92
+ originates from OpenAI's tiktoken project (MIT License, Copyright (c) 2022
93
+ OpenAI, Shantanu Jain). The vocabulary is used only to estimate token counts.
package/README.md ADDED
@@ -0,0 +1,108 @@
1
+ # review-mcp
2
+
3
+ `review-mcp` is a standalone, open-source (MIT) MCP server written in Go that
4
+ brings AI-powered pull-request tools to any MCP client, such as Claude Code and
5
+ opencode. It reviews a pull request with `pr_review`, answers questions about
6
+ one with `pr_ask`, and reads and replies to comment threads. It targets Gitea
7
+ and Bitbucket Server (Data Center) first, with GitHub planned for later, and
8
+ works with any OpenAI-compatible LLM endpoint. Identity is per user: provider
9
+ tokens and the LLM API key come from the MCP client configuration (as
10
+ environment variables over stdio, the default, or as HTTP headers in `serve`
11
+ mode), are never logged and are never persisted. There is no telemetry and there
12
+ are no embedded defaults for URLs or endpoints: everything comes from your
13
+ configuration.
14
+
15
+ **Status: release candidate.** v1.0.0-rc.1 is being validated before v1.0.0;
16
+ see the [changelog](CHANGELOG.md).
17
+
18
+ ## Quick start
19
+
20
+ 1. Create a read-only token on your provider and note your LLM endpoint
21
+ ([Setup guide, steps 2 and 3](docs/setup.md#2-create-tokens)).
22
+ 2. Register the server with your client. With npm there is nothing to install.
23
+
24
+ **Claude Code**
25
+
26
+ ```sh
27
+ claude mcp add review-mcp \
28
+ --env REVIEW_MCP_LLM_BASE_URL=https://llm.example.com/v1 \
29
+ --env REVIEW_MCP_LLM_MODEL=your-model-name \
30
+ --env REVIEW_MCP_LLM_CONTEXT_WINDOW=32000 \
31
+ --env REVIEW_MCP_GITEA_BASE_URL=https://your-gitea.example \
32
+ --env REVIEW_MCP_LLM_API_KEY="$REVIEW_MCP_LLM_API_KEY" \
33
+ --env REVIEW_MCP_GITEA_TOKEN="$REVIEW_MCP_GITEA_TOKEN" \
34
+ -- npx -y @nevzatcirak/review-mcp
35
+ ```
36
+
37
+ **opencode** (`opencode.json`)
38
+
39
+ ```json
40
+ {
41
+ "$schema": "https://opencode.ai/config.json",
42
+ "mcp": {
43
+ "review-mcp": {
44
+ "type": "local",
45
+ "command": ["npx", "-y", "@nevzatcirak/review-mcp"],
46
+ "enabled": true,
47
+ "environment": {
48
+ "REVIEW_MCP_LLM_BASE_URL": "https://llm.example.com/v1",
49
+ "REVIEW_MCP_LLM_MODEL": "your-model-name",
50
+ "REVIEW_MCP_LLM_CONTEXT_WINDOW": "32000",
51
+ "REVIEW_MCP_LLM_API_KEY": "{env:REVIEW_MCP_LLM_API_KEY}",
52
+ "REVIEW_MCP_GITEA_BASE_URL": "https://your-gitea.example",
53
+ "REVIEW_MCP_GITEA_TOKEN": "{env:REVIEW_MCP_GITEA_TOKEN}"
54
+ }
55
+ }
56
+ }
57
+ }
58
+ ```
59
+
60
+ 3. Ask the client to call `server_info`, then to review a pull request without
61
+ publishing it. The [Setup guide](docs/setup.md) walks through the first run,
62
+ keeps tokens out of files, and covers Bitbucket Server, release archives and
63
+ `go install`.
64
+
65
+ ## Tools
66
+
67
+ | Tool | What it does |
68
+ |---|---|
69
+ | `server_info` | Version, enabled providers and the effective non-secret configuration; secrets show only as set or unset. |
70
+ | `pr_comments` | Lists a pull request's comment threads. |
71
+ | `pr_comment_reply` | Replies to a pull request comment (inside the thread on Bitbucket Server; as a quoting PR-level comment on Gitea). |
72
+ | `pr_review` | Reviews a pull request with your LLM. The title, description and diff are sent to your LLM endpoint. Optionally publishes the review as a PR comment. |
73
+ | `pr_ask` | Answers a free-text question about a pull request, grounded in its title, description and diff. Optionally publishes the question and answer as a PR comment. |
74
+
75
+ ## Documentation
76
+
77
+ - [Setup guide](docs/setup.md): install, token checklist, LLM endpoint, client configuration, first run.
78
+ - [Serve mode](docs/serve.md): one shared HTTP server for a team, the header contract, TLS, the container.
79
+ - [Reviewing pull requests](docs/review.md): what `pr_review` sends to the LLM, choosing `llm.context_window`, reading coverage and notes, `publish`, `diag review --dry-run`.
80
+ - [Asking questions about a pull request](docs/ask.md): what `pr_ask` sends to the LLM, grounding and honesty, coverage, `publish` and the slash sanitization, `diag ask --dry-run`.
81
+ - [Getting started](docs/getting-started.md): the minimal configuration and the diff budget in detail.
82
+ - [Troubleshooting](docs/troubleshooting.md): the `diag` commands and every error sentence.
83
+ - [Changelog](CHANGELOG.md).
84
+
85
+ ## Attribution
86
+
87
+ The design is inspired by [PR-Agent](https://github.com/The-PR-Agent/pr-agent)
88
+ (MIT). The review and question prompt templates, the YAML repair fixtures and
89
+ parts of the review and answer output presentation are adapted from PR-Agent; [NOTICE](NOTICE)
90
+ lists every adapted file and carries PR-Agent's license. See it for details on
91
+ what was derived and
92
+ `docs/research/pr-agent-porting-map.md` for the pinned upstream revision
93
+ studied during the porting research.
94
+
95
+ ## License
96
+
97
+ MIT — see [LICENSE](LICENSE).
98
+
99
+ ## Development
100
+
101
+ Requires Go 1.26 or newer and [golangci-lint](https://golangci-lint.run/) v2.14.0 or newer (v2.x releases built with Go 1.26+; older ones refuse to lint a Go 1.26 module).
102
+
103
+ ```sh
104
+ make build # build ./review-mcp with version/commit embedded
105
+ make test # go test -race ./...
106
+ make lint # golangci-lint run ./...
107
+ make fmt # gofmt -w .
108
+ ```
@@ -0,0 +1,732 @@
1
+ THIRD-PARTY LICENSES
2
+
3
+ review-mcp is distributed with the Go modules listed below, linked into the
4
+ binary. Each section gives the module path, version, SPDX license id and the
5
+ full license and notice texts shipped by the module. This file is generated by
6
+ tools/licensebundle; do not edit it by hand.
7
+
8
+ Modules (15):
9
+ github.com/BurntSushi/toml v1.6.0 (MIT)
10
+ github.com/bmatcuk/doublestar/v4 v4.10.2 (MIT)
11
+ github.com/dlclark/regexp2/v2 v2.5.1 (MIT)
12
+ github.com/google/jsonschema-go v0.4.3 (MIT)
13
+ github.com/modelcontextprotocol/go-sdk v1.8.0 (Apache-2.0 AND MIT)
14
+ github.com/pmezard/go-difflib v1.0.0 (BSD-3-Clause)
15
+ github.com/segmentio/asm v1.1.3 (MIT)
16
+ github.com/segmentio/encoding v0.5.4 (MIT)
17
+ github.com/tiktoken-go/tokenizer v0.8.1 (MIT)
18
+ github.com/yosida95/uritemplate/v3 v3.0.2 (BSD-3-Clause)
19
+ golang.org/x/oauth2 v0.35.0 (BSD-3-Clause)
20
+ golang.org/x/sync v0.20.0 (BSD-3-Clause)
21
+ golang.org/x/sys v0.41.0 (BSD-3-Clause)
22
+ golang.org/x/time v0.15.0 (BSD-3-Clause)
23
+ gopkg.in/yaml.v3 v3.0.1 (MIT AND Apache-2.0)
24
+
25
+ ================================================================================
26
+ Module: github.com/BurntSushi/toml
27
+ Version: v1.6.0
28
+ License: MIT
29
+
30
+ --- COPYING ---
31
+
32
+ The MIT License (MIT)
33
+
34
+ Copyright (c) 2013 TOML authors
35
+
36
+ Permission is hereby granted, free of charge, to any person obtaining a copy
37
+ of this software and associated documentation files (the "Software"), to deal
38
+ in the Software without restriction, including without limitation the rights
39
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
40
+ copies of the Software, and to permit persons to whom the Software is
41
+ furnished to do so, subject to the following conditions:
42
+
43
+ The above copyright notice and this permission notice shall be included in
44
+ all copies or substantial portions of the Software.
45
+
46
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
47
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
48
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
49
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
50
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
51
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
52
+ THE SOFTWARE.
53
+
54
+ ================================================================================
55
+ Module: github.com/bmatcuk/doublestar/v4
56
+ Version: v4.10.2
57
+ License: MIT
58
+
59
+ --- LICENSE ---
60
+
61
+ The MIT License (MIT)
62
+
63
+ Copyright (c) 2014 Bob Matcuk
64
+
65
+ Permission is hereby granted, free of charge, to any person obtaining a copy
66
+ of this software and associated documentation files (the "Software"), to deal
67
+ in the Software without restriction, including without limitation the rights
68
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
69
+ copies of the Software, and to permit persons to whom the Software is
70
+ furnished to do so, subject to the following conditions:
71
+
72
+ The above copyright notice and this permission notice shall be included in all
73
+ copies or substantial portions of the Software.
74
+
75
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
76
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
77
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
78
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
79
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
80
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
81
+ SOFTWARE.
82
+
83
+ ================================================================================
84
+ Module: github.com/dlclark/regexp2/v2
85
+ Version: v2.5.1
86
+ License: MIT
87
+
88
+ --- LICENSE ---
89
+
90
+ The MIT License (MIT)
91
+
92
+ Copyright (c) Doug Clark
93
+
94
+ Permission is hereby granted, free of charge, to any person obtaining a copy
95
+ of this software and associated documentation files (the "Software"), to deal
96
+ in the Software without restriction, including without limitation the rights
97
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
98
+ copies of the Software, and to permit persons to whom the Software is
99
+ furnished to do so, subject to the following conditions:
100
+
101
+ The above copyright notice and this permission notice shall be included in all
102
+ copies or substantial portions of the Software.
103
+
104
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
105
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
106
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
107
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
108
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
109
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
110
+ SOFTWARE.
111
+
112
+ ================================================================================
113
+ Module: github.com/google/jsonschema-go
114
+ Version: v0.4.3
115
+ License: MIT
116
+
117
+ --- LICENSE ---
118
+
119
+ MIT License
120
+
121
+ Copyright (c) 2025 JSON Schema Go Project Authors
122
+
123
+ Permission is hereby granted, free of charge, to any person obtaining a copy
124
+ of this software and associated documentation files (the "Software"), to deal
125
+ in the Software without restriction, including without limitation the rights
126
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
127
+ copies of the Software, and to permit persons to whom the Software is
128
+ furnished to do so, subject to the following conditions:
129
+
130
+ The above copyright notice and this permission notice shall be included in all
131
+ copies or substantial portions of the Software.
132
+
133
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
134
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
135
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
136
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
137
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
138
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
139
+ SOFTWARE.
140
+
141
+ ================================================================================
142
+ Module: github.com/modelcontextprotocol/go-sdk
143
+ Version: v1.8.0
144
+ License: Apache-2.0 AND MIT
145
+
146
+ --- LICENSE ---
147
+
148
+ The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0.
149
+
150
+ Contributions for which relicensing consent has been obtained are licensed under Apache-2.0. Contributions made by authors who originally licensed their work under the MIT License and who have not yet granted explicit permission to relicense remain licensed under the MIT License.
151
+
152
+ No rights beyond those granted by the applicable original license are conveyed for such contributions.
153
+
154
+ ---
155
+
156
+ Apache License
157
+ Version 2.0, January 2004
158
+ http://www.apache.org/licenses/
159
+
160
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
161
+
162
+ 1. Definitions.
163
+
164
+ "License" shall mean the terms and conditions for use, reproduction,
165
+ and distribution as defined by Sections 1 through 9 of this document.
166
+
167
+ "Licensor" shall mean the copyright owner or entity authorized by
168
+ the copyright owner that is granting the License.
169
+
170
+ "Legal Entity" shall mean the union of the acting entity and all
171
+ other entities that control, are controlled by, or are under common
172
+ control with that entity. For the purposes of this definition,
173
+ "control" means (i) the power, direct or indirect, to cause the
174
+ direction or management of such entity, whether by contract or
175
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
176
+ outstanding shares, or (iii) beneficial ownership of such entity.
177
+
178
+ "You" (or "Your") shall mean an individual or Legal Entity
179
+ exercising permissions granted by this License.
180
+
181
+ "Source" form shall mean the preferred form for making modifications,
182
+ including but not limited to software source code, documentation
183
+ source, and configuration files.
184
+
185
+ "Object" form shall mean any form resulting from mechanical
186
+ transformation or translation of a Source form, including but
187
+ not limited to compiled object code, generated documentation,
188
+ and conversions to other media types.
189
+
190
+ "Work" shall mean the work of authorship, whether in Source or
191
+ Object form, made available under the License, as indicated by a
192
+ copyright notice that is included in or attached to the work
193
+ (an example is provided in the Appendix below).
194
+
195
+ "Derivative Works" shall mean any work, whether in Source or Object
196
+ form, that is based on (or derived from) the Work and for which the
197
+ editorial revisions, annotations, elaborations, or other modifications
198
+ represent, as a whole, an original work of authorship. For the purposes
199
+ of this License, Derivative Works shall not include works that remain
200
+ separable from, or merely link (or bind by name) to the interfaces of,
201
+ the Work and Derivative Works thereof.
202
+
203
+ "Contribution" shall mean any work of authorship, including
204
+ the original version of the Work and any modifications or additions
205
+ to that Work or Derivative Works thereof, that is intentionally
206
+ submitted to Licensor for inclusion in the Work by the copyright
207
+ owner or by an individual or Legal Entity authorized to submit on behalf
208
+ of the copyright owner. For the purposes of this definition, "submitted"
209
+ means any form of electronic, verbal, or written communication sent
210
+ to the Licensor or its representatives, including but not limited to
211
+ communication on electronic mailing lists, source code control systems,
212
+ and issue tracking systems that are managed by, or on behalf of, the
213
+ Licensor for the purpose of discussing and improving the Work, but
214
+ excluding communication that is conspicuously marked or otherwise
215
+ designated in writing by the copyright owner as "Not a Contribution."
216
+
217
+ "Contributor" shall mean Licensor and any individual or Legal Entity
218
+ on behalf of whom a Contribution has been received by Licensor and
219
+ subsequently incorporated within the Work.
220
+
221
+ 2. Grant of Copyright License. Subject to the terms and conditions of
222
+ this License, each Contributor hereby grants to You a perpetual,
223
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
224
+ copyright license to reproduce, prepare Derivative Works of,
225
+ publicly display, publicly perform, sublicense, and distribute the
226
+ Work and such Derivative Works in Source or Object form.
227
+
228
+ 3. Grant of Patent License. Subject to the terms and conditions of
229
+ this License, each Contributor hereby grants to You a perpetual,
230
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
231
+ (except as stated in this section) patent license to make, have made,
232
+ use, offer to sell, sell, import, and otherwise transfer the Work,
233
+ where such license applies only to those patent claims licensable
234
+ by such Contributor that are necessarily infringed by their
235
+ Contribution(s) alone or by combination of their Contribution(s)
236
+ with the Work to which such Contribution(s) was submitted. If You
237
+ institute patent litigation against any entity (including a
238
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
239
+ or a Contribution incorporated within the Work constitutes direct
240
+ or contributory patent infringement, then any patent licenses
241
+ granted to You under this License for that Work shall terminate
242
+ as of the date such litigation is filed.
243
+
244
+ 4. Redistribution. You may reproduce and distribute copies of the
245
+ Work or Derivative Works thereof in any medium, with or without
246
+ modifications, and in Source or Object form, provided that You
247
+ meet the following conditions:
248
+
249
+ (a) You must give any other recipients of the Work or
250
+ Derivative Works a copy of this License; and
251
+
252
+ (b) You must cause any modified files to carry prominent notices
253
+ stating that You changed the files; and
254
+
255
+ (c) You must retain, in the Source form of any Derivative Works
256
+ that You distribute, all copyright, patent, trademark, and
257
+ attribution notices from the Source form of the Work,
258
+ excluding those notices that do not pertain to any part of
259
+ the Derivative Works; and
260
+
261
+ (d) If the Work includes a "NOTICE" text file as part of its
262
+ distribution, then any Derivative Works that You distribute must
263
+ include a readable copy of the attribution notices contained
264
+ within such NOTICE file, excluding those notices that do not
265
+ pertain to any part of the Derivative Works, in at least one
266
+ of the following places: within a NOTICE text file distributed
267
+ as part of the Derivative Works; within the Source form or
268
+ documentation, if provided along with the Derivative Works; or,
269
+ within a display generated by the Derivative Works, if and
270
+ wherever such third-party notices normally appear. The contents
271
+ of the NOTICE file are for informational purposes only and
272
+ do not modify the License. You may add Your own attribution
273
+ notices within Derivative Works that You distribute, alongside
274
+ or as an addendum to the NOTICE text from the Work, provided
275
+ that such additional attribution notices cannot be construed
276
+ as modifying the License.
277
+
278
+ You may add Your own copyright statement to Your modifications and
279
+ may provide additional or different license terms and conditions
280
+ for use, reproduction, or distribution of Your modifications, or
281
+ for any such Derivative Works as a whole, provided Your use,
282
+ reproduction, and distribution of the Work otherwise complies with
283
+ the conditions stated in this License.
284
+
285
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
286
+ any Contribution intentionally submitted for inclusion in the Work
287
+ by You to the Licensor shall be under the terms and conditions of
288
+ this License, without any additional terms or conditions.
289
+ Notwithstanding the above, nothing herein shall supersede or modify
290
+ the terms of any separate license agreement you may have executed
291
+ with Licensor regarding such Contributions.
292
+
293
+ 6. Trademarks. This License does not grant permission to use the trade
294
+ names, trademarks, service marks, or product names of the Licensor,
295
+ except as required for reasonable and customary use in describing the
296
+ origin of the Work and reproducing the content of the NOTICE file.
297
+
298
+ 7. Disclaimer of Warranty. Unless required by applicable law or
299
+ agreed to in writing, Licensor provides the Work (and each
300
+ Contributor provides its Contributions) on an "AS IS" BASIS,
301
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
302
+ implied, including, without limitation, any warranties or conditions
303
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
304
+ PARTICULAR PURPOSE. You are solely responsible for determining the
305
+ appropriateness of using or redistributing the Work and assume any
306
+ risks associated with Your exercise of permissions under this License.
307
+
308
+ 8. Limitation of Liability. In no event and under no legal theory,
309
+ whether in tort (including negligence), contract, or otherwise,
310
+ unless required by applicable law (such as deliberate and grossly
311
+ negligent acts) or agreed to in writing, shall any Contributor be
312
+ liable to You for damages, including any direct, indirect, special,
313
+ incidental, or consequential damages of any character arising as a
314
+ result of this License or out of the use or inability to use the
315
+ Work (including but not limited to damages for loss of goodwill,
316
+ work stoppage, computer failure or malfunction, or any and all
317
+ other commercial damages or losses), even if such Contributor
318
+ has been advised of the possibility of such damages.
319
+
320
+ 9. Accepting Warranty or Additional Liability. While redistributing
321
+ the Work or Derivative Works thereof, You may choose to offer,
322
+ and charge a fee for, acceptance of support, warranty, indemnity,
323
+ or other liability obligations and/or rights consistent with this
324
+ License. However, in accepting such obligations, You may act only
325
+ on Your own behalf and on Your sole responsibility, not on behalf
326
+ of any other Contributor, and only if You agree to indemnify,
327
+ defend, and hold each Contributor harmless for any liability
328
+ incurred by, or claims asserted against, such Contributor by reason
329
+ of your accepting any such warranty or additional liability.
330
+
331
+ END OF TERMS AND CONDITIONS
332
+
333
+ ---
334
+
335
+ MIT License
336
+
337
+ Copyright (c) 2024-2025 Model Context Protocol a Series of LF Projects, LLC.
338
+
339
+ Permission is hereby granted, free of charge, to any person obtaining a copy
340
+ of this software and associated documentation files (the "Software"), to deal
341
+ in the Software without restriction, including without limitation the rights
342
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
343
+ copies of the Software, and to permit persons to whom the Software is
344
+ furnished to do so, subject to the following conditions:
345
+
346
+ The above copyright notice and this permission notice shall be included in all
347
+ copies or substantial portions of the Software.
348
+
349
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
350
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
351
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
352
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
353
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
354
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
355
+ SOFTWARE.
356
+
357
+ ---
358
+
359
+ Creative Commons Attribution 4.0 International (CC-BY-4.0)
360
+
361
+ Documentation in this project (excluding specifications) is licensed under
362
+ CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for
363
+ the full license text.
364
+
365
+ ================================================================================
366
+ Module: github.com/pmezard/go-difflib
367
+ Version: v1.0.0
368
+ License: BSD-3-Clause
369
+
370
+ --- LICENSE ---
371
+
372
+ Copyright (c) 2013, Patrick Mezard
373
+ All rights reserved.
374
+
375
+ Redistribution and use in source and binary forms, with or without
376
+ modification, are permitted provided that the following conditions are
377
+ met:
378
+
379
+ Redistributions of source code must retain the above copyright
380
+ notice, this list of conditions and the following disclaimer.
381
+ Redistributions in binary form must reproduce the above copyright
382
+ notice, this list of conditions and the following disclaimer in the
383
+ documentation and/or other materials provided with the distribution.
384
+ The names of its contributors may not be used to endorse or promote
385
+ products derived from this software without specific prior written
386
+ permission.
387
+
388
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
389
+ IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
390
+ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
391
+ PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
392
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
393
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
394
+ TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
395
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
396
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
397
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
398
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
399
+
400
+ ================================================================================
401
+ Module: github.com/segmentio/asm
402
+ Version: v1.1.3
403
+ License: MIT
404
+
405
+ --- LICENSE ---
406
+
407
+ MIT License
408
+
409
+ Copyright (c) 2021 Segment
410
+
411
+ Permission is hereby granted, free of charge, to any person obtaining a copy
412
+ of this software and associated documentation files (the "Software"), to deal
413
+ in the Software without restriction, including without limitation the rights
414
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
415
+ copies of the Software, and to permit persons to whom the Software is
416
+ furnished to do so, subject to the following conditions:
417
+
418
+ The above copyright notice and this permission notice shall be included in all
419
+ copies or substantial portions of the Software.
420
+
421
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
422
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
423
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
424
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
425
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
426
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
427
+ SOFTWARE.
428
+
429
+ ================================================================================
430
+ Module: github.com/segmentio/encoding
431
+ Version: v0.5.4
432
+ License: MIT
433
+
434
+ --- LICENSE ---
435
+
436
+ MIT License
437
+
438
+ Copyright (c) 2019 Segment.io, Inc.
439
+
440
+ Permission is hereby granted, free of charge, to any person obtaining a copy
441
+ of this software and associated documentation files (the "Software"), to deal
442
+ in the Software without restriction, including without limitation the rights
443
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
444
+ copies of the Software, and to permit persons to whom the Software is
445
+ furnished to do so, subject to the following conditions:
446
+
447
+ The above copyright notice and this permission notice shall be included in all
448
+ copies or substantial portions of the Software.
449
+
450
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
451
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
452
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
453
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
454
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
455
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
456
+ SOFTWARE.
457
+
458
+ ================================================================================
459
+ Module: github.com/tiktoken-go/tokenizer
460
+ Version: v0.8.1
461
+ License: MIT
462
+
463
+ --- LICENSE ---
464
+
465
+ MIT License
466
+
467
+ Copyright (c) 2023 tiktoken-go
468
+
469
+ Permission is hereby granted, free of charge, to any person obtaining a copy
470
+ of this software and associated documentation files (the "Software"), to deal
471
+ in the Software without restriction, including without limitation the rights
472
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
473
+ copies of the Software, and to permit persons to whom the Software is
474
+ furnished to do so, subject to the following conditions:
475
+
476
+ The above copyright notice and this permission notice shall be included in all
477
+ copies or substantial portions of the Software.
478
+
479
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
480
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
481
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
482
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
483
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
484
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
485
+ SOFTWARE.
486
+
487
+ ================================================================================
488
+ Module: github.com/yosida95/uritemplate/v3
489
+ Version: v3.0.2
490
+ License: BSD-3-Clause
491
+
492
+ --- LICENSE ---
493
+
494
+ Copyright (C) 2016, Kohei YOSHIDA <https://yosida95.com/>. All rights reserved.
495
+
496
+ Redistribution and use in source and binary forms, with or without
497
+ modification, are permitted provided that the following conditions are met:
498
+
499
+ * Redistributions of source code must retain the above copyright
500
+ notice, this list of conditions and the following disclaimer.
501
+ * Redistributions in binary form must reproduce the above copyright
502
+ notice, this list of conditions and the following disclaimer in the
503
+ documentation and/or other materials provided with the distribution.
504
+ * Neither the name of the copyright holder nor the names of its
505
+ contributors may be used to endorse or promote products derived from
506
+ this software without specific prior written permission.
507
+
508
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
509
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
510
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
511
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
512
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
513
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
514
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
515
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
516
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
517
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
518
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
519
+
520
+ ================================================================================
521
+ Module: golang.org/x/oauth2
522
+ Version: v0.35.0
523
+ License: BSD-3-Clause
524
+
525
+ --- LICENSE ---
526
+
527
+ Copyright 2009 The Go Authors.
528
+
529
+ Redistribution and use in source and binary forms, with or without
530
+ modification, are permitted provided that the following conditions are
531
+ met:
532
+
533
+ * Redistributions of source code must retain the above copyright
534
+ notice, this list of conditions and the following disclaimer.
535
+ * Redistributions in binary form must reproduce the above
536
+ copyright notice, this list of conditions and the following disclaimer
537
+ in the documentation and/or other materials provided with the
538
+ distribution.
539
+ * Neither the name of Google LLC nor the names of its
540
+ contributors may be used to endorse or promote products derived from
541
+ this software without specific prior written permission.
542
+
543
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
544
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
545
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
546
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
547
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
548
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
549
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
550
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
551
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
552
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
553
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
554
+
555
+ ================================================================================
556
+ Module: golang.org/x/sync
557
+ Version: v0.20.0
558
+ License: BSD-3-Clause
559
+
560
+ --- LICENSE ---
561
+
562
+ Copyright 2009 The Go Authors.
563
+
564
+ Redistribution and use in source and binary forms, with or without
565
+ modification, are permitted provided that the following conditions are
566
+ met:
567
+
568
+ * Redistributions of source code must retain the above copyright
569
+ notice, this list of conditions and the following disclaimer.
570
+ * Redistributions in binary form must reproduce the above
571
+ copyright notice, this list of conditions and the following disclaimer
572
+ in the documentation and/or other materials provided with the
573
+ distribution.
574
+ * Neither the name of Google LLC nor the names of its
575
+ contributors may be used to endorse or promote products derived from
576
+ this software without specific prior written permission.
577
+
578
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
579
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
580
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
581
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
582
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
583
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
584
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
585
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
586
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
587
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
588
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
589
+
590
+ ================================================================================
591
+ Module: golang.org/x/sys
592
+ Version: v0.41.0
593
+ License: BSD-3-Clause
594
+
595
+ --- LICENSE ---
596
+
597
+ Copyright 2009 The Go Authors.
598
+
599
+ Redistribution and use in source and binary forms, with or without
600
+ modification, are permitted provided that the following conditions are
601
+ met:
602
+
603
+ * Redistributions of source code must retain the above copyright
604
+ notice, this list of conditions and the following disclaimer.
605
+ * Redistributions in binary form must reproduce the above
606
+ copyright notice, this list of conditions and the following disclaimer
607
+ in the documentation and/or other materials provided with the
608
+ distribution.
609
+ * Neither the name of Google LLC nor the names of its
610
+ contributors may be used to endorse or promote products derived from
611
+ this software without specific prior written permission.
612
+
613
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
614
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
615
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
616
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
617
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
618
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
619
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
620
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
621
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
622
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
623
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
624
+
625
+ ================================================================================
626
+ Module: golang.org/x/time
627
+ Version: v0.15.0
628
+ License: BSD-3-Clause
629
+
630
+ --- LICENSE ---
631
+
632
+ Copyright 2009 The Go Authors.
633
+
634
+ Redistribution and use in source and binary forms, with or without
635
+ modification, are permitted provided that the following conditions are
636
+ met:
637
+
638
+ * Redistributions of source code must retain the above copyright
639
+ notice, this list of conditions and the following disclaimer.
640
+ * Redistributions in binary form must reproduce the above
641
+ copyright notice, this list of conditions and the following disclaimer
642
+ in the documentation and/or other materials provided with the
643
+ distribution.
644
+ * Neither the name of Google LLC nor the names of its
645
+ contributors may be used to endorse or promote products derived from
646
+ this software without specific prior written permission.
647
+
648
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
649
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
650
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
651
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
652
+ OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
653
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
654
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
655
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
656
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
657
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
658
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
659
+
660
+ ================================================================================
661
+ Module: gopkg.in/yaml.v3
662
+ Version: v3.0.1
663
+ License: MIT AND Apache-2.0
664
+
665
+ --- LICENSE ---
666
+
667
+
668
+ This project is covered by two different licenses: MIT and Apache.
669
+
670
+ #### MIT License ####
671
+
672
+ The following files were ported to Go from C files of libyaml, and thus
673
+ are still covered by their original MIT license, with the additional
674
+ copyright staring in 2011 when the project was ported over:
675
+
676
+ apic.go emitterc.go parserc.go readerc.go scannerc.go
677
+ writerc.go yamlh.go yamlprivateh.go
678
+
679
+ Copyright (c) 2006-2010 Kirill Simonov
680
+ Copyright (c) 2006-2011 Kirill Simonov
681
+
682
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
683
+ this software and associated documentation files (the "Software"), to deal in
684
+ the Software without restriction, including without limitation the rights to
685
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
686
+ of the Software, and to permit persons to whom the Software is furnished to do
687
+ so, subject to the following conditions:
688
+
689
+ The above copyright notice and this permission notice shall be included in all
690
+ copies or substantial portions of the Software.
691
+
692
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
693
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
694
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
695
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
696
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
697
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
698
+ SOFTWARE.
699
+
700
+ ### Apache License ###
701
+
702
+ All the remaining project files are covered by the Apache license:
703
+
704
+ Copyright (c) 2011-2019 Canonical Ltd
705
+
706
+ Licensed under the Apache License, Version 2.0 (the "License");
707
+ you may not use this file except in compliance with the License.
708
+ You may obtain a copy of the License at
709
+
710
+ http://www.apache.org/licenses/LICENSE-2.0
711
+
712
+ Unless required by applicable law or agreed to in writing, software
713
+ distributed under the License is distributed on an "AS IS" BASIS,
714
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
715
+ See the License for the specific language governing permissions and
716
+ limitations under the License.
717
+
718
+ --- NOTICE ---
719
+
720
+ Copyright 2011-2016 Canonical Ltd.
721
+
722
+ Licensed under the Apache License, Version 2.0 (the "License");
723
+ you may not use this file except in compliance with the License.
724
+ You may obtain a copy of the License at
725
+
726
+ http://www.apache.org/licenses/LICENSE-2.0
727
+
728
+ Unless required by applicable law or agreed to in writing, software
729
+ distributed under the License is distributed on an "AS IS" BASIS,
730
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
731
+ See the License for the specific language governing permissions and
732
+ limitations under the License.
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ // Launcher for the review-mcp binary. Plain Node, no dependencies.
5
+ //
6
+ // stdout is the MCP channel, so this file never writes to stdout: every
7
+ // message of its own goes to stderr. The child inherits all three standard
8
+ // streams, so its output reaches the client byte for byte.
9
+ //
10
+ // The name of the platform package is derived from this package's own
11
+ // package.json (generated by npm/scripts/build-packages.mjs), so the npm
12
+ // scope is defined in exactly one place.
13
+
14
+ const childProcess = require('node:child_process');
15
+ const fs = require('node:fs');
16
+ const os = require('node:os');
17
+
18
+ const FORWARDED_SIGNALS = ['SIGINT', 'SIGTERM', 'SIGHUP'];
19
+
20
+ function platformPackageName(mainName, platform, arch) {
21
+ return `${mainName}-${platform}-${arch}`;
22
+ }
23
+
24
+ function binaryFileName(platform) {
25
+ return platform === 'win32' ? 'review-mcp.exe' : 'review-mcp';
26
+ }
27
+
28
+ // A fixed sentence: it names the expected package and nothing from the
29
+ // environment except the platform and architecture.
30
+ function missingPackageMessage(mainName, platform, arch) {
31
+ const pkg = platformPackageName(mainName, platform, arch);
32
+ return (
33
+ `review-mcp: the platform package "${pkg}" is not installed, ` +
34
+ `so there is no review-mcp binary for ${platform}-${arch}.\n` +
35
+ `Reinstall ${mainName} without --omit=optional (and without --no-optional) ` +
36
+ 'so that npm installs the package for your platform.\n'
37
+ );
38
+ }
39
+
40
+ // Returns { path, packaged } or { error }. REVIEW_MCP_BINARY wins when set.
41
+ function resolveBinary({ env, platform, arch, mainName, resolve }) {
42
+ if (env.REVIEW_MCP_BINARY) {
43
+ return { path: env.REVIEW_MCP_BINARY, packaged: false };
44
+ }
45
+ const specifier = `${platformPackageName(mainName, platform, arch)}/bin/${binaryFileName(platform)}`;
46
+ try {
47
+ return { path: resolve(specifier), packaged: true };
48
+ } catch {
49
+ return { error: missingPackageMessage(mainName, platform, arch) };
50
+ }
51
+ }
52
+
53
+ // Best effort: some package managers and archive tools drop the execute bit.
54
+ function ensureExecutable(file, platform, fsApi) {
55
+ if (platform === 'win32') return;
56
+ try {
57
+ fsApi.accessSync(file, fsApi.constants.X_OK);
58
+ } catch {
59
+ try {
60
+ fsApi.chmodSync(file, 0o755);
61
+ } catch {
62
+ // Ignore: spawn reports the real problem if the file still cannot run.
63
+ }
64
+ }
65
+ }
66
+
67
+ // run starts the binary and wires up signals and the exit status. Every
68
+ // dependency is injectable so the tests can use a fake child and a fake
69
+ // process object.
70
+ function run(opts = {}) {
71
+ const proc = opts.proc || process;
72
+ const spawn = opts.spawn || childProcess.spawn;
73
+ const fsApi = opts.fs || fs;
74
+ const writeErr = opts.writeErr || ((text) => process.stderr.write(text));
75
+ const platform = opts.platform || process.platform;
76
+ const arch = opts.arch || process.arch;
77
+ const env = opts.env || process.env;
78
+ const argv = opts.argv || process.argv.slice(2);
79
+ const mainName = opts.mainName || require('../package.json').name;
80
+ const resolve = opts.resolve || require.resolve;
81
+
82
+ const bin = resolveBinary({ env, platform, arch, mainName, resolve });
83
+ if (bin.error) {
84
+ writeErr(bin.error);
85
+ proc.exit(1);
86
+ return;
87
+ }
88
+ if (bin.packaged) ensureExecutable(bin.path, platform, fsApi);
89
+
90
+ const child = spawn(bin.path, argv, { stdio: 'inherit' });
91
+
92
+ const handlers = FORWARDED_SIGNALS.map((signal) => {
93
+ const handler = () => {
94
+ try {
95
+ child.kill(signal);
96
+ } catch {
97
+ // The child is already gone.
98
+ }
99
+ };
100
+ proc.on(signal, handler);
101
+ return [signal, handler];
102
+ });
103
+ const detach = () => {
104
+ for (const [signal, handler] of handlers) proc.removeListener(signal, handler);
105
+ };
106
+
107
+ child.on('error', (err) => {
108
+ detach();
109
+ writeErr(`review-mcp: failed to start the binary (${(err && err.code) || 'unknown error'}).\n`);
110
+ proc.exit(1);
111
+ });
112
+
113
+ child.on('exit', (code, signal) => {
114
+ detach();
115
+ if (signal) {
116
+ // Re-raise the child's signal so the parent shell sees the same status.
117
+ proc.kill(proc.pid, signal);
118
+ // Only reached if the signal did not terminate this process.
119
+ const number = (os.constants.signals && os.constants.signals[signal]) || 1;
120
+ setTimeout(() => proc.exit(128 + number), 100);
121
+ return;
122
+ }
123
+ proc.exit(code === null || code === undefined ? 1 : code);
124
+ });
125
+ }
126
+
127
+ module.exports = {
128
+ FORWARDED_SIGNALS,
129
+ platformPackageName,
130
+ binaryFileName,
131
+ missingPackageMessage,
132
+ resolveBinary,
133
+ ensureExecutable,
134
+ run,
135
+ };
136
+
137
+ if (require.main === module) run();
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@nevzatcirak/review-mcp",
3
+ "version": "1.0.0-rc.1",
4
+ "description": "MCP server for AI-assisted pull-request review on Gitea and Bitbucket Server.",
5
+ "keywords": [
6
+ "mcp",
7
+ "model-context-protocol",
8
+ "code-review",
9
+ "pull-request",
10
+ "gitea",
11
+ "bitbucket"
12
+ ],
13
+ "license": "MIT",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/nevzatcirak/review-mcp.git"
17
+ },
18
+ "homepage": "https://github.com/nevzatcirak/review-mcp",
19
+ "bin": {
20
+ "review-mcp": "bin/review-mcp.js"
21
+ },
22
+ "engines": {
23
+ "node": ">=18"
24
+ },
25
+ "optionalDependencies": {
26
+ "@nevzatcirak/review-mcp-linux-x64": "1.0.0-rc.1",
27
+ "@nevzatcirak/review-mcp-linux-arm64": "1.0.0-rc.1",
28
+ "@nevzatcirak/review-mcp-darwin-x64": "1.0.0-rc.1",
29
+ "@nevzatcirak/review-mcp-darwin-arm64": "1.0.0-rc.1",
30
+ "@nevzatcirak/review-mcp-win32-x64": "1.0.0-rc.1",
31
+ "@nevzatcirak/review-mcp-win32-arm64": "1.0.0-rc.1"
32
+ },
33
+ "files": [
34
+ "bin/review-mcp.js",
35
+ "LICENSE",
36
+ "NOTICE",
37
+ "THIRD_PARTY_LICENSES",
38
+ "README.md"
39
+ ]
40
+ }