@jaypie/mcp 0.3.4 → 0.4.1
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/createMcpServer.d.ts +7 -1
- package/dist/index.js +22 -2088
- package/dist/index.js.map +1 -1
- package/dist/suite.js +1197 -7
- package/dist/suite.js.map +1 -1
- package/package.json +1 -2
- package/release-notes/constructs/1.2.18.md +12 -0
- package/release-notes/fabric/0.1.3.md +25 -0
- package/release-notes/fabric/0.1.4.md +42 -0
- package/release-notes/llm/1.2.5.md +25 -0
- package/release-notes/llm/1.2.6.md +55 -0
- package/release-notes/mcp/0.4.0.md +27 -0
- package/release-notes/testkit/1.2.15.md +23 -0
- package/skills/agents.md +18 -8
- package/skills/aws.md +232 -60
- package/skills/datadog.md +98 -64
- package/skills/dynamodb.md +37 -28
- package/skills/fabric.md +30 -3
- package/skills/issues.md +55 -0
- package/skills/llm.md +381 -0
- package/skills/secrets.md +74 -18
- package/skills/skills.md +23 -0
- package/skills/tools-aws.md +148 -0
- package/skills/tools-datadog.md +190 -0
- package/skills/tools-dynamodb.md +140 -0
- package/skills/tools.md +19 -54
- package/skills/vocabulary.md +25 -0
- package/dist/aws-B3dW_-bD.js +0 -1202
- package/dist/aws-B3dW_-bD.js.map +0 -1
- package/prompts/Branch_Management.md +0 -34
- package/prompts/Development_Process.md +0 -89
- package/prompts/Jaypie_Agent_Rules.md +0 -110
- package/prompts/Jaypie_Auth0_Express_Mongoose.md +0 -736
- package/prompts/Jaypie_Browser_and_Frontend_Web_Packages.md +0 -18
- package/prompts/Jaypie_CDK_Constructs_and_Patterns.md +0 -430
- package/prompts/Jaypie_CICD_with_GitHub_Actions.md +0 -371
- package/prompts/Jaypie_Commander_CLI_Package.md +0 -166
- package/prompts/Jaypie_Core_Errors_and_Logging.md +0 -39
- package/prompts/Jaypie_DynamoDB_Package.md +0 -774
- package/prompts/Jaypie_Eslint_NPM_Package.md +0 -78
- package/prompts/Jaypie_Express_Package.md +0 -630
- package/prompts/Jaypie_Fabric_Commander.md +0 -411
- package/prompts/Jaypie_Fabric_LLM.md +0 -312
- package/prompts/Jaypie_Fabric_Lambda.md +0 -308
- package/prompts/Jaypie_Fabric_MCP.md +0 -316
- package/prompts/Jaypie_Fabric_Package.md +0 -599
- package/prompts/Jaypie_Fabricator.md +0 -617
- package/prompts/Jaypie_Ideal_Project_Structure.md +0 -78
- package/prompts/Jaypie_Init_CICD_with_GitHub_Actions.md +0 -1186
- package/prompts/Jaypie_Init_Express_on_Lambda.md +0 -115
- package/prompts/Jaypie_Init_Jaypie_CDK_Package.md +0 -35
- package/prompts/Jaypie_Init_Lambda_Package.md +0 -505
- package/prompts/Jaypie_Init_Monorepo_Project.md +0 -44
- package/prompts/Jaypie_Init_Project_Subpackage.md +0 -65
- package/prompts/Jaypie_Legacy_Patterns.md +0 -15
- package/prompts/Jaypie_Llm_Calls.md +0 -449
- package/prompts/Jaypie_Llm_Tools.md +0 -155
- package/prompts/Jaypie_MCP_Package.md +0 -281
- package/prompts/Jaypie_Mocks_and_Testkit.md +0 -137
- package/prompts/Jaypie_Repokit.md +0 -103
- package/prompts/Jaypie_Scrub.md +0 -177
- package/prompts/Jaypie_Streaming.md +0 -467
- package/prompts/Templates_CDK_Subpackage.md +0 -115
- package/prompts/Templates_Express_Subpackage.md +0 -187
- package/prompts/Templates_Project_Monorepo.md +0 -326
- package/prompts/Templates_Project_Subpackage.md +0 -93
- package/prompts/Write_Efficient_Prompt_Guides.md +0 -48
- package/prompts/Write_and_Maintain_Engaging_Readme.md +0 -67
- package/skills/topics.md +0 -116
- /package/skills/{writing.md → documentation.md} +0 -0
package/skills/datadog.md
CHANGED
|
@@ -1,61 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Datadog integration and observability
|
|
3
|
-
related: logs, debugging, aws
|
|
2
|
+
description: Datadog integration, logging, and observability code patterns
|
|
3
|
+
related: logs, debugging, aws, tools-datadog
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Datadog Integration
|
|
7
7
|
|
|
8
8
|
Jaypie integrates with Datadog for logging, monitoring, and APM.
|
|
9
9
|
|
|
10
|
-
## MCP
|
|
10
|
+
## MCP Tools
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
### Log Search
|
|
15
|
-
```
|
|
16
|
-
datadog_logs - Search individual log entries
|
|
17
|
-
datadog_log_analytics - Aggregate logs with groupBy
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
### Monitoring
|
|
21
|
-
```
|
|
22
|
-
datadog_monitors - List and check monitor status
|
|
23
|
-
datadog_synthetics - List synthetic tests and results
|
|
24
|
-
datadog_metrics - Query timeseries metrics
|
|
25
|
-
datadog_rum - Search Real User Monitoring events
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Environment Variables
|
|
29
|
-
|
|
30
|
-
Configure Datadog tools via environment:
|
|
31
|
-
|
|
32
|
-
| Variable | Description |
|
|
33
|
-
|----------|-------------|
|
|
34
|
-
| `DATADOG_API_KEY` or `DD_API_KEY` | API key |
|
|
35
|
-
| `DATADOG_APP_KEY` or `DD_APP_KEY` | Application key |
|
|
36
|
-
| `DD_ENV` | Default environment filter |
|
|
37
|
-
| `DD_SERVICE` | Default service filter |
|
|
38
|
-
| `DD_SOURCE` | Default log source (default: lambda) |
|
|
39
|
-
|
|
40
|
-
## Common Queries
|
|
41
|
-
|
|
42
|
-
### Search Error Logs
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
datadog_logs --query "status:error" --from "now-1h"
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### Count Errors by Service
|
|
49
|
-
|
|
50
|
-
```
|
|
51
|
-
datadog_log_analytics --groupBy '["service"]' --query "status:error"
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### Check Alerting Monitors
|
|
55
|
-
|
|
56
|
-
```
|
|
57
|
-
datadog_monitors --status '["Alert", "Warn"]'
|
|
58
|
-
```
|
|
12
|
+
For interactive Datadog tools (logs, monitors, metrics, synthetics, RUM), see **tools-datadog**.
|
|
59
13
|
|
|
60
14
|
## Lambda Integration
|
|
61
15
|
|
|
@@ -65,6 +19,7 @@ Enable Datadog tracing in CDK:
|
|
|
65
19
|
import { JaypieLambda } from "@jaypie/constructs";
|
|
66
20
|
|
|
67
21
|
const handler = new JaypieLambda(this, "Handler", {
|
|
22
|
+
entry: "src/handler.ts",
|
|
68
23
|
datadogApiKeyArn: process.env.CDK_ENV_DATADOG_API_KEY_ARN,
|
|
69
24
|
environment: {
|
|
70
25
|
DD_ENV: "production",
|
|
@@ -87,26 +42,32 @@ log.info("Request processed", {
|
|
|
87
42
|
action: "checkout",
|
|
88
43
|
duration: 150,
|
|
89
44
|
});
|
|
45
|
+
|
|
46
|
+
// Error logs include stack traces
|
|
47
|
+
log.error("Payment failed", {
|
|
48
|
+
error,
|
|
49
|
+
orderId: "order-456",
|
|
50
|
+
});
|
|
90
51
|
```
|
|
91
52
|
|
|
92
|
-
##
|
|
53
|
+
## @jaypie/datadog Package
|
|
93
54
|
|
|
94
|
-
|
|
55
|
+
The `@jaypie/datadog` package provides utilities:
|
|
95
56
|
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
@http.status_code:500 # By attribute
|
|
99
|
-
service:my-api # By service
|
|
100
|
-
*timeout* # Wildcard
|
|
101
|
-
```
|
|
57
|
+
```typescript
|
|
58
|
+
import { datadogMetric, datadogEvent } from "@jaypie/datadog";
|
|
102
59
|
|
|
103
|
-
|
|
60
|
+
// Send custom metric
|
|
61
|
+
await datadogMetric("checkout.completed", 1, {
|
|
62
|
+
tags: ["env:production", "service:checkout"],
|
|
63
|
+
});
|
|
104
64
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
65
|
+
// Send event
|
|
66
|
+
await datadogEvent({
|
|
67
|
+
title: "Deployment completed",
|
|
68
|
+
text: "Version 1.2.3 deployed to production",
|
|
69
|
+
tags: ["env:production"],
|
|
70
|
+
});
|
|
110
71
|
```
|
|
111
72
|
|
|
112
73
|
## Unified Service Tagging
|
|
@@ -127,3 +88,76 @@ environment: {
|
|
|
127
88
|
}
|
|
128
89
|
```
|
|
129
90
|
|
|
91
|
+
## Environment Variables
|
|
92
|
+
|
|
93
|
+
### CDK Configuration
|
|
94
|
+
|
|
95
|
+
| Variable | Description |
|
|
96
|
+
|----------|-------------|
|
|
97
|
+
| `CDK_ENV_DATADOG_API_KEY_ARN` | Datadog API key ARN in Secrets Manager |
|
|
98
|
+
|
|
99
|
+
### Lambda Environment
|
|
100
|
+
|
|
101
|
+
| Variable | Description |
|
|
102
|
+
|----------|-------------|
|
|
103
|
+
| `DD_ENV` | Environment tag |
|
|
104
|
+
| `DD_SERVICE` | Service tag |
|
|
105
|
+
| `DD_VERSION` | Version tag |
|
|
106
|
+
| `DD_TRACE_ENABLED` | Enable APM tracing |
|
|
107
|
+
| `DD_LOGS_INJECTION` | Inject trace IDs in logs |
|
|
108
|
+
|
|
109
|
+
## Trace Correlation
|
|
110
|
+
|
|
111
|
+
Correlate logs with traces:
|
|
112
|
+
|
|
113
|
+
```typescript
|
|
114
|
+
import { log, getTraceContext } from "jaypie";
|
|
115
|
+
|
|
116
|
+
function processRequest() {
|
|
117
|
+
const traceContext = getTraceContext();
|
|
118
|
+
|
|
119
|
+
log.info("Processing request", {
|
|
120
|
+
...traceContext,
|
|
121
|
+
requestId: "req-123",
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Custom Metrics
|
|
127
|
+
|
|
128
|
+
Send custom metrics from Lambda:
|
|
129
|
+
|
|
130
|
+
```typescript
|
|
131
|
+
import { log } from "jaypie";
|
|
132
|
+
|
|
133
|
+
// Use log for metrics that Datadog indexes
|
|
134
|
+
log.info("MONITORING", {
|
|
135
|
+
metric: "orders.processed",
|
|
136
|
+
value: 1,
|
|
137
|
+
tags: { env: "production", region: "us-east-1" },
|
|
138
|
+
});
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## Testing
|
|
142
|
+
|
|
143
|
+
Mock Datadog in tests:
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
import { datadogMetric } from "@jaypie/datadog";
|
|
147
|
+
import { vi } from "vitest";
|
|
148
|
+
|
|
149
|
+
vi.mock("@jaypie/datadog");
|
|
150
|
+
|
|
151
|
+
describe("CheckoutService", () => {
|
|
152
|
+
it("sends metric on completion", async () => {
|
|
153
|
+
await processCheckout();
|
|
154
|
+
|
|
155
|
+
expect(datadogMetric).toHaveBeenCalledWith(
|
|
156
|
+
"checkout.completed",
|
|
157
|
+
1,
|
|
158
|
+
expect.objectContaining({ tags: expect.any(Array) })
|
|
159
|
+
);
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
```
|
|
163
|
+
|
package/skills/dynamodb.md
CHANGED
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: DynamoDB patterns and queries
|
|
3
|
-
related: aws, cdk, models
|
|
2
|
+
description: DynamoDB code patterns, key design, and queries
|
|
3
|
+
related: aws, cdk, models, tools-dynamodb
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# DynamoDB Patterns
|
|
7
7
|
|
|
8
8
|
Best practices for DynamoDB with Jaypie applications.
|
|
9
9
|
|
|
10
|
-
## MCP
|
|
10
|
+
## MCP Tools
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
aws_dynamodb_describe_table - Get table schema and indexes
|
|
14
|
-
aws_dynamodb_query - Query by partition key (efficient)
|
|
15
|
-
aws_dynamodb_scan - Full table scan (use sparingly)
|
|
16
|
-
aws_dynamodb_get_item - Get single item by key
|
|
17
|
-
```
|
|
12
|
+
For interactive DynamoDB tools (query, scan, get-item, describe-table), see **tools-dynamodb**.
|
|
18
13
|
|
|
19
14
|
## Key Design
|
|
20
15
|
|
|
@@ -48,21 +43,7 @@ Use prefixed keys for multiple entity types:
|
|
|
48
43
|
| List user orders | pk = USER#123, sk begins_with ORDER# |
|
|
49
44
|
| Get specific order | pk = USER#123, sk = ORDER#2024-01-15#abc |
|
|
50
45
|
|
|
51
|
-
## Query
|
|
52
|
-
|
|
53
|
-
### Query via MCP
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
# Get user profile
|
|
57
|
-
aws_dynamodb_get_item --tableName "MyTable" --key '{"pk":{"S":"USER#123"},"sk":{"S":"PROFILE"}}'
|
|
58
|
-
|
|
59
|
-
# List user orders
|
|
60
|
-
aws_dynamodb_query --tableName "MyTable" \
|
|
61
|
-
--keyConditionExpression "pk = :pk AND begins_with(sk, :prefix)" \
|
|
62
|
-
--expressionAttributeValues '{":pk":{"S":"USER#123"},":prefix":{"S":"ORDER#"}}'
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
### Query in Code
|
|
46
|
+
## Query in Code
|
|
66
47
|
|
|
67
48
|
```typescript
|
|
68
49
|
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
|
|
@@ -98,10 +79,15 @@ const result = await client.send(new QueryCommand({
|
|
|
98
79
|
|
|
99
80
|
Query pending orders:
|
|
100
81
|
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
82
|
+
```typescript
|
|
83
|
+
const result = await client.send(new QueryCommand({
|
|
84
|
+
TableName: process.env.CDK_ENV_TABLE,
|
|
85
|
+
IndexName: "gsi1",
|
|
86
|
+
KeyConditionExpression: "gsi1pk = :status",
|
|
87
|
+
ExpressionAttributeValues: {
|
|
88
|
+
":status": "ORDER#pending",
|
|
89
|
+
},
|
|
90
|
+
}));
|
|
105
91
|
```
|
|
106
92
|
|
|
107
93
|
## CDK Table Definition
|
|
@@ -138,3 +124,26 @@ AWS_ACCESS_KEY_ID=local AWS_SECRET_ACCESS_KEY=local \
|
|
|
138
124
|
--endpoint-url http://127.0.0.1:8000
|
|
139
125
|
```
|
|
140
126
|
|
|
127
|
+
## Testing
|
|
128
|
+
|
|
129
|
+
Mock DynamoDB in tests:
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
|
|
133
|
+
import { vi } from "vitest";
|
|
134
|
+
|
|
135
|
+
vi.mock("@aws-sdk/client-dynamodb");
|
|
136
|
+
|
|
137
|
+
describe("OrderService", () => {
|
|
138
|
+
it("queries user orders", async () => {
|
|
139
|
+
vi.mocked(DynamoDBClient.prototype.send).mockResolvedValue({
|
|
140
|
+
Items: [{ pk: "USER#123", sk: "ORDER#abc" }],
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const orders = await getOrders("123");
|
|
144
|
+
|
|
145
|
+
expect(orders).toHaveLength(1);
|
|
146
|
+
});
|
|
147
|
+
});
|
|
148
|
+
```
|
|
149
|
+
|
package/skills/fabric.md
CHANGED
|
@@ -54,10 +54,18 @@ program.addCommand(fabricCommand(greetService));
|
|
|
54
54
|
### MCP Tool
|
|
55
55
|
|
|
56
56
|
```typescript
|
|
57
|
-
import {
|
|
57
|
+
import { fabricMcp, FabricMcpServer } from "@jaypie/fabric/mcp";
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
// Single service registration
|
|
60
|
+
fabricMcp({ service: greetService, server });
|
|
61
|
+
|
|
62
|
+
// Multi-service server (preferred)
|
|
63
|
+
const server = FabricMcpServer({
|
|
64
|
+
name: "my-server",
|
|
65
|
+
version: "1.0.0",
|
|
66
|
+
services: [greetService, searchService],
|
|
67
|
+
});
|
|
68
|
+
// Available as MCP tools "greet" and "search"
|
|
61
69
|
```
|
|
62
70
|
|
|
63
71
|
### LLM Tool
|
|
@@ -97,6 +105,25 @@ const suite = createServiceSuite({
|
|
|
97
105
|
|
|
98
106
|
suite.register(userService, "users");
|
|
99
107
|
suite.register(userListService, "users");
|
|
108
|
+
|
|
109
|
+
// Access services
|
|
110
|
+
suite.services; // ServiceMeta[] - metadata for listing
|
|
111
|
+
suite.getServiceFunctions(); // Service[] - actual functions
|
|
112
|
+
suite.execute("user_get", { id }); // Direct execution
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Suite to MCP Server
|
|
116
|
+
|
|
117
|
+
Connect suites directly to MCP:
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
import { createMcpServerFromSuite } from "@jaypie/fabric/mcp";
|
|
121
|
+
|
|
122
|
+
const server = createMcpServerFromSuite(suite, {
|
|
123
|
+
name: "users-api", // Optional override
|
|
124
|
+
version: "1.0.0",
|
|
125
|
+
});
|
|
126
|
+
// All suite services now available as MCP tools
|
|
100
127
|
```
|
|
101
128
|
|
|
102
129
|
## Input Validation
|
package/skills/issues.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Submitting issues to Jaypie repositories
|
|
3
|
+
related: jaypie, agents
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Jaypie Issues
|
|
7
|
+
|
|
8
|
+
## Repository
|
|
9
|
+
|
|
10
|
+
Submit issues to: **github.com/finlaysonstudio/jaypie**
|
|
11
|
+
|
|
12
|
+
## Agent Guidelines
|
|
13
|
+
|
|
14
|
+
**CRITICAL: Never submit issues without explicit user approval.**
|
|
15
|
+
|
|
16
|
+
Before creating an issue:
|
|
17
|
+
1. Draft the issue title and body
|
|
18
|
+
2. Present the draft to the user
|
|
19
|
+
3. Wait for explicit approval ("yes", "submit it", etc.)
|
|
20
|
+
4. Only then use `mcp__github__issue_write` to create the issue
|
|
21
|
+
|
|
22
|
+
## Issue Format
|
|
23
|
+
|
|
24
|
+
```markdown
|
|
25
|
+
**Title**: [Brief, descriptive title]
|
|
26
|
+
|
|
27
|
+
**Description**:
|
|
28
|
+
[What is the issue or feature request]
|
|
29
|
+
|
|
30
|
+
**Context**:
|
|
31
|
+
- Package: [affected package, e.g., `jaypie`, `@jaypie/express`]
|
|
32
|
+
- Version: [if known]
|
|
33
|
+
- Environment: [if relevant]
|
|
34
|
+
|
|
35
|
+
**Steps to Reproduce** (for bugs):
|
|
36
|
+
1. ...
|
|
37
|
+
2. ...
|
|
38
|
+
|
|
39
|
+
**Expected Behavior**:
|
|
40
|
+
[What should happen]
|
|
41
|
+
|
|
42
|
+
**Actual Behavior**:
|
|
43
|
+
[What actually happens]
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Labels
|
|
47
|
+
|
|
48
|
+
Common labels: `bug`, `enhancement`, `documentation`, `question`
|
|
49
|
+
|
|
50
|
+
## When to Suggest Issues
|
|
51
|
+
|
|
52
|
+
- Bugs in Jaypie packages discovered during development
|
|
53
|
+
- Missing features that would benefit multiple projects
|
|
54
|
+
- Documentation gaps or errors
|
|
55
|
+
- API inconsistencies
|