@iblai/mcp 1.0.0 → 1.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 +95 -142
- package/dist/index.js +129 -97
- package/dist/index.js.map +1 -1
- package/dist/prompts/create-playwright-test.d.ts +2 -0
- package/dist/prompts/create-playwright-test.d.ts.map +1 -0
- package/dist/prompts/create-playwright-test.js +99 -0
- package/dist/prompts/create-playwright-test.js.map +1 -0
- package/dist/prompts/index.d.ts +4 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +4 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/setup-e2e-testing.d.ts +2 -0
- package/dist/prompts/setup-e2e-testing.d.ts.map +1 -0
- package/dist/prompts/setup-e2e-testing.js +162 -0
- package/dist/prompts/setup-e2e-testing.js.map +1 -0
- package/dist/prompts/setup-new-app.d.ts +2 -0
- package/dist/prompts/setup-new-app.d.ts.map +1 -0
- package/dist/prompts/setup-new-app.js +226 -0
- package/dist/prompts/setup-new-app.js.map +1 -0
- package/dist/resources/data-layer.js +14 -14
- package/dist/resources/guides-layout.js +5 -5
- package/dist/resources/guides-playwright.d.ts +8 -0
- package/dist/resources/guides-playwright.d.ts.map +1 -0
- package/dist/resources/guides-playwright.js +235 -0
- package/dist/resources/guides-playwright.js.map +1 -0
- package/dist/resources/guides-rbac.js +2 -2
- package/dist/resources/guides-theme.js +4 -4
- package/dist/resources/index.d.ts +3 -1
- package/dist/resources/index.d.ts.map +1 -1
- package/dist/resources/index.js +5 -1
- package/dist/resources/index.js.map +1 -1
- package/dist/resources/packages-overview.d.ts.map +1 -1
- package/dist/resources/packages-overview.js +12 -6
- package/dist/resources/packages-overview.js.map +1 -1
- package/dist/resources/packages-playwright.d.ts +8 -0
- package/dist/resources/packages-playwright.d.ts.map +1 -0
- package/dist/resources/packages-playwright.js +161 -0
- package/dist/resources/packages-playwright.js.map +1 -0
- package/dist/resources/web-containers.d.ts.map +1 -1
- package/dist/resources/web-containers.js +82 -22
- package/dist/resources/web-containers.js.map +1 -1
- package/dist/resources/web-utils.d.ts.map +1 -1
- package/dist/resources/web-utils.js +46 -9
- package/dist/resources/web-utils.js.map +1 -1
- package/dist/tools/api-query-info.d.ts.map +1 -1
- package/dist/tools/api-query-info.js +248 -238
- package/dist/tools/api-query-info.js.map +1 -1
- package/dist/tools/component-info.d.ts.map +1 -1
- package/dist/tools/component-info.js +945 -469
- package/dist/tools/component-info.js.map +1 -1
- package/dist/tools/hook-info.d.ts.map +1 -1
- package/dist/tools/hook-info.js +229 -98
- package/dist/tools/hook-info.js.map +1 -1
- package/dist/tools/index.d.ts +15 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/page-template.js +8 -8
- package/dist/tools/page-template.js.map +1 -1
- package/dist/tools/playwright-helper-info.d.ts +16 -0
- package/dist/tools/playwright-helper-info.d.ts.map +1 -0
- package/dist/tools/playwright-helper-info.js +849 -0
- package/dist/tools/playwright-helper-info.js.map +1 -0
- package/dist/tools/provider-setup.js +4 -4
- package/dist/tools/provider-setup.js.map +1 -1
- package/package.json +19 -6
package/README.md
CHANGED
|
@@ -1,199 +1,152 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @iblai/mcp
|
|
2
2
|
|
|
3
|
-
An MCP (Model Context Protocol) server that provides comprehensive documentation
|
|
4
|
-
|
|
5
|
-
## Overview
|
|
6
|
-
|
|
7
|
-
This MCP server helps AI assistants understand and work with:
|
|
8
|
-
|
|
9
|
-
- **@iblai/web-containers**: Shared React components built on Radix UI
|
|
10
|
-
- **@iblai/web-utils**: Authentication utilities, context providers, and hooks
|
|
11
|
-
- **@iblai/data-layer**: Redux store and RTK Query APIs
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
cd packages/mcp-server
|
|
17
|
-
pnpm install
|
|
18
|
-
pnpm build
|
|
19
|
-
```
|
|
3
|
+
An MCP (Model Context Protocol) server that provides AI assistants with comprehensive documentation for the IBL frontend packages — components, hooks, API queries, provider setup patterns, and Playwright test helpers.
|
|
20
4
|
|
|
21
5
|
## Quick Start
|
|
22
6
|
|
|
23
|
-
|
|
24
|
-
# 1. Build the MCP server
|
|
25
|
-
cd packages/mcp-server
|
|
26
|
-
pnpm build
|
|
7
|
+
### With Claude Code
|
|
27
8
|
|
|
28
|
-
|
|
29
|
-
#
|
|
9
|
+
```bash
|
|
10
|
+
# No install needed — just add and go
|
|
11
|
+
claude mcp add --transport stdio iblai-js-mcp -- npx @iblai/mcp
|
|
30
12
|
```
|
|
31
13
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
## Configuration
|
|
35
|
-
|
|
36
|
-
The MCP server is pre-configured in `.claude/settings.json`:
|
|
14
|
+
Or share with your team by creating `.mcp.json` at your project root:
|
|
37
15
|
|
|
38
16
|
```json
|
|
39
17
|
{
|
|
40
18
|
"mcpServers": {
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"args": ["packages/mcp-server/dist/index.js"]
|
|
19
|
+
"iblai-js-mcp": {
|
|
20
|
+
"command": "npx",
|
|
21
|
+
"args": ["@iblai/mcp"]
|
|
45
22
|
}
|
|
46
23
|
}
|
|
47
24
|
}
|
|
48
25
|
```
|
|
49
26
|
|
|
50
|
-
|
|
27
|
+
> **pnpm projects:** If your project uses pnpm and has `@iblai/iblai-js` installed (which depends on `@iblai/mcp`), `npx` may find the transitive dependency locally but fail to link its binary. Use `pnpm dlx` instead:
|
|
28
|
+
>
|
|
29
|
+
> ```bash
|
|
30
|
+
> claude mcp add --transport stdio iblai-js-mcp -- pnpm dlx @iblai/mcp
|
|
31
|
+
> ```
|
|
32
|
+
>
|
|
33
|
+
> Or in `.mcp.json`:
|
|
34
|
+
>
|
|
35
|
+
> ```json
|
|
36
|
+
> {
|
|
37
|
+
> "mcpServers": {
|
|
38
|
+
> "iblai-js-mcp": {
|
|
39
|
+
> "command": "pnpm",
|
|
40
|
+
> "args": ["dlx", "@iblai/mcp"]
|
|
41
|
+
> }
|
|
42
|
+
> }
|
|
43
|
+
> }
|
|
44
|
+
> ```
|
|
45
|
+
|
|
46
|
+
### With Other MCP Clients
|
|
47
|
+
|
|
48
|
+
The server uses stdio transport and follows the [MCP specification](https://modelcontextprotocol.io):
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
├── src/
|
|
57
|
-
│ ├── index.ts # Main server entry point
|
|
58
|
-
│ ├── resources/ # Documentation resources
|
|
59
|
-
│ │ ├── index.ts # Resource exports
|
|
60
|
-
│ │ ├── packages-overview.ts
|
|
61
|
-
│ │ ├── web-containers.ts
|
|
62
|
-
│ │ ├── web-utils.ts
|
|
63
|
-
│ │ ├── data-layer.ts
|
|
64
|
-
│ │ ├── guides-layout.ts
|
|
65
|
-
│ │ ├── guides-rbac.ts
|
|
66
|
-
│ │ └── guides-theme.ts
|
|
67
|
-
│ └── tools/ # MCP tools
|
|
68
|
-
│ ├── index.ts # Tool exports
|
|
69
|
-
│ ├── component-info.ts
|
|
70
|
-
│ ├── hook-info.ts
|
|
71
|
-
│ ├── provider-setup.ts
|
|
72
|
-
│ ├── api-query-info.ts
|
|
73
|
-
│ └── page-template.ts
|
|
74
|
-
└── dist/ # Compiled output
|
|
50
|
+
```bash
|
|
51
|
+
npx @iblai/mcp
|
|
52
|
+
# or in pnpm projects:
|
|
53
|
+
pnpm dlx @iblai/mcp
|
|
75
54
|
```
|
|
76
55
|
|
|
77
|
-
##
|
|
56
|
+
## What It Provides
|
|
57
|
+
|
|
58
|
+
### Tools
|
|
78
59
|
|
|
79
|
-
|
|
60
|
+
| Tool | Description |
|
|
61
|
+
| --- | --- |
|
|
62
|
+
| `get_component_info` | Detailed props, usage examples, and category for any UI component |
|
|
63
|
+
| `get_hook_info` | Parameters, return types, and examples for React hooks |
|
|
64
|
+
| `get_api_query_info` | RTK Query endpoint details and usage patterns |
|
|
65
|
+
| `get_provider_setup` | Correct provider hierarchy for each app type (mentor, skills, auth) |
|
|
66
|
+
| `create_page_template` | Generate new pages following IBL patterns |
|
|
67
|
+
| `get_playwright_helper_info` | E2E test helper documentation |
|
|
68
|
+
|
|
69
|
+
### Resources
|
|
80
70
|
|
|
81
71
|
| Resource URI | Description |
|
|
82
|
-
|
|
72
|
+
| --- | --- |
|
|
83
73
|
| `ibl://packages/overview` | Overview of all IBL frontend packages |
|
|
84
74
|
| `ibl://packages/web-containers` | UI components documentation |
|
|
85
75
|
| `ibl://packages/web-utils` | Providers and hooks documentation |
|
|
86
76
|
| `ibl://packages/data-layer` | Redux and RTK Query documentation |
|
|
77
|
+
| `ibl://packages/playwright` | Playwright test utilities documentation |
|
|
87
78
|
| `ibl://guides/layout` | Layout rules and patterns |
|
|
88
79
|
| `ibl://guides/rbac` | RBAC (Role-Based Access Control) patterns |
|
|
89
80
|
| `ibl://guides/theme` | Theme configuration |
|
|
81
|
+
| `ibl://guides/playwright` | E2E testing setup guide |
|
|
90
82
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
### get_component_info
|
|
83
|
+
### Prompts
|
|
94
84
|
|
|
95
|
-
|
|
85
|
+
| Prompt | Description |
|
|
86
|
+
| --- | --- |
|
|
87
|
+
| `setup-new-app` | Step-by-step guide for setting up a new IBL app |
|
|
88
|
+
| `setup-e2e-testing` | Guide for setting up Playwright E2E tests |
|
|
89
|
+
| `create-playwright-test` | Template for writing a new Playwright test |
|
|
96
90
|
|
|
97
|
-
|
|
98
|
-
Component name: Button, Card, Dialog, Profile, NotificationDropdown, Input, Select, Tabs, etc.
|
|
99
|
-
```
|
|
91
|
+
## Packages Covered
|
|
100
92
|
|
|
101
|
-
|
|
93
|
+
- **@iblai/web-containers** — Shared React components (Radix UI primitives, feature components)
|
|
94
|
+
- **@iblai/web-utils** — Authentication, context providers, chat hooks, utilities
|
|
95
|
+
- **@iblai/data-layer** — Redux store, RTK Query API slices
|
|
96
|
+
- **@iblai/iblai-js/playwright** — Playwright test helpers, auth setup, config generation
|
|
102
97
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
Hook name: useAdvancedChat, useMentorSettings, useGetMentorsQuery, useTenantMetadata, etc.
|
|
107
|
-
```
|
|
98
|
+
## Alternative Installation
|
|
108
99
|
|
|
109
|
-
|
|
100
|
+
If you install `@iblai/iblai-js` globally, the MCP server is available as a binary:
|
|
110
101
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
App type: mentor, skills, auth, custom
|
|
115
|
-
Features: chat, analytics, notifications, rbac
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
### get_api_query_info
|
|
119
|
-
|
|
120
|
-
Get information about an RTK Query API endpoint.
|
|
121
|
-
|
|
122
|
-
```
|
|
123
|
-
Query name: useGetMentorsQuery, useGetUserMetadataQuery, usePlatformUserGroupsQuery, etc.
|
|
102
|
+
```bash
|
|
103
|
+
npm install -g @iblai/iblai-js
|
|
104
|
+
claude mcp add --transport stdio iblai-js-mcp -- ibl-mcp-server
|
|
124
105
|
```
|
|
125
106
|
|
|
126
|
-
|
|
107
|
+
## Development (Monorepo Contributors)
|
|
127
108
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
Page name: Dashboard, Settings, etc.
|
|
132
|
-
Features: auth-required, rbac, analytics, sidebar, data-fetching
|
|
133
|
-
App type: mentor, skills
|
|
134
|
-
```
|
|
135
|
-
|
|
136
|
-
## Development
|
|
109
|
+
### Local Setup
|
|
137
110
|
|
|
138
111
|
```bash
|
|
139
|
-
|
|
140
|
-
pnpm
|
|
141
|
-
|
|
142
|
-
# Build
|
|
112
|
+
cd packages/mcp-server
|
|
113
|
+
pnpm install
|
|
143
114
|
pnpm build
|
|
144
|
-
|
|
145
|
-
# Run server directly
|
|
146
|
-
pnpm start
|
|
147
115
|
```
|
|
148
116
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### Provider Hierarchy
|
|
117
|
+
The server is pre-configured in `.mcp.json` at the repo root to use the local build.
|
|
152
118
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
**Skills App:**
|
|
156
|
-
```
|
|
157
|
-
StoreProvider → AuthProvider → TenantProvider → ClientLayout
|
|
158
|
-
```
|
|
119
|
+
### Validating Documentation Coverage
|
|
159
120
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
StoreProvider → AuthProvider → TenantProvider → MentorProvider → AppProvider
|
|
121
|
+
```bash
|
|
122
|
+
pnpm --filter=@iblai/mcp run validate:exports
|
|
163
123
|
```
|
|
164
124
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
```typescript
|
|
168
|
-
// Data Layer
|
|
169
|
-
import { useGetMentorsQuery, mentorReducer } from '@iblai/data-layer';
|
|
125
|
+
This checks that MCP docs stay in sync with actual package exports. CI will fail on PRs that introduce drift. To allowlist intentionally undocumented exports, add them to `scripts/export-allowlist.json`.
|
|
170
126
|
|
|
171
|
-
|
|
172
|
-
import { Button, Card, Dialog } from '@iblai/web-containers';
|
|
127
|
+
### Project Structure
|
|
173
128
|
|
|
174
|
-
|
|
175
|
-
|
|
129
|
+
```
|
|
130
|
+
packages/mcp-server/
|
|
131
|
+
├── src/
|
|
132
|
+
│ ├── index.ts # Server entry point (McpServer API)
|
|
133
|
+
│ ├── resources/ # Documentation resources
|
|
134
|
+
│ ├── tools/ # MCP tools (component-info, hook-info, etc.)
|
|
135
|
+
│ └── prompts/ # MCP prompts (setup guides, templates)
|
|
136
|
+
├── scripts/
|
|
137
|
+
│ ├── validate-exports.ts # Export drift detection script
|
|
138
|
+
│ └── export-allowlist.json # Intentionally undocumented exports
|
|
139
|
+
└── dist/ # Compiled output
|
|
176
140
|
```
|
|
177
141
|
|
|
178
|
-
###
|
|
179
|
-
|
|
180
|
-
```typescript
|
|
181
|
-
import { WithPermissions } from '@/hoc/withPermissions';
|
|
142
|
+
### Adding Documentation
|
|
182
143
|
|
|
183
|
-
|
|
184
|
-
{({ hasPermission }) => hasPermission && <AnalyticsButton />}
|
|
185
|
-
</WithPermissions>
|
|
186
|
-
```
|
|
144
|
+
**New resource:** Create a file in `src/resources/`, export it from `src/resources/index.ts`, and register it in `src/index.ts`.
|
|
187
145
|
|
|
188
|
-
|
|
146
|
+
**New tool:** Create a file in `src/tools/`, export it from `src/tools/index.ts`, and register it in `src/index.ts`.
|
|
189
147
|
|
|
190
|
-
|
|
191
|
-
2. Export the resource object with `uri`, `name`, `description`, `mimeType`, and `content`
|
|
192
|
-
3. Import and add it to `src/resources/index.ts`
|
|
148
|
+
**New prompt:** Create a file in `src/prompts/`, export it from `src/prompts/index.ts`, and register it in `src/index.ts`.
|
|
193
149
|
|
|
194
|
-
##
|
|
150
|
+
## License
|
|
195
151
|
|
|
196
|
-
|
|
197
|
-
2. Export the tool definition and handler function
|
|
198
|
-
3. Import and add it to `src/tools/index.ts`
|
|
199
|
-
4. Add the case handler in `src/index.ts`
|
|
152
|
+
ISC
|
package/dist/index.js
CHANGED
|
@@ -1,123 +1,155 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
3
3
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
4
|
-
import {
|
|
4
|
+
import { z } from 'zod';
|
|
5
5
|
// Import resources
|
|
6
6
|
import { RESOURCES } from './resources/index.js';
|
|
7
7
|
// Import tools
|
|
8
|
-
import {
|
|
8
|
+
import { getComponentInfo, getHookInfo, getProviderSetup, getApiQueryInfo, createPageTemplate, getPlaywrightHelperInfo, } from './tools/index.js';
|
|
9
|
+
// Import prompts
|
|
10
|
+
import { generateE2ESetupPrompt, generateCreateTestPrompt, generateSetupNewAppPrompt, } from './prompts/index.js';
|
|
9
11
|
// ============================================================================
|
|
10
12
|
// IBL FRONTEND MCP SERVER
|
|
11
13
|
// ============================================================================
|
|
12
14
|
// This MCP server provides comprehensive documentation and guidance for
|
|
13
|
-
// working with the IBL frontend packages: web-containers, web-utils,
|
|
15
|
+
// working with the IBL frontend packages: web-containers, web-utils,
|
|
16
|
+
// data-layer, and @iblai/iblai-js/playwright
|
|
14
17
|
// ============================================================================
|
|
15
|
-
const server = new
|
|
18
|
+
const server = new McpServer({
|
|
16
19
|
name: 'ibl-frontend-mcp',
|
|
17
20
|
version: '1.0.0',
|
|
18
|
-
}, {
|
|
19
|
-
capabilities: {
|
|
20
|
-
resources: {},
|
|
21
|
-
tools: {},
|
|
22
|
-
},
|
|
23
21
|
});
|
|
24
22
|
// ============================================================================
|
|
25
|
-
//
|
|
23
|
+
// RESOURCES
|
|
26
24
|
// ============================================================================
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
resources: Object.entries(RESOURCES).map(([uri, resource]) => ({
|
|
30
|
-
uri,
|
|
31
|
-
name: resource.name,
|
|
32
|
-
description: resource.description,
|
|
33
|
-
mimeType: resource.mimeType,
|
|
34
|
-
})),
|
|
35
|
-
};
|
|
36
|
-
});
|
|
37
|
-
server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
|
|
38
|
-
const uri = request.params.uri;
|
|
39
|
-
const resource = RESOURCES[uri];
|
|
40
|
-
if (!resource) {
|
|
41
|
-
throw new Error(`Resource not found: ${uri}`);
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
25
|
+
for (const resource of Object.values(RESOURCES)) {
|
|
26
|
+
server.registerResource(resource.name, resource.uri, { description: resource.description, mimeType: resource.mimeType }, async (uri) => ({
|
|
44
27
|
contents: [
|
|
45
28
|
{
|
|
46
|
-
uri,
|
|
29
|
+
uri: uri.href,
|
|
47
30
|
mimeType: resource.mimeType,
|
|
48
31
|
text: resource.content,
|
|
49
32
|
},
|
|
50
33
|
],
|
|
51
|
-
};
|
|
52
|
-
}
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
53
36
|
// ============================================================================
|
|
54
|
-
//
|
|
37
|
+
// TOOLS
|
|
55
38
|
// ============================================================================
|
|
56
|
-
server.
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
39
|
+
server.registerTool('get_component_info', {
|
|
40
|
+
description: 'Get detailed information about a specific UI component from web-containers',
|
|
41
|
+
inputSchema: {
|
|
42
|
+
componentName: z
|
|
43
|
+
.string()
|
|
44
|
+
.describe('Name of the component (e.g., Button, Card, Dialog, Profile, NotificationDropdown)'),
|
|
45
|
+
},
|
|
46
|
+
}, async ({ componentName }) => ({
|
|
47
|
+
content: [{ type: 'text', text: getComponentInfo(componentName) }],
|
|
48
|
+
}));
|
|
49
|
+
server.registerTool('get_hook_info', {
|
|
50
|
+
description: 'Get detailed information about a custom React hook from web-utils or data-layer',
|
|
51
|
+
inputSchema: {
|
|
52
|
+
hookName: z.string().describe('Name of the hook (e.g., useAdvancedChat, useMentorSettings)'),
|
|
53
|
+
},
|
|
54
|
+
}, async ({ hookName }) => ({
|
|
55
|
+
content: [{ type: 'text', text: getHookInfo(hookName) }],
|
|
56
|
+
}));
|
|
57
|
+
server.registerTool('get_provider_setup', {
|
|
58
|
+
description: 'Get provider setup code for an IBL app (AuthProvider, TenantProvider, etc.)',
|
|
59
|
+
inputSchema: {
|
|
60
|
+
appType: z.string().describe('Type of IBL app (e.g., mentor, skills, auth)'),
|
|
61
|
+
features: z
|
|
62
|
+
.array(z.string())
|
|
63
|
+
.optional()
|
|
64
|
+
.describe('Optional features to include (e.g., chat, analytics, rbac)'),
|
|
65
|
+
},
|
|
66
|
+
}, async ({ appType, features }) => ({
|
|
67
|
+
content: [{ type: 'text', text: getProviderSetup(appType, features || []) }],
|
|
68
|
+
}));
|
|
69
|
+
server.registerTool('get_api_query_info', {
|
|
70
|
+
description: 'Get detailed information about an RTK Query API hook from data-layer',
|
|
71
|
+
inputSchema: {
|
|
72
|
+
queryName: z
|
|
73
|
+
.string()
|
|
74
|
+
.describe('Name of the RTK Query API hook (e.g., useGetMentorSettingsQuery)'),
|
|
75
|
+
},
|
|
76
|
+
}, async ({ queryName }) => ({
|
|
77
|
+
content: [{ type: 'text', text: getApiQueryInfo(queryName) }],
|
|
78
|
+
}));
|
|
79
|
+
server.registerTool('create_page_template', {
|
|
80
|
+
description: 'Generate a Next.js page template with IBL providers and components',
|
|
81
|
+
inputSchema: {
|
|
82
|
+
pageName: z.string().describe('Name of the page to create (e.g., Dashboard, Settings)'),
|
|
83
|
+
appType: z.string().describe('Type of IBL app (e.g., mentor, skills, auth)'),
|
|
84
|
+
features: z.array(z.string()).optional().describe('Optional features to include'),
|
|
85
|
+
},
|
|
86
|
+
}, async ({ pageName, appType, features }) => ({
|
|
87
|
+
content: [
|
|
88
|
+
{ type: 'text', text: createPageTemplate(pageName, appType, features || []) },
|
|
89
|
+
],
|
|
90
|
+
}));
|
|
91
|
+
server.registerTool('get_playwright_helper_info', {
|
|
92
|
+
description: 'Get detailed documentation for a specific Playwright test helper from @iblai/iblai-js/playwright',
|
|
93
|
+
inputSchema: {
|
|
94
|
+
helperName: z
|
|
95
|
+
.string()
|
|
96
|
+
.describe('Name of the Playwright helper (e.g., createPlaywrightConfig, reliableClick, safeWaitForURL, createAuthSetup)'),
|
|
97
|
+
},
|
|
98
|
+
}, async ({ helperName }) => ({
|
|
99
|
+
content: [{ type: 'text', text: getPlaywrightHelperInfo(helperName) }],
|
|
100
|
+
}));
|
|
101
|
+
// ============================================================================
|
|
102
|
+
// PROMPTS
|
|
103
|
+
// ============================================================================
|
|
104
|
+
server.registerPrompt('setup-e2e-testing', {
|
|
105
|
+
description: 'Generate instructions for setting up Playwright E2E testing in an IBL app',
|
|
106
|
+
argsSchema: {
|
|
107
|
+
appType: z
|
|
108
|
+
.enum(['mentor', 'skills', 'auth', 'custom'])
|
|
109
|
+
.describe('Type of IBL app to set up E2E testing for'),
|
|
110
|
+
appName: z.string().optional().describe('Optional custom app name (defaults to appType)'),
|
|
111
|
+
},
|
|
112
|
+
}, async ({ appType, appName }) => ({
|
|
113
|
+
messages: [
|
|
114
|
+
{
|
|
115
|
+
role: 'user',
|
|
116
|
+
content: { type: 'text', text: generateE2ESetupPrompt(appType, appName) },
|
|
117
|
+
},
|
|
118
|
+
],
|
|
119
|
+
}));
|
|
120
|
+
server.registerPrompt('create-playwright-test', {
|
|
121
|
+
description: 'Generate a Playwright E2E test for a specific feature using IBL SDK conventions',
|
|
122
|
+
argsSchema: {
|
|
123
|
+
feature: z
|
|
124
|
+
.string()
|
|
125
|
+
.describe('Feature to write a test for (e.g., login, mentor creation, chat)'),
|
|
126
|
+
appType: z.enum(['mentor', 'skills', 'auth', 'custom']).describe('Type of IBL app'),
|
|
127
|
+
},
|
|
128
|
+
}, async ({ feature, appType }) => ({
|
|
129
|
+
messages: [
|
|
130
|
+
{
|
|
131
|
+
role: 'user',
|
|
132
|
+
content: { type: 'text', text: generateCreateTestPrompt(feature, appType) },
|
|
133
|
+
},
|
|
134
|
+
],
|
|
135
|
+
}));
|
|
136
|
+
server.registerPrompt('setup-new-app', {
|
|
137
|
+
description: 'Generate comprehensive setup instructions for a new IBL app with providers, store, and E2E testing',
|
|
138
|
+
argsSchema: {
|
|
139
|
+
appType: z.enum(['mentor', 'skills', 'auth', 'custom']).describe('Type of IBL app to set up'),
|
|
140
|
+
features: z
|
|
141
|
+
.array(z.string())
|
|
142
|
+
.optional()
|
|
143
|
+
.describe('Optional features: rbac, analytics, chat, e2e'),
|
|
144
|
+
},
|
|
145
|
+
}, async ({ appType, features }) => ({
|
|
146
|
+
messages: [
|
|
147
|
+
{
|
|
148
|
+
role: 'user',
|
|
149
|
+
content: { type: 'text', text: generateSetupNewAppPrompt(appType, features) },
|
|
150
|
+
},
|
|
151
|
+
],
|
|
152
|
+
}));
|
|
121
153
|
// ============================================================================
|
|
122
154
|
// SERVER STARTUP
|
|
123
155
|
// ============================================================================
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,mBAAmB;AACnB,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEjD,eAAe;AACf,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC;AAE1B,iBAAiB;AACjB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,yBAAyB,GAC1B,MAAM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