@aigne/example-mcp-blocklet 1.5.0 → 1.6.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.
- package/README.md +1 -0
- package/index.ts +3 -6
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -5,6 +5,7 @@ This is a demonstration of using [AIGNE Framework](https://github.com/AIGNE-io/a
|
|
|
5
5
|
## Prerequisites
|
|
6
6
|
|
|
7
7
|
- [Node.js](https://nodejs.org) and npm installed on your machine
|
|
8
|
+
- [Bun](https://bun.sh) installed on your machine
|
|
8
9
|
- [OpenAI API key](https://platform.openai.com/api-keys) used to interact with OpenAI API
|
|
9
10
|
- [Pnpm](https://pnpm.io) [Optional] if you want to run the example from source code
|
|
10
11
|
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import assert from "node:assert";
|
|
4
4
|
import { runChatLoopInTerminal } from "@aigne/cli/utils/run-chat-loop.js";
|
|
5
5
|
import { AIAgent, ExecutionEngine, MCPAgent, PromptBuilder } from "@aigne/core";
|
|
6
|
-
import {
|
|
6
|
+
import { loadModel } from "@aigne/core/loader/index.js";
|
|
7
7
|
import { logger } from "@aigne/core/utils/logger.js";
|
|
8
8
|
import { UnauthorizedError, refreshAuthorization } from "@modelcontextprotocol/sdk/client/auth.js";
|
|
9
9
|
import { SSEClientTransport } from "@modelcontextprotocol/sdk/client/sse.js";
|
|
@@ -14,8 +14,7 @@ import { TerminalOAuthProvider } from "./oauth.js";
|
|
|
14
14
|
|
|
15
15
|
logger.enable(`aigne:mcp,${process.env.DEBUG}`);
|
|
16
16
|
|
|
17
|
-
const {
|
|
18
|
-
assert(OPENAI_API_KEY, "Please set the OPENAI_API_KEY environment variable");
|
|
17
|
+
const { BLOCKLET_APP_URL } = process.env;
|
|
19
18
|
assert(BLOCKLET_APP_URL, "Please set the BLOCKLET_APP_URL environment variable");
|
|
20
19
|
console.info("Connecting to blocklet app", BLOCKLET_APP_URL);
|
|
21
20
|
|
|
@@ -90,9 +89,7 @@ try {
|
|
|
90
89
|
|
|
91
90
|
console.info("Starting connecting to blocklet mcp...");
|
|
92
91
|
|
|
93
|
-
const model =
|
|
94
|
-
apiKey: OPENAI_API_KEY,
|
|
95
|
-
});
|
|
92
|
+
const model = await loadModel();
|
|
96
93
|
|
|
97
94
|
const blocklet = await MCPAgent.from({
|
|
98
95
|
url: appUrl.href,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aigne/example-mcp-blocklet",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "A demonstration of using AIGNE Framework and MCP Server hosted by the Blocklet platform",
|
|
5
5
|
"author": "Arcblock <blocklet@arcblock.io> https://github.com/blocklet",
|
|
6
6
|
"homepage": "https://github.com/AIGNE-io/aigne-framework/tree/main/examples/mcp-blocklet",
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"jsonwebtoken": "^9.0.2",
|
|
21
21
|
"open": "^10.1.0",
|
|
22
22
|
"zod": "^3.24.2",
|
|
23
|
-
"@aigne/
|
|
24
|
-
"@aigne/
|
|
23
|
+
"@aigne/core": "^1.8.0",
|
|
24
|
+
"@aigne/cli": "^1.3.0"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
|
-
"start": "
|
|
27
|
+
"start": "bun run index.ts",
|
|
28
28
|
"lint": "tsc --noEmit"
|
|
29
29
|
}
|
|
30
30
|
}
|