@hazeljs/mcp 0.8.2 → 0.8.5
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 +11 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -24,16 +24,26 @@ Any method decorated with `@Tool()` becomes an MCP tool callable by Cursor, Clau
|
|
|
24
24
|
|
|
25
25
|
```bash
|
|
26
26
|
npm install @hazeljs/mcp
|
|
27
|
+
# Optional: only if you want @Tool() decorators
|
|
28
|
+
npm install @hazeljs/agent
|
|
27
29
|
```
|
|
28
30
|
|
|
31
|
+
### Requirements
|
|
32
|
+
|
|
33
|
+
- **Node.js 20+**
|
|
34
|
+
- **TypeScript 5+** with `experimentalDecorators: true` in your `tsconfig.json` (only when using `@Tool()` decorators)
|
|
35
|
+
- **No `reflect-metadata` import in your application code.** `@hazeljs/agent` declares it as a regular dependency and loads it automatically; importing it again from your code is unnecessary. In standalone mode (without `@hazeljs/agent`), `reflect-metadata` is not used at all.
|
|
36
|
+
- **No `emitDecoratorMetadata` required.** `@Tool()` does not rely on TypeScript's design-time type metadata.
|
|
37
|
+
|
|
29
38
|
---
|
|
30
39
|
|
|
31
40
|
## Quick Start — with `@hazeljs/agent`
|
|
32
41
|
|
|
33
42
|
### 1. Define tools on an agent class
|
|
34
43
|
|
|
44
|
+
> You do **not** need to import `reflect-metadata` yourself. `@hazeljs/agent` lists it as a regular dependency and every decorator module loads it as a side-effect import, so it is already initialized by the time your `@Tool()` runs. Just enable `experimentalDecorators` in your `tsconfig.json`.
|
|
45
|
+
|
|
35
46
|
```typescript
|
|
36
|
-
import 'reflect-metadata';
|
|
37
47
|
import { Tool } from '@hazeljs/agent';
|
|
38
48
|
|
|
39
49
|
export class SupportAgent {
|
|
@@ -64,9 +74,6 @@ export class SupportAgent {
|
|
|
64
74
|
### 2. Register the agent and create the server
|
|
65
75
|
|
|
66
76
|
```typescript
|
|
67
|
-
// reflect-metadata must be the first import
|
|
68
|
-
import 'reflect-metadata';
|
|
69
|
-
|
|
70
77
|
import { ToolRegistry } from '@hazeljs/agent';
|
|
71
78
|
import { createMcpServer } from '@hazeljs/mcp';
|
|
72
79
|
import { SupportAgent } from './agents/SupportAgent';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hazeljs/mcp",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.5",
|
|
4
4
|
"description": "Expose HazelJS tools as MCP (Model Context Protocol) tools over STDIO",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"typescript": "^5.9.3"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@hazeljs/agent": "^0.8.
|
|
49
|
+
"@hazeljs/agent": "^0.8.5"
|
|
50
50
|
},
|
|
51
51
|
"peerDependenciesMeta": {
|
|
52
52
|
"@hazeljs/agent": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"description": "Required when using @hazeljs/agent ToolRegistry. Not needed for custom IToolRegistry implementations."
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "17874837994b8ce260f70ae09d2fe58d5606d18a"
|
|
58
58
|
}
|