@jaypie/mcp 0.2.9 → 0.2.12
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/dist/index.js +1 -1
- package/package.json +1 -1
- package/prompts/Jaypie_CDK_Constructs_and_Patterns.md +23 -28
- package/prompts/Jaypie_DynamoDB_Package.md +62 -62
- package/prompts/Jaypie_Express_Package.md +101 -44
- package/prompts/{Jaypie_Vocabulary_Commander.md → Jaypie_Fabric_Commander.md} +38 -38
- package/prompts/{Jaypie_Vocabulary_LLM.md → Jaypie_Fabric_LLM.md} +45 -45
- package/prompts/{Jaypie_Vocabulary_Lambda.md → Jaypie_Fabric_Lambda.md} +40 -42
- package/prompts/{Jaypie_Vocabulary_MCP.md → Jaypie_Fabric_MCP.md} +39 -39
- package/prompts/{Jaypie_Vocabulary_Package.md → Jaypie_Fabric_Package.md} +151 -142
- package/prompts/Jaypie_Init_CICD_with_GitHub_Actions.md +12 -12
- package/prompts/Jaypie_Streaming.md +408 -0
- package/prompts/Templates_Express_Subpackage.md +6 -2
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: MCP server tool registration from
|
|
2
|
+
description: MCP server tool registration from fabricService
|
|
3
3
|
---
|
|
4
4
|
|
|
5
|
-
# Jaypie
|
|
5
|
+
# Jaypie Fabric MCP Adapter
|
|
6
6
|
|
|
7
|
-
The MCP adapter (`@jaypie/
|
|
7
|
+
The MCP adapter (`@jaypie/fabric/mcp`) registers Jaypie service handlers as MCP (Model Context Protocol) tools for use with MCP servers.
|
|
8
8
|
|
|
9
|
-
**See also:** [
|
|
9
|
+
**See also:** [Jaypie_Fabric_Package.md](Jaypie_Fabric_Package.md) for core fabricService documentation.
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
13
13
|
```bash
|
|
14
|
-
npm install @jaypie/
|
|
14
|
+
npm install @jaypie/fabric @modelcontextprotocol/sdk
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
19
|
```typescript
|
|
20
20
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
21
|
+
import { fabricService } from "@jaypie/fabric";
|
|
22
|
+
import { fabricMcp } from "@jaypie/fabric/mcp";
|
|
23
23
|
|
|
24
|
-
const handler =
|
|
24
|
+
const handler = fabricService({
|
|
25
25
|
alias: "greet",
|
|
26
26
|
description: "Greet a user by name",
|
|
27
27
|
input: {
|
|
@@ -35,18 +35,18 @@ const handler = serviceHandler({
|
|
|
35
35
|
});
|
|
36
36
|
|
|
37
37
|
const server = new McpServer({ name: "my-server", version: "1.0.0" });
|
|
38
|
-
|
|
38
|
+
fabricMcp({ service: handler, server });
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## fabricMcp
|
|
42
42
|
|
|
43
|
-
Registers a
|
|
43
|
+
Registers a fabricService as an MCP tool.
|
|
44
44
|
|
|
45
45
|
### Options
|
|
46
46
|
|
|
47
47
|
| Option | Type | Description |
|
|
48
48
|
|--------|------|-------------|
|
|
49
|
-
| `
|
|
49
|
+
| `service` | `Service` | Required. The service handler to adapt |
|
|
50
50
|
| `server` | `McpServer` | Required. The MCP server to register with |
|
|
51
51
|
| `name` | `string` | Override tool name (defaults to handler.alias) |
|
|
52
52
|
| `description` | `string` | Override tool description (defaults to handler.description) |
|
|
@@ -59,10 +59,10 @@ Registers a serviceHandler as an MCP tool.
|
|
|
59
59
|
|
|
60
60
|
```typescript
|
|
61
61
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
62
|
+
import { fabricService } from "@jaypie/fabric";
|
|
63
|
+
import { fabricMcp } from "@jaypie/fabric/mcp";
|
|
64
64
|
|
|
65
|
-
const calculateHandler =
|
|
65
|
+
const calculateHandler = fabricService({
|
|
66
66
|
alias: "calculate",
|
|
67
67
|
description: "Perform a mathematical calculation",
|
|
68
68
|
input: {
|
|
@@ -81,14 +81,14 @@ const calculateHandler = serviceHandler({
|
|
|
81
81
|
});
|
|
82
82
|
|
|
83
83
|
const server = new McpServer({ name: "calculator", version: "1.0.0" });
|
|
84
|
-
|
|
84
|
+
fabricMcp({ service: calculateHandler, server });
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
### Overriding Name and Description
|
|
88
88
|
|
|
89
89
|
```typescript
|
|
90
|
-
|
|
91
|
-
handler,
|
|
90
|
+
fabricMcp({
|
|
91
|
+
service: handler,
|
|
92
92
|
server,
|
|
93
93
|
name: "math_calculate",
|
|
94
94
|
description: "A tool for performing basic math operations",
|
|
@@ -100,7 +100,7 @@ registerMcpTool({
|
|
|
100
100
|
Services can use context callbacks to report progress, errors, and completion:
|
|
101
101
|
|
|
102
102
|
```typescript
|
|
103
|
-
const handler =
|
|
103
|
+
const handler = fabricService({
|
|
104
104
|
alias: "evaluate",
|
|
105
105
|
input: { jobId: { type: String } },
|
|
106
106
|
service: async ({ jobId }, context) => {
|
|
@@ -116,8 +116,8 @@ const handler = serviceHandler({
|
|
|
116
116
|
},
|
|
117
117
|
});
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
handler,
|
|
119
|
+
fabricMcp({
|
|
120
|
+
service: handler,
|
|
121
121
|
server,
|
|
122
122
|
onComplete: (result) => console.log("Tool completed:", result),
|
|
123
123
|
onError: (error) => console.warn("Recoverable error:", error),
|
|
@@ -165,11 +165,11 @@ For string responses:
|
|
|
165
165
|
```typescript
|
|
166
166
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
167
167
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
168
|
-
import {
|
|
169
|
-
import {
|
|
168
|
+
import { fabricService } from "@jaypie/fabric";
|
|
169
|
+
import { fabricMcp } from "@jaypie/fabric/mcp";
|
|
170
170
|
|
|
171
171
|
// Define handlers
|
|
172
|
-
const weatherHandler =
|
|
172
|
+
const weatherHandler = fabricService({
|
|
173
173
|
alias: "get_weather",
|
|
174
174
|
description: "Get current weather for a location",
|
|
175
175
|
input: {
|
|
@@ -187,7 +187,7 @@ const weatherHandler = serviceHandler({
|
|
|
187
187
|
},
|
|
188
188
|
});
|
|
189
189
|
|
|
190
|
-
const searchHandler =
|
|
190
|
+
const searchHandler = fabricService({
|
|
191
191
|
alias: "search",
|
|
192
192
|
description: "Search for information",
|
|
193
193
|
input: {
|
|
@@ -205,8 +205,8 @@ const server = new McpServer({
|
|
|
205
205
|
version: "1.0.0",
|
|
206
206
|
});
|
|
207
207
|
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
fabricMcp({ service: weatherHandler, server });
|
|
209
|
+
fabricMcp({ service: searchHandler, server });
|
|
210
210
|
|
|
211
211
|
// Start server
|
|
212
212
|
const transport = new StdioServerTransport();
|
|
@@ -233,15 +233,15 @@ input: {
|
|
|
233
233
|
|
|
234
234
|
```typescript
|
|
235
235
|
import type {
|
|
236
|
+
FabricMcpConfig,
|
|
237
|
+
FabricMcpResult,
|
|
236
238
|
McpToolContentItem,
|
|
237
239
|
McpToolResponse,
|
|
238
240
|
OnCompleteCallback,
|
|
239
241
|
OnErrorCallback,
|
|
240
242
|
OnFatalCallback,
|
|
241
243
|
OnMessageCallback,
|
|
242
|
-
|
|
243
|
-
RegisterMcpToolResult,
|
|
244
|
-
} from "@jaypie/vocabulary/mcp";
|
|
244
|
+
} from "@jaypie/fabric/mcp";
|
|
245
245
|
```
|
|
246
246
|
|
|
247
247
|
### Type Definitions
|
|
@@ -256,8 +256,8 @@ interface McpToolResponse {
|
|
|
256
256
|
content: McpToolContentItem[];
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
interface
|
|
260
|
-
|
|
259
|
+
interface FabricMcpConfig {
|
|
260
|
+
service: Service;
|
|
261
261
|
server: McpServer;
|
|
262
262
|
name?: string;
|
|
263
263
|
description?: string;
|
|
@@ -267,7 +267,7 @@ interface RegisterMcpToolConfig {
|
|
|
267
267
|
onMessage?: OnMessageCallback;
|
|
268
268
|
}
|
|
269
269
|
|
|
270
|
-
interface
|
|
270
|
+
interface FabricMcpResult {
|
|
271
271
|
name: string;
|
|
272
272
|
}
|
|
273
273
|
```
|
|
@@ -275,22 +275,22 @@ interface RegisterMcpToolResult {
|
|
|
275
275
|
## Exports
|
|
276
276
|
|
|
277
277
|
```typescript
|
|
278
|
-
// @jaypie/
|
|
279
|
-
export {
|
|
278
|
+
// @jaypie/fabric/mcp
|
|
279
|
+
export { fabricMcp } from "./fabricMcp.js";
|
|
280
280
|
|
|
281
281
|
export type {
|
|
282
|
+
FabricMcpConfig,
|
|
283
|
+
FabricMcpResult,
|
|
282
284
|
McpToolContentItem,
|
|
283
285
|
McpToolResponse,
|
|
284
286
|
OnCompleteCallback,
|
|
285
287
|
OnErrorCallback,
|
|
286
288
|
OnFatalCallback,
|
|
287
289
|
OnMessageCallback,
|
|
288
|
-
RegisterMcpToolConfig,
|
|
289
|
-
RegisterMcpToolResult,
|
|
290
290
|
} from "./types.js";
|
|
291
291
|
```
|
|
292
292
|
|
|
293
293
|
## Related
|
|
294
294
|
|
|
295
|
-
- [
|
|
296
|
-
- [
|
|
295
|
+
- [Jaypie_Fabric_Package.md](Jaypie_Fabric_Package.md) - Core fabricService and type conversion
|
|
296
|
+
- [Jaypie_Fabric_LLM.md](Jaypie_Fabric_LLM.md) - LLM tool creation (similar pattern)
|