@deveco-codegenie/mcp-bridge 0.1.8-fix3 → 0.1.8-fix4

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 (3) hide show
  1. package/README.md +42 -42
  2. package/index.js +18 -18
  3. package/package.json +4 -4
package/README.md CHANGED
@@ -1,42 +1,42 @@
1
- # napi-bridge
2
-
3
- 将MCP Server封装成.node模块,无需经过 MCP 标准协议层(stdio),供 IDE 插件等 Node.js 宿主直接调用。
4
-
5
- ---
6
-
7
- ## 目录
8
-
9
- - [工作原理](#工作原理)
10
- - [支持平台](#支持平台)
11
-
12
- ---
13
-
14
- ## 工作原理
15
-
16
- ```
17
- Node.js 宿主(IDE 插件等)
18
-
19
- │ require("napi_bridge.<platform>-<arch>.node")
20
-
21
- napi-bridge ←──── Rust N-API 绑定
22
-
23
- │ 直接调用(无 stdio / MCP 协议)
24
-
25
- mcp-server(Rust 核心库)
26
-
27
-
28
- HarmonyOS 工具链(hvigor / hdc / ArkTS LSP ...)
29
- ```
30
-
31
- 与 MCP stdio 传输不同,napi-bridge 通过 N-API 在**同一进程内**直接调用工具逻辑,省去了协议序列化与进程间通信开销。
32
-
33
-
34
- ---
35
-
36
- ## 支持平台
37
-
38
- | 平台 | 架构 | Rust Target Triple |
39
- |------|------|--------------------|
40
- | Windows | x64 | `x86_64-pc-windows-msvc` |
41
- | macOS | x64 | `x86_64-apple-darwin` |
42
- | macOS | arm64 (Apple Silicon) | `aarch64-apple-darwin` |
1
+ # napi-bridge
2
+
3
+ 将MCP Server封装成.node模块,无需经过 MCP 标准协议层(stdio),供 IDE 插件等 Node.js 宿主直接调用。
4
+
5
+ ---
6
+
7
+ ## 目录
8
+
9
+ - [工作原理](#工作原理)
10
+ - [支持平台](#支持平台)
11
+
12
+ ---
13
+
14
+ ## 工作原理
15
+
16
+ ```
17
+ Node.js 宿主(IDE 插件等)
18
+
19
+ │ require("napi_bridge.<platform>-<arch>.node")
20
+
21
+ napi-bridge ←──── Rust N-API 绑定
22
+
23
+ │ 直接调用(无 stdio / MCP 协议)
24
+
25
+ mcp-server(Rust 核心库)
26
+
27
+
28
+ HarmonyOS 工具链(hvigor / hdc / ArkTS LSP ...)
29
+ ```
30
+
31
+ 与 MCP stdio 传输不同,napi-bridge 通过 N-API 在**同一进程内**直接调用工具逻辑,省去了协议序列化与进程间通信开销。
32
+
33
+
34
+ ---
35
+
36
+ ## 支持平台
37
+
38
+ | 平台 | 架构 | Rust Target Triple |
39
+ |------|------|--------------------|
40
+ | Windows | x64 | `x86_64-pc-windows-msvc` |
41
+ | macOS | x64 | `x86_64-apple-darwin` |
42
+ | macOS | arm64 (Apple Silicon) | `aarch64-apple-darwin` |
package/index.js CHANGED
@@ -1,18 +1,18 @@
1
- 'use strict';
2
-
3
- const path = require('path');
4
-
5
- const platform = process.platform;
6
- const arch = process.arch;
7
-
8
- const pkgName = `@deveco-codegenie/mcp-bridge-${platform}-${arch}`;
9
-
10
- try {
11
- const pkgJsonPath = require.resolve(`${pkgName}/package.json`);
12
- const nodeFilePath = path.join(path.dirname(pkgJsonPath), 'napi_bridge.node');
13
- module.exports = require(nodeFilePath);
14
- } catch (e) {
15
- const msg = `[napi-bridge] Failed to load native module for ${platform}/${arch}: ${e.message}`;
16
- console.error(msg);
17
- throw new Error(msg);
18
- }
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+
5
+ const platform = process.platform;
6
+ const arch = process.arch;
7
+
8
+ const pkgName = `@deveco-codegenie/mcp-bridge-${platform}-${arch}`;
9
+
10
+ try {
11
+ const pkgJsonPath = require.resolve(`${pkgName}/package.json`);
12
+ const nodeFilePath = path.join(path.dirname(pkgJsonPath), 'napi_bridge.node');
13
+ module.exports = require(nodeFilePath);
14
+ } catch (e) {
15
+ const msg = `[napi-bridge] Failed to load native module for ${platform}/${arch}: ${e.message}`;
16
+ console.error(msg);
17
+ throw new Error(msg);
18
+ }
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@deveco-codegenie/mcp-bridge",
3
- "version": "0.1.8-fix3",
3
+ "version": "0.1.8-fix4",
4
4
  "description": "Native napi-bridge module for MCP Server",
5
5
  "main": "index.js",
6
6
  "optionalDependencies": {
7
- "@deveco-codegenie/mcp-bridge-win32-x64": "0.1.8-fix3",
8
- "@deveco-codegenie/mcp-bridge-darwin-x64": "0.1.8-fix3",
9
- "@deveco-codegenie/mcp-bridge-darwin-arm64": "0.1.8-fix3"
7
+ "@deveco-codegenie/mcp-bridge-win32-x64": "0.1.8-fix4",
8
+ "@deveco-codegenie/mcp-bridge-darwin-x64": "0.1.8-fix4",
9
+ "@deveco-codegenie/mcp-bridge-darwin-arm64": "0.1.8-fix4"
10
10
  }
11
11
  }