Skip to content

Commit 041189d

Browse files
committed
chore: Update ESLint configuration, package.json, and README
- Disabled the 'prefer-global/process' rule in ESLint configuration. - Specified Node.js engine requirement (>=22.0.0) in package.json. - Added requirements section in README to reflect Node.js version and package managers.
1 parent d413f2c commit 041189d

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828

2929
## 🚀 Quick Start
3030

31+
### Requirements
32+
33+
- Node.js 22.0.0 or higher
34+
- npm, yarn, or pnpm (examples use pnpm)
35+
3136
### Installation
3237

3338
```bash
@@ -125,6 +130,10 @@ const agent = new MCPAgent({
125130
})
126131
```
127132

133+
## 👥 Contributors
134+
135+
<!-- Contributors section will be automatically generated here -->
136+
128137
## 📜 License
129138

130139
MIT © [Zane](https://github.com/zandko)

eslint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ import antfu from '@antfu/eslint-config'
33
export default antfu({
44
formatters: true,
55
typescript: true,
6+
rules: {
7+
'node/prefer-global/process': 'off',
8+
},
69
})

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
"files": [
3838
"dist"
3939
],
40+
"engines": {
41+
"node": ">=22.0.0"
42+
},
4043
"publishConfig": {
4144
"registry": "https://registry.npmjs.org"
4245
},

src/connectors/websocket.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import type { RequestOptions } from '@modelcontextprotocol/sdk/shared/protocol.js'
21
import type {
32
CallToolResult,
43
Tool,
@@ -93,7 +92,7 @@ export class WebSocketConnector extends BaseConnector {
9392
data = JSON.parse(msg.data ?? msg)
9493
}
9594
catch (e) {
96-
logger.warn('Received non‑JSON frame')
95+
logger.warn('Received non‑JSON frame', e)
9796
return
9897
}
9998
const id = data.id
@@ -142,21 +141,21 @@ export class WebSocketConnector extends BaseConnector {
142141
return res.tools ?? []
143142
}
144143

145-
async callTool(name: string, args: Record<string, any>, options?: RequestOptions): Promise<CallToolResult> {
144+
async callTool(name: string, args: Record<string, any>): Promise<CallToolResult> {
146145
return await this.sendRequest('tools/call', { name, arguments: args })
147146
}
148147

149-
async listResources(options?: RequestOptions): Promise<any> {
148+
async listResources(): Promise<any> {
150149
const resources = await this.sendRequest('resources/list')
151150
return { resources: Array.isArray(resources) ? resources : [] }
152151
}
153152

154-
async readResource(uri: string, options?: RequestOptions): Promise<{ content: ArrayBuffer, mimeType: string }> {
153+
async readResource(uri: string): Promise<{ content: ArrayBuffer, mimeType: string }> {
155154
const res = await this.sendRequest('resources/read', { uri })
156155
return { content: res.content, mimeType: res.mimeType }
157156
}
158157

159-
async request(method: string, params: Record<string, any> | null = null, options?: RequestOptions): Promise<any> {
158+
async request(method: string, params: Record<string, any> | null = null): Promise<any> {
160159
return await this.sendRequest(method, params)
161160
}
162161

0 commit comments

Comments
 (0)