@questpie/mcp 3.3.0
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 +69 -0
- package/dist/create-server-DIvtVlma.mjs +1014 -0
- package/dist/index-Cxta5KOn.d.mts +58 -0
- package/dist/index.d.mts +122 -0
- package/dist/index.mjs +12 -0
- package/dist/mcp-DapXh3Mk.mjs +163 -0
- package/dist/modules/mcp.d.mts +2 -0
- package/dist/modules/mcp.mjs +3 -0
- package/dist/plugin-BJ6gELRj.mjs +39 -0
- package/dist/plugin-CMR-wkeP.d.mts +6 -0
- package/dist/plugin.d.mts +2 -0
- package/dist/plugin.mjs +3 -0
- package/dist/stdio-qyQFVEyU.mjs +16 -0
- package/dist/stdio-t_9rKayH.d.mts +154 -0
- package/dist/stdio.d.mts +2 -0
- package/dist/stdio.mjs +3 -0
- package/package.json +83 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# @questpie/mcp
|
|
2
|
+
|
|
3
|
+
Model Context Protocol integration for QUESTPIE apps. The package exposes selected QUESTPIE collections, globals, annotated routes, custom MCP tools, and schema resources to AI clients through the same access rules and request context as the rest of the app.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **HTTP MCP endpoint** - register `mcpModule` and serve MCP over the app route layer.
|
|
8
|
+
- **Stdio server** - start a local MCP server for desktop/IDE agents.
|
|
9
|
+
- **Policy-first tools** - expose read/write/delete operations explicitly per entity.
|
|
10
|
+
- **Route tools** - opt annotated JSON routes into MCP with path-param support.
|
|
11
|
+
- **Schema resources** - let agents inspect allowed collections, globals, routes, and fields.
|
|
12
|
+
- **Request context preservation** - HTTP tools run under the connecting request/session.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
bun add @questpie/mcp
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Register The Module
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
// modules.ts
|
|
24
|
+
import { mcpModule } from "@questpie/mcp/modules/mcp";
|
|
25
|
+
|
|
26
|
+
export default [mcpModule] as const;
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Configure the reachable surface in `config/mcp.ts`:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { mcpConfig } from "@questpie/mcp";
|
|
33
|
+
|
|
34
|
+
export default mcpConfig({
|
|
35
|
+
crud: {
|
|
36
|
+
collections: {
|
|
37
|
+
posts: { expose: true, read: true, write: true },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Custom Tools
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
// mcp-tools/publish-summary.ts
|
|
47
|
+
import { mcpTool } from "@questpie/mcp";
|
|
48
|
+
import { z } from "zod";
|
|
49
|
+
|
|
50
|
+
export default mcpTool("publish-summary", {
|
|
51
|
+
inputSchema: z.object({ postId: z.string() }),
|
|
52
|
+
}).handler(async ({ input, ctx }) => {
|
|
53
|
+
const post = await ctx.collections.posts.findById(input.postId);
|
|
54
|
+
return { structuredContent: { title: post.title } };
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Exports
|
|
59
|
+
|
|
60
|
+
| Entry Point | Purpose |
|
|
61
|
+
| --------------------------- | ----------------------------------- |
|
|
62
|
+
| `@questpie/mcp` | Config, plugin, server, tool factory |
|
|
63
|
+
| `@questpie/mcp/modules/mcp` | `mcpModule` for `modules.ts` |
|
|
64
|
+
| `@questpie/mcp/plugin` | Codegen plugin export |
|
|
65
|
+
| `@questpie/mcp/stdio` | Stdio server entry |
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT
|