flow-codeblock-rust-mcp 0.1.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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -0
  3. package/dist/index.js +28733 -0
  4. package/package.json +40 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 renoelis
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/README.md ADDED
@@ -0,0 +1,49 @@
1
+ # flow-codeblock-rust-mcp
2
+
3
+ Flow Codeblock Rust+Bun 的本地 stdio MCP Server。它只调用服务端 Rust REST API,不在用户电脑执行脚本;用户 JavaScript 仍由服务端 Bun 执行器运行。
4
+
5
+ ## 安装和启动
6
+
7
+ 需要 Bun 1.4.0 或更高版本:
8
+
9
+ ```bash
10
+ bunx --bun flow-codeblock-rust-mcp@0.1.0
11
+ ```
12
+
13
+ 配置环境变量:
14
+
15
+ ```bash
16
+ export FLOW_CODEBLOCK_BASE_URL=http://127.0.0.1:3003
17
+ export FLOW_CODEBLOCK_TOKEN='<YOUR_INTERNAL_ACCESS_TOKEN>'
18
+ ```
19
+
20
+ `FLOW_CODEBLOCK_TOKEN` 是当前 Flow Codeblock 服务的内部访问令牌。生产部署应使用 HTTPS 地址,不要将真实 Token 写入仓库、npm 包、命令行历史或公开客户端配置。
21
+
22
+ ## stdio 配置
23
+
24
+ ```json
25
+ {
26
+ "mcpServers": {
27
+ "flow-codeblock-rust": {
28
+ "command": "bunx",
29
+ "args": ["--bun", "flow-codeblock-rust-mcp@0.1.0"],
30
+ "env": {
31
+ "FLOW_CODEBLOCK_BASE_URL": "https://flow.example.com",
32
+ "FLOW_CODEBLOCK_TOKEN": "<YOUR_INTERNAL_ACCESS_TOKEN>"
33
+ }
34
+ }
35
+ }
36
+ }
37
+ ```
38
+
39
+ ## 工具边界
40
+
41
+ 工具覆盖代码生成、未发布代码测试、脚本列表、版本读取、接口文档校验/预览/保存、脚本创建/更新、锁定/解锁和已发布脚本执行。创建或代码更新要求完整接口文档;预览会调用 `/flow/scripts/validate`,应用时使用事务级 `expected_version` 检测并发冲突。所有脚本写操作需要预览后显式 `confirm: true`。
42
+
43
+ MCP 不提供脚本删除、紧急恢复解锁、Token 查询、执行统计、所有权转移或任意 HTTP 代理工具。当前版本只提供本地 stdio 连接,不提供远程 HTTP、SSE 或 Streamable HTTP 连接。
44
+
45
+ ## 安全行为
46
+
47
+ - 管理请求使用 `Authorization: Bearer`,执行已发布脚本时不会把 MCP Token 转发到脚本输入。
48
+ - 用户传入的 Authorization、accessToken、Cookie、CSRF、测试工具标识和 `Forwarded`/`X-Real-IP`/`X-Forwarded-*` 等代理来源头会被过滤。
49
+ - 请求有 30 秒超时,预览有 10 分钟 TTL 和 256 条上限。