easy-mcp-nest 0.1.1 → 0.1.3
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 +15 -7
- package/dist/config/version.js +2 -2
- package/dist/config/version.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -14,11 +14,11 @@ EasyMCP simplifies the creation of MCP (Model Context Protocol) servers by provi
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
npm install easy-mcp-
|
|
17
|
+
npm install easy-mcp-nest
|
|
18
18
|
# or
|
|
19
|
-
pnpm add easy-mcp-
|
|
19
|
+
pnpm add easy-mcp-nest
|
|
20
20
|
# or
|
|
21
|
-
yarn add easy-mcp-
|
|
21
|
+
yarn add easy-mcp-nest
|
|
22
22
|
```
|
|
23
23
|
|
|
24
24
|
### Peer Dependencies
|
|
@@ -38,7 +38,7 @@ npm install @nestjs/common@^11.0.1 @nestjs/core@^11.0.1 @nestjs/platform-express
|
|
|
38
38
|
## Quick Start
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
|
-
import { EasyMCP, McpConfig } from 'easy-mcp-
|
|
41
|
+
import { EasyMCP, McpConfig } from 'easy-mcp-nest';
|
|
42
42
|
|
|
43
43
|
// Define your tools
|
|
44
44
|
async function getUser(args: { userId: string }): Promise<string> {
|
|
@@ -189,12 +189,16 @@ process.on('SIGINT', async () => {
|
|
|
189
189
|
- `McpConfig` - Main configuration interface
|
|
190
190
|
- `ToolRegistrationInput` - Tool definition interface
|
|
191
191
|
- `ServerInfo` - Optional server information
|
|
192
|
-
- `JsonRpcRequest`, `JsonRpcResponse` - JSON-RPC 2.0 types
|
|
192
|
+
- `JsonRpcRequest`, `JsonRpcResponse`, `JsonRpcError` - JSON-RPC 2.0 types
|
|
193
|
+
- `JsonRpcErrorCode` - JSON-RPC 2.0 error code enum
|
|
193
194
|
- `InitializeParams`, `InitializeResult` - MCP initialize types
|
|
194
195
|
- `ListToolsResult`, `McpTool` - MCP tools types
|
|
195
196
|
- `CallToolParams`, `CallToolResult` - MCP tool call types
|
|
196
197
|
- `ToolDefinition`, `ToolParameter`, `ToolFunction` - Tool interfaces
|
|
197
198
|
- `IInterfaceLayer` - Interface layer interface
|
|
199
|
+
- `McpErrorCode` - MCP error code enum
|
|
200
|
+
- `VERSION`, `PACKAGE_NAME`, `getVersion()`, `getPackageName()` - Version information utilities
|
|
201
|
+
- `INTERFACE_LAYER_TOKEN` - Token for accessing the interface layer (advanced use cases)
|
|
198
202
|
|
|
199
203
|
## Architecture
|
|
200
204
|
|
|
@@ -301,7 +305,7 @@ import {
|
|
|
301
305
|
ConfigurationError,
|
|
302
306
|
ToolExecutionError,
|
|
303
307
|
ToolNotFoundError
|
|
304
|
-
} from 'easy-mcp-
|
|
308
|
+
} from 'easy-mcp-nest';
|
|
305
309
|
|
|
306
310
|
// Configuration errors - caught during initialization
|
|
307
311
|
try {
|
|
@@ -364,7 +368,7 @@ If tools are registered but not being called:
|
|
|
364
368
|
If you encounter TypeScript or import errors:
|
|
365
369
|
|
|
366
370
|
1. **Peer Dependencies**: Ensure all peer dependencies are installed (see Installation section)
|
|
367
|
-
2. **Type Exports**: Verify you're importing from the main package: `import { EasyMCP } from 'easy-mcp-
|
|
371
|
+
2. **Type Exports**: Verify you're importing from the main package: `import { EasyMCP } from 'easy-mcp-nest'`
|
|
368
372
|
3. **Build Output**: Check that `dist/index.js` and `dist/index.d.ts` exist after building
|
|
369
373
|
4. **Module Resolution**: Ensure your `tsconfig.json` has proper module resolution settings
|
|
370
374
|
|
|
@@ -392,6 +396,8 @@ Enable debug logging to troubleshoot issues:
|
|
|
392
396
|
|
|
393
397
|
```bash
|
|
394
398
|
DEBUG=1 node your-server.js
|
|
399
|
+
# or
|
|
400
|
+
DEBUG=true node your-server.js
|
|
395
401
|
```
|
|
396
402
|
|
|
397
403
|
Debug mode provides detailed information about:
|
|
@@ -400,6 +406,8 @@ Debug mode provides detailed information about:
|
|
|
400
406
|
- Protocol version validation
|
|
401
407
|
- Argument validation
|
|
402
408
|
|
|
409
|
+
**Note**: The `DEBUG` environment variable accepts either `'1'` or `'true'` (case-sensitive) to enable debug logging.
|
|
410
|
+
|
|
403
411
|
## Examples
|
|
404
412
|
|
|
405
413
|
See the `examples/` directory for complete working examples.
|
package/dist/config/version.js
CHANGED
|
@@ -9,7 +9,7 @@ function readPackageJson() {
|
|
|
9
9
|
const packageJson = require("../../package.json");
|
|
10
10
|
const name = typeof packageJson.name === "string"
|
|
11
11
|
? packageJson.name
|
|
12
|
-
: "easy-mcp-
|
|
12
|
+
: "easy-mcp-nest";
|
|
13
13
|
const version = typeof packageJson.version === "string"
|
|
14
14
|
? packageJson.version
|
|
15
15
|
: "0.0.0";
|
|
@@ -24,7 +24,7 @@ function readPackageJson() {
|
|
|
24
24
|
error: errorMessage,
|
|
25
25
|
});
|
|
26
26
|
return {
|
|
27
|
-
name: "easy-mcp-
|
|
27
|
+
name: "easy-mcp-nest",
|
|
28
28
|
version: "0.0.0",
|
|
29
29
|
};
|
|
30
30
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/config/version.ts"],"names":[],"mappings":";;;AA6DA,gCAEC;AAMD,wCAEC;AAvED,2DAAmD;AAYnD,SAAS,eAAe;IACtB,IAAI,CAAC;QAIH,MAAM,WAAW,GAAG,OAAO,CAAC,oBAAoB,CAAgB,CAAC;QAGjE,MAAM,IAAI,GAAG,OAAO,WAAW,CAAC,IAAI,KAAK,QAAQ;YAC/C,CAAC,CAAC,WAAW,CAAC,IAAI;YAClB,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/config/version.ts"],"names":[],"mappings":";;;AA6DA,gCAEC;AAMD,wCAEC;AAvED,2DAAmD;AAYnD,SAAS,eAAe;IACtB,IAAI,CAAC;QAIH,MAAM,WAAW,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