@jaypie/mcp 0.7.3 → 0.7.6

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.
@@ -0,0 +1,166 @@
1
+ ---
2
+ description: Initialize a Jaypie monorepo project
3
+ related: subpackage, cicd, style, tests
4
+ ---
5
+
6
+ # Jaypie Monorepo Setup
7
+
8
+ Initialize a new monorepo using Jaypie conventions and utilities.
9
+
10
+ ## Overview
11
+
12
+ - ESLint 9+ flat config with @jaypie/eslint
13
+ - NPM with Workspaces ("monorepo")
14
+ - TypeScript with ESM modules
15
+ - Vite for building, Vitest for testing
16
+ - Node.js 22, 24, 25 support
17
+
18
+ ## Process
19
+
20
+ 1. Create root configuration files
21
+ 2. Install dev dependencies
22
+ 3. Configure workspaces
23
+
24
+ ## Root Files
25
+
26
+ ### package.json
27
+
28
+ ```json
29
+ {
30
+ "name": "@project-org/monorepo",
31
+ "version": "0.0.1",
32
+ "private": true,
33
+ "type": "module",
34
+ "workspaces": [
35
+ "packages/*"
36
+ ],
37
+ "scripts": {
38
+ "build": "npm run build --workspaces --if-present",
39
+ "clean": "rimraf ./packages/*/dist",
40
+ "format": "npm run format:package && npm run format:lint",
41
+ "format:lint": "eslint --fix .",
42
+ "format:package": "sort-package-json ./package.json ./packages/*/package.json",
43
+ "lint": "eslint --quiet .",
44
+ "test": "vitest run",
45
+ "typecheck": "npm run typecheck --workspaces --if-present"
46
+ }
47
+ }
48
+ ```
49
+
50
+ ### eslint.config.mjs
51
+
52
+ ```javascript
53
+ export { default } from "@jaypie/eslint";
54
+ ```
55
+
56
+ For projects needing custom rules:
57
+
58
+ ```javascript
59
+ import jaypie from "@jaypie/eslint";
60
+
61
+ export default [
62
+ ...jaypie,
63
+ {
64
+ ignores: ["LOCAL/**"],
65
+ },
66
+ ];
67
+ ```
68
+
69
+ ### tsconfig.json (root)
70
+
71
+ ```json
72
+ {
73
+ "compilerOptions": {
74
+ "target": "ES2020",
75
+ "module": "ESNext",
76
+ "moduleResolution": "bundler",
77
+ "declaration": true,
78
+ "strict": true,
79
+ "esModuleInterop": true,
80
+ "skipLibCheck": true,
81
+ "forceConsistentCasingInFileNames": true
82
+ },
83
+ "exclude": ["node_modules", "dist"]
84
+ }
85
+ ```
86
+
87
+ ### vitest.workspace.ts
88
+
89
+ ```typescript
90
+ export default ["packages/*/vitest.config.{ts,js}"];
91
+ ```
92
+
93
+ ### .gitignore
94
+
95
+ ```
96
+ .DS_Store
97
+ node_modules
98
+ dist
99
+
100
+ # Local env files
101
+ .env
102
+ .env.local
103
+ .env.*.local
104
+
105
+ # Log files
106
+ npm-debug.log*
107
+
108
+ # Editor directories
109
+ .idea
110
+ *.sw?
111
+
112
+ # Build artifacts
113
+ *.tsbuildinfo
114
+ ```
115
+
116
+ ### .vscode/settings.json
117
+
118
+ ```json
119
+ {
120
+ "editor.formatOnSave": true,
121
+ "editor.codeActionsOnSave": {
122
+ "source.fixAll.eslint": "explicit"
123
+ },
124
+ "typescript.preferences.importModuleSpecifier": "relative"
125
+ }
126
+ ```
127
+
128
+ ## Installation
129
+
130
+ Install root dev dependencies:
131
+
132
+ ```bash
133
+ npm install --save-dev @jaypie/eslint @jaypie/testkit eslint rimraf sort-package-json tsx vite vite-plugin-dts vitest
134
+ ```
135
+
136
+ ## Workspace Conventions
137
+
138
+ | Directory | Purpose |
139
+ |-----------|---------|
140
+ | `packages/` | npm packages (default workspace) |
141
+ | `stacks/` | CDK-deployed infrastructure and sites |
142
+
143
+ ## Scripts Reference
144
+
145
+ | Script | Top-level | Package-level |
146
+ |--------|-----------|---------------|
147
+ | `build` | `npm run build --workspaces` | `vite build` |
148
+ | `clean` | `rimraf ./packages/*/dist` | `rimraf dist` |
149
+ | `format` | `eslint --fix .` | `eslint --fix` |
150
+ | `format:package` | `sort-package-json ./package.json ./packages/*/package.json` | `sort-package-json` |
151
+ | `lint` | `eslint --quiet .` | `eslint` |
152
+ | `test` | `vitest run` | `vitest run` |
153
+ | `typecheck` | `npm run typecheck --workspaces` | `tsc --noEmit` |
154
+
155
+ ## Guidelines
156
+
157
+ - Run `npm install` to generate package-lock.json (do not hard-code versions)
158
+ - Use `"version": "0.0.1"`, `"type": "module"`, and `"private": true` for new packages
159
+ - Do not include authors, keywords, or external links in package.json
160
+ - If this is the first commit, commit directly to main; otherwise create a branch
161
+
162
+ ## Next Steps
163
+
164
+ - `skill("subpackage")` - Create packages within the monorepo
165
+ - `skill("cicd")` - Add GitHub Actions workflows
166
+ - `skill("tests")` - Testing patterns with Vitest
package/skills/skills.md CHANGED
@@ -16,7 +16,7 @@ Look up skills by alias: `mcp__jaypie__skill(alias)`
16
16
  | Category | Skills |
17
17
  |----------|--------|
18
18
  | contents | index, releasenotes |
19
- | development | documentation, errors, logs, mocks, style, tests |
20
- | infrastructure | aws, cdk, cicd, datadog, dns, dynamodb, express, lambda, secrets, variables |
19
+ | development | documentation, errors, logs, mocks, monorepo, style, subpackages, tests |
20
+ | infrastructure | aws, cdk, cicd, datadog, dns, dynamodb, express, lambda, secrets, streaming, variables, websockets |
21
21
  | patterns | fabric, handlers, models, services, vocabulary |
22
22
  | meta | issues, jaypie, skills, tools |
@@ -0,0 +1,219 @@
1
+ ---
2
+ description: Create a subpackage within a monorepo
3
+ related: monorepo, tests, style
4
+ ---
5
+
6
+ # Jaypie Subpackage Setup
7
+
8
+ Create a new subpackage within an existing Jaypie monorepo.
9
+
10
+ ## Overview
11
+
12
+ - TypeScript subpackage with Vite/Vitest
13
+ - Standard Jaypie project structure
14
+ - NPM workspace integration
15
+ - ESLint configuration inheritance
16
+
17
+ ## Guidelines
18
+
19
+ - Subpackage names follow `@project-org/package-name` pattern
20
+ - Use `"version": "0.0.1"`, `"type": "module"`, and `"private": true`
21
+ - Place packages in `packages/<package-name>/` directory
22
+ - Use Vite for new TypeScript packages
23
+ - Never manually edit package.json for dependencies; use npm commands
24
+
25
+ ## Process
26
+
27
+ 1. Create package directory structure
28
+ 2. Create configuration files from templates
29
+ 3. Create basic src structure
30
+ 4. Update workspace configuration
31
+ 5. Install dependencies
32
+
33
+ ## Directory Structure
34
+
35
+ ```
36
+ packages/<package-name>/
37
+ ├── src/
38
+ │ ├── index.ts
39
+ │ └── __tests__/
40
+ │ └── index.spec.ts
41
+ ├── package.json
42
+ ├── tsconfig.json
43
+ ├── vite.config.ts
44
+ ├── vitest.config.ts
45
+ └── vitest.setup.ts
46
+ ```
47
+
48
+ ## Template Files
49
+
50
+ ### package.json
51
+
52
+ ```json
53
+ {
54
+ "name": "@project-org/package-name",
55
+ "version": "0.0.1",
56
+ "type": "module",
57
+ "private": true,
58
+ "scripts": {
59
+ "build": "vite build",
60
+ "clean": "rimraf dist",
61
+ "format": "eslint --fix",
62
+ "format:package": "sort-package-json",
63
+ "lint": "eslint",
64
+ "test": "vitest run",
65
+ "test:watch": "vitest watch",
66
+ "typecheck": "tsc --noEmit"
67
+ }
68
+ }
69
+ ```
70
+
71
+ ### tsconfig.json
72
+
73
+ ```json
74
+ {
75
+ "compilerOptions": {
76
+ "target": "ES2020",
77
+ "module": "ESNext",
78
+ "moduleResolution": "bundler",
79
+ "declaration": true,
80
+ "outDir": "./dist",
81
+ "strict": true,
82
+ "esModuleInterop": true,
83
+ "skipLibCheck": true,
84
+ "forceConsistentCasingInFileNames": true
85
+ },
86
+ "exclude": ["node_modules", "dist"],
87
+ "include": ["src/**/*"]
88
+ }
89
+ ```
90
+
91
+ ### vite.config.ts
92
+
93
+ ```typescript
94
+ import { defineConfig } from "vite";
95
+ import dts from "vite-plugin-dts";
96
+
97
+ export default defineConfig({
98
+ plugins: [
99
+ dts({
100
+ include: ["src"],
101
+ exclude: ["**/*.spec.ts"],
102
+ }),
103
+ ],
104
+ build: {
105
+ lib: {
106
+ entry: "./src/index.ts",
107
+ name: "PackageName",
108
+ fileName: "index",
109
+ formats: ["es"],
110
+ },
111
+ rollupOptions: {
112
+ external: [
113
+ // Add external dependencies here
114
+ "jaypie",
115
+ ],
116
+ },
117
+ target: "node22",
118
+ },
119
+ });
120
+ ```
121
+
122
+ ### vitest.config.ts
123
+
124
+ ```typescript
125
+ import { defineConfig } from "vitest/config";
126
+
127
+ export default defineConfig({
128
+ test: {
129
+ globals: true,
130
+ environment: "node",
131
+ setupFiles: ["./vitest.setup.ts"],
132
+ },
133
+ });
134
+ ```
135
+
136
+ ### vitest.setup.ts
137
+
138
+ ```typescript
139
+ import { matchers as jaypieMatchers } from "@jaypie/testkit";
140
+ import * as extendedMatchers from "jest-extended";
141
+ import { expect } from "vitest";
142
+
143
+ expect.extend(extendedMatchers);
144
+ expect.extend(jaypieMatchers);
145
+ ```
146
+
147
+ ### src/index.ts
148
+
149
+ ```typescript
150
+ // Export public API here
151
+ export {};
152
+ ```
153
+
154
+ ### src/__tests__/index.spec.ts
155
+
156
+ ```typescript
157
+ import { describe, expect, it } from "vitest";
158
+
159
+ describe("Package Name", () => {
160
+ describe("Base Cases", () => {
161
+ it("is a function", () => {
162
+ // Replace with actual export test
163
+ expect(true).toBe(true);
164
+ });
165
+ });
166
+
167
+ describe("Happy Paths", () => {
168
+ it("works", () => {
169
+ // Add happy path tests
170
+ expect(true).toBe(true);
171
+ });
172
+ });
173
+ });
174
+ ```
175
+
176
+ ## Installation Commands
177
+
178
+ Add dependencies to the subpackage:
179
+
180
+ ```bash
181
+ # Runtime dependencies
182
+ npm install <package-name> --workspace ./packages/<package-name>
183
+
184
+ # Dev dependencies
185
+ npm install <package-name> --workspace ./packages/<package-name> --save-dev
186
+ ```
187
+
188
+ Common dev dependencies for subpackages:
189
+
190
+ ```bash
191
+ npm install jest-extended --workspace ./packages/<package-name> --save-dev
192
+ ```
193
+
194
+ ## Workspace Configuration
195
+
196
+ The root `vitest.workspace.ts` uses a glob pattern that auto-discovers packages:
197
+
198
+ ```typescript
199
+ export default ["packages/*/vitest.config.{ts,js}"];
200
+ ```
201
+
202
+ New packages are automatically included when they have a `vitest.config.ts`.
203
+
204
+ ## Checklist
205
+
206
+ After creating a subpackage:
207
+
208
+ 1. ✅ Update package name in `package.json`
209
+ 2. ✅ Update `name` in `vite.config.ts` build.lib
210
+ 3. ✅ Add external dependencies to `rollupOptions.external`
211
+ 4. ✅ Run `npm install` from root to link workspace
212
+ 5. ✅ Verify with `npm run build -w packages/<package-name>`
213
+ 6. ✅ Verify with `npm run test -w packages/<package-name>`
214
+
215
+ ## Next Steps
216
+
217
+ - `skill("tests")` - Testing patterns with Vitest
218
+ - `skill("mocks")` - Mock patterns via @jaypie/testkit
219
+ - `skill("style")` - Code style conventions
@@ -0,0 +1,98 @@
1
+ ---
2
+ description: LLM MCP tool for debugging provider responses
3
+ related: llm, tools
4
+ ---
5
+
6
+ # LLM MCP Tool
7
+
8
+ Debug and inspect LLM provider responses. Useful for understanding how providers format responses and troubleshooting API integrations.
9
+
10
+ ## Usage
11
+
12
+ ```
13
+ llm() # Show help
14
+ llm("command", { ...params }) # Execute a command
15
+ ```
16
+
17
+ ## Commands
18
+
19
+ | Command | Description |
20
+ |---------|-------------|
21
+ | `list_providers` | List available LLM providers and their status |
22
+ | `debug_call` | Make a debug call to an LLM provider |
23
+
24
+ ## List Providers
25
+
26
+ Check which providers are configured:
27
+
28
+ ```
29
+ llm("list_providers")
30
+ ```
31
+
32
+ Returns provider availability based on environment variables.
33
+
34
+ ## Debug Call
35
+
36
+ Make a test call to inspect the raw response:
37
+
38
+ ```
39
+ llm("debug_call", { provider: "openai", message: "Hello, world!" })
40
+ llm("debug_call", { provider: "anthropic", message: "Hello, world!" })
41
+ llm("debug_call", { provider: "openai", model: "o3-mini", message: "What is 15 * 17?" })
42
+ ```
43
+
44
+ ### Parameters
45
+
46
+ | Parameter | Required | Description |
47
+ |-----------|----------|-------------|
48
+ | `provider` | Yes | Provider name: `openai`, `anthropic`, `gemini`, `openrouter` |
49
+ | `message` | Yes | Message to send |
50
+ | `model` | No | Specific model to use |
51
+
52
+ ### Response Fields
53
+
54
+ | Field | Description |
55
+ |-------|-------------|
56
+ | `content` | The response text |
57
+ | `reasoning` | Extracted reasoning/thinking content (if available) |
58
+ | `reasoningTokens` | Count of reasoning tokens used |
59
+ | `history` | Full conversation history |
60
+ | `rawResponses` | Raw API responses for debugging |
61
+ | `usage` | Token usage statistics |
62
+
63
+ ## Environment Variables
64
+
65
+ | Variable | Description |
66
+ |----------|-------------|
67
+ | `OPENAI_API_KEY` | OpenAI API key |
68
+ | `ANTHROPIC_API_KEY` | Anthropic API key |
69
+ | `GOOGLE_API_KEY` | Google/Gemini API key |
70
+ | `OPENROUTER_API_KEY` | OpenRouter API key |
71
+
72
+ ## Supported Providers
73
+
74
+ | Provider | Models |
75
+ |----------|--------|
76
+ | `openai` | gpt-4o, gpt-4o-mini, o1, o3-mini, etc. |
77
+ | `anthropic` | claude-sonnet-4-20250514, claude-opus-4-20250514, etc. |
78
+ | `gemini` | gemini-2.0-flash, gemini-1.5-pro, etc. |
79
+ | `openrouter` | Access to multiple providers |
80
+
81
+ ## Common Patterns
82
+
83
+ ### Compare Provider Responses
84
+
85
+ ```
86
+ llm("debug_call", { provider: "openai", message: "Explain recursion briefly" })
87
+ llm("debug_call", { provider: "anthropic", message: "Explain recursion briefly" })
88
+ ```
89
+
90
+ ### Test Reasoning Models
91
+
92
+ ```
93
+ llm("debug_call", { provider: "openai", model: "o3-mini", message: "Solve: If 3x + 5 = 14, what is x?" })
94
+ ```
95
+
96
+ ### Check Token Usage
97
+
98
+ Use `debug_call` to inspect the `usage` field for token consumption analysis.
package/skills/tools.md CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  description: Available MCP tools reference
3
- related: tools-aws, tools-dynamodb, tools-datadog, debugging
3
+ related: tools-aws, tools-datadog, tools-dynamodb, tools-llm, debugging
4
4
  ---
5
5
 
6
6
  # MCP Tools Reference
@@ -79,6 +79,10 @@ datadog("monitors", { status: ["Alert", "Warn"] })
79
79
 
80
80
  ## LLM Tool
81
81
 
82
+ Debug and inspect LLM provider responses.
83
+
84
+ See **tools-llm** for complete documentation.
85
+
82
86
  ```
83
87
  llm() # Show help
84
88
  llm("list_providers") # List available LLM providers
@@ -103,3 +107,9 @@ llm("debug_call", { provider: "openai", message: "Hello" })
103
107
  - `DD_SERVICE` - Default service filter
104
108
  - `DD_SOURCE` - Default log source
105
109
 
110
+ ### LLM Tools
111
+ - `OPENAI_API_KEY` - OpenAI API key
112
+ - `ANTHROPIC_API_KEY` - Anthropic API key
113
+ - `GOOGLE_API_KEY` - Google/Gemini API key
114
+ - `OPENROUTER_API_KEY` - OpenRouter API key
115
+