spiceflow 1.1.18 → 1.2.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/dist/mcp.js ADDED
@@ -0,0 +1,211 @@
1
+ import { Server } from '@modelcontextprotocol/sdk/server/index.js';
2
+ import { CallToolRequestSchema, ListResourcesRequestSchema, ListToolsRequestSchema, ReadResourceRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
3
+ import { zodToJsonSchema } from 'zod-to-json-schema';
4
+ import { SSEServerTransportSpiceflow } from './mcp-transport.js';
5
+ import { isZodSchema, Spiceflow } from './spiceflow.js';
6
+ function getJsonSchema(schema) {
7
+ if (!schema)
8
+ return undefined;
9
+ if (isZodSchema(schema)) {
10
+ return zodToJsonSchema(schema, {});
11
+ }
12
+ return schema;
13
+ }
14
+ export const mcp = ({ path = '/mcp', name = 'spiceflow', version = '1.0.0', } = {}) => {
15
+ const server = new Server({ name, version }, {
16
+ capabilities: {
17
+ tools: {},
18
+ resources: {},
19
+ },
20
+ });
21
+ const transports = new Map();
22
+ const messagePath = path + '/message';
23
+ let app = new Spiceflow({ name: 'mcp' })
24
+ .post(messagePath, async ({ request, query }) => {
25
+ const sessionId = query.sessionId;
26
+ const t = transports.get(sessionId);
27
+ if (!t) {
28
+ return new Response('Session not found', { status: 404 });
29
+ }
30
+ await t.handlePostMessage(request);
31
+ return 'ok';
32
+ })
33
+ .get(path, async ({ request }) => {
34
+ const transport = new SSEServerTransportSpiceflow(messagePath);
35
+ transports.set(transport.sessionId, transport);
36
+ server.onclose = () => {
37
+ transports.delete(transport.sessionId);
38
+ };
39
+ await server.connect(transport);
40
+ request.signal.addEventListener('abort', () => {
41
+ transport.close().catch((error) => {
42
+ console.error('Error closing transport:', error);
43
+ });
44
+ });
45
+ if (request.method === 'POST') {
46
+ return await transport.handlePostMessage(request);
47
+ }
48
+ let routes = app
49
+ .getAllRoutes()
50
+ .filter((x) => x.path !== path && x.path !== messagePath);
51
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
52
+ return {
53
+ tools: routes.map((route) => {
54
+ var _a, _b, _c, _d, _e;
55
+ const bodySchema = getJsonSchema((_a = route.hooks) === null || _a === void 0 ? void 0 : _a.body);
56
+ const querySchema = getJsonSchema((_b = route.hooks) === null || _b === void 0 ? void 0 : _b.query);
57
+ const paramsSchema = getJsonSchema((_c = route.hooks) === null || _c === void 0 ? void 0 : _c.params);
58
+ const properties = {};
59
+ const required = [];
60
+ if (bodySchema) {
61
+ properties.body = bodySchema;
62
+ required.push('body');
63
+ }
64
+ if (querySchema === null || querySchema === void 0 ? void 0 : querySchema.properties) {
65
+ properties.query = querySchema;
66
+ }
67
+ if (paramsSchema === null || paramsSchema === void 0 ? void 0 : paramsSchema.properties) {
68
+ properties.params = paramsSchema;
69
+ }
70
+ return {
71
+ name: getRouteName({ method: route.method, path: route.path }),
72
+ description: ((_e = (_d = route.hooks) === null || _d === void 0 ? void 0 : _d.detail) === null || _e === void 0 ? void 0 : _e.description) ||
73
+ `${route.method} ${route.path}`,
74
+ inputSchema: {
75
+ type: 'object',
76
+ properties,
77
+ required,
78
+ },
79
+ };
80
+ }),
81
+ };
82
+ });
83
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
84
+ const toolName = request.params.name;
85
+ let { path, method } = getPathFromToolName(toolName);
86
+ const route = routes.find((r) => r.method.toUpperCase() === method.toUpperCase() && r.path === path);
87
+ if (!route) {
88
+ return {
89
+ content: [{ type: 'text', text: `Tool ${toolName} not found` }],
90
+ isError: true,
91
+ };
92
+ }
93
+ try {
94
+ const { body, query, params } = request.params.arguments || {};
95
+ if (params) {
96
+ Object.entries(params).forEach(([key, value]) => {
97
+ path = path.replace(`:${key}`, encodeURIComponent(String(value)));
98
+ });
99
+ }
100
+ const url = new URL(`http://localhost${path}`);
101
+ if (query) {
102
+ Object.entries(query).forEach(([key, value]) => {
103
+ url.searchParams.set(key, String(value));
104
+ });
105
+ }
106
+ const response = await app.topLevelApp.handle(new Request(url, {
107
+ method: route.method,
108
+ headers: {
109
+ 'content-type': 'application/json',
110
+ },
111
+ body: body ? JSON.stringify(body) : undefined,
112
+ }));
113
+ const isError = !response.ok;
114
+ const contentType = response.headers.get('content-type');
115
+ if (contentType === null || contentType === void 0 ? void 0 : contentType.includes('application/json')) {
116
+ const json = await response.json();
117
+ return {
118
+ isError,
119
+ content: [{ type: 'text', text: JSON.stringify(json, null, 2) }],
120
+ };
121
+ }
122
+ const text = await response.text();
123
+ return {
124
+ isError,
125
+ content: [{ type: 'text', text }],
126
+ };
127
+ }
128
+ catch (error) {
129
+ return {
130
+ content: [{ type: 'text', text: error.message || 'Unknown error' }],
131
+ isError: true,
132
+ };
133
+ }
134
+ });
135
+ const resourcesRoutes = routes.filter((route) => {
136
+ var _a, _b;
137
+ if (route.method !== 'GET')
138
+ return false;
139
+ if (route.path.includes(':'))
140
+ return false;
141
+ const querySchema = (_a = route.hooks) === null || _a === void 0 ? void 0 : _a.query;
142
+ if (querySchema) {
143
+ const jsonSchema = getJsonSchema(querySchema);
144
+ if ((_b = jsonSchema === null || jsonSchema === void 0 ? void 0 : jsonSchema.required) === null || _b === void 0 ? void 0 : _b.length) {
145
+ return false;
146
+ }
147
+ }
148
+ return true;
149
+ });
150
+ server.setRequestHandler(ListResourcesRequestSchema, async () => {
151
+ const resources = resourcesRoutes.map((route) => ({
152
+ uri: new URL(route.path, `http://${request.headers.get('host')}`)
153
+ .href,
154
+ mimeType: 'application/json',
155
+ name: `GET ${route.path}`,
156
+ }));
157
+ return { resources };
158
+ });
159
+ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
160
+ const resourceUrl = new URL(request.params.uri);
161
+ const path = resourceUrl.pathname;
162
+ const route = resourcesRoutes.find((route) => route.path === path && route.method === 'GET');
163
+ if (!route) {
164
+ throw new Error('Resource not found');
165
+ }
166
+ const response = await app.topLevelApp.handle(new Request(resourceUrl, {
167
+ method: 'GET',
168
+ headers: {
169
+ 'content-type': 'application/json',
170
+ },
171
+ }));
172
+ const contentType = response.headers.get('content-type');
173
+ const text = await response.text();
174
+ if (contentType === null || contentType === void 0 ? void 0 : contentType.includes('application/json')) {
175
+ return {
176
+ contents: [
177
+ {
178
+ uri: request.params.uri,
179
+ mimeType: 'application/json',
180
+ text: text,
181
+ },
182
+ ],
183
+ };
184
+ }
185
+ return {
186
+ contents: [
187
+ {
188
+ uri: request.params.uri,
189
+ mimeType: 'text/plain',
190
+ text,
191
+ },
192
+ ],
193
+ };
194
+ });
195
+ return transport.response;
196
+ });
197
+ return app;
198
+ };
199
+ function getRouteName({ method, path, }) {
200
+ return `${method.toUpperCase()} ${path}`;
201
+ }
202
+ function getPathFromToolName(toolName) {
203
+ const parts = toolName.split(' ');
204
+ if (parts.length < 2) {
205
+ throw new Error('Invalid tool name format');
206
+ }
207
+ const method = parts[0].toUpperCase();
208
+ const path = parts.slice(1).join(' ');
209
+ return { path, method };
210
+ }
211
+ //# sourceMappingURL=mcp.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.js","sourceRoot":"","sources":["../src/mcp.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAA;AAElE,OAAO,EACL,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,oCAAoC,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAEvD,SAAS,aAAa,CAAC,MAAW;IAChC,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAA;IAC7B,IAAI,WAAW,CAAC,MAAM,CAAC,EAAE,CAAC;QACxB,OAAO,eAAe,CAAC,MAAM,EAAE,EAAE,CAAC,CAAA;IACpC,CAAC;IACD,OAAO,MAAM,CAAA;AACf,CAAC;AAED,MAAM,CAAC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E,CAAA;AACzB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mcp.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.test.d.ts","sourceRoot":"","sources":["../src/mcp.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,224 @@
1
+ import { describe, it, expect, beforeAll } from 'vitest';
2
+ import { EventSource } from 'eventsource';
3
+ import { mcp } from './mcp.js';
4
+ import { Client } from '@modelcontextprotocol/sdk/client/index.js';
5
+ import { ListResourcesResultSchema, ListToolsResultSchema, ReadResourceResultSchema, CallToolResultSchema, } from '@modelcontextprotocol/sdk/types.js';
6
+ import { SSEClientTransport } from '@modelcontextprotocol/sdk/client/sse.js';
7
+ import { z } from 'zod';
8
+ import { Spiceflow } from './spiceflow.js';
9
+ describe('MCP Plugin', () => {
10
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
11
+ ;
12
+ global.EventSource = EventSource;
13
+ let app;
14
+ let port;
15
+ let client;
16
+ let transport;
17
+ beforeAll(async () => {
18
+ port = await getAvailablePort();
19
+ app = new Spiceflow()
20
+ .use(mcp({ path: '/mcp' }))
21
+ .get('/goSomething', () => 'hi')
22
+ .get('/users', () => ({ users: [{ id: 1, name: 'John' }] }))
23
+ .get('/somethingElse/:id', ({ params: { id } }) => {
24
+ return 'hello ' + id;
25
+ }, {
26
+ params: z.object({ id: z.string() }),
27
+ })
28
+ .get('/search', ({ query }) => {
29
+ return { results: [`Found results for: ${query.q}`] };
30
+ }, {
31
+ query: z
32
+ .object({
33
+ q: z.string().describe('Search query'),
34
+ limit: z.number().optional().describe('Max number of results'),
35
+ })
36
+ .required(),
37
+ });
38
+ await app.listen(port);
39
+ transport = new SSEClientTransport(new URL(`http://localhost:${port}/mcp`));
40
+ client = new Client({
41
+ name: 'example-client',
42
+ version: '1.0.0',
43
+ }, {
44
+ capabilities: {},
45
+ });
46
+ await client.connect(transport);
47
+ });
48
+ it('should list and call available tools', async () => {
49
+ const resources = await client.request({ method: 'tools/list' }, ListToolsResultSchema);
50
+ expect(resources).toBeDefined();
51
+ expect(resources).toHaveProperty('tools');
52
+ expect(resources).toMatchInlineSnapshot(`
53
+ {
54
+ "tools": [
55
+ {
56
+ "description": "GET /goSomething",
57
+ "inputSchema": {
58
+ "properties": {},
59
+ "required": [],
60
+ "type": "object",
61
+ },
62
+ "name": "GET /goSomething",
63
+ },
64
+ {
65
+ "description": "GET /users",
66
+ "inputSchema": {
67
+ "properties": {},
68
+ "required": [],
69
+ "type": "object",
70
+ },
71
+ "name": "GET /users",
72
+ },
73
+ {
74
+ "description": "GET /somethingElse/:id",
75
+ "inputSchema": {
76
+ "properties": {
77
+ "params": {
78
+ "$schema": "http://json-schema.org/draft-07/schema#",
79
+ "additionalProperties": false,
80
+ "properties": {
81
+ "id": {
82
+ "type": "string",
83
+ },
84
+ },
85
+ "required": [
86
+ "id",
87
+ ],
88
+ "type": "object",
89
+ },
90
+ },
91
+ "required": [],
92
+ "type": "object",
93
+ },
94
+ "name": "GET /somethingElse/:id",
95
+ },
96
+ {
97
+ "description": "GET /search",
98
+ "inputSchema": {
99
+ "properties": {
100
+ "query": {
101
+ "$schema": "http://json-schema.org/draft-07/schema#",
102
+ "additionalProperties": false,
103
+ "properties": {
104
+ "limit": {
105
+ "type": "number",
106
+ },
107
+ "q": {
108
+ "description": "Search query",
109
+ "type": "string",
110
+ },
111
+ },
112
+ "required": [
113
+ "q",
114
+ "limit",
115
+ ],
116
+ "type": "object",
117
+ },
118
+ },
119
+ "required": [],
120
+ "type": "object",
121
+ },
122
+ "name": "GET /search",
123
+ },
124
+ ],
125
+ }
126
+ `);
127
+ const resourceContent = await client.request({
128
+ method: 'tools/call',
129
+ params: {
130
+ name: 'POST /somethingElse/:id',
131
+ arguments: {
132
+ params: { id: 'xxx' },
133
+ },
134
+ },
135
+ }, CallToolResultSchema);
136
+ expect(resourceContent).toBeDefined();
137
+ expect(resourceContent).toHaveProperty('content');
138
+ expect(resourceContent).toMatchInlineSnapshot(`
139
+ {
140
+ "content": [
141
+ {
142
+ "text": "Tool POST /somethingElse/:id not found",
143
+ "type": "text",
144
+ },
145
+ ],
146
+ "isError": true,
147
+ }
148
+ `);
149
+ });
150
+ it('should list and read available resources', async () => {
151
+ const resources = await client.request({ method: 'resources/list' }, ListResourcesResultSchema);
152
+ expect(resources).toBeDefined();
153
+ expect(resources.resources).toMatchInlineSnapshot(`
154
+ [
155
+ {
156
+ "mimeType": "application/json",
157
+ "name": "GET /goSomething",
158
+ "uri": "http://localhost:3000/goSomething",
159
+ },
160
+ {
161
+ "mimeType": "application/json",
162
+ "name": "GET /users",
163
+ "uri": "http://localhost:3000/users",
164
+ },
165
+ ]
166
+ `);
167
+ const resourceContent = await client.request({
168
+ method: 'resources/read',
169
+ params: {
170
+ uri: `http://localhost:${port}/users`,
171
+ },
172
+ }, ReadResourceResultSchema);
173
+ expect(resourceContent).toBeDefined();
174
+ expect(resourceContent.contents).toMatchInlineSnapshot(`
175
+ [
176
+ {
177
+ "mimeType": "application/json",
178
+ "text": "{
179
+ "users": [
180
+ {
181
+ "id": 1,
182
+ "name": "John"
183
+ }
184
+ ]
185
+ }",
186
+ "uri": "http://localhost:3000/users",
187
+ },
188
+ ]
189
+ `);
190
+ });
191
+ });
192
+ async function getAvailablePort(startPort = 3000, maxRetries = 10) {
193
+ const net = await import('net');
194
+ return await new Promise((resolve, reject) => {
195
+ let port = startPort;
196
+ let attempts = 0;
197
+ const checkPort = () => {
198
+ const server = net.createServer();
199
+ server.once('error', (err) => {
200
+ if (err.code === 'EADDRINUSE') {
201
+ attempts++;
202
+ if (attempts >= maxRetries) {
203
+ reject(new Error('No available ports found'));
204
+ }
205
+ else {
206
+ port++;
207
+ checkPort();
208
+ }
209
+ }
210
+ else {
211
+ reject(err);
212
+ }
213
+ });
214
+ server.once('listening', () => {
215
+ server.close(() => {
216
+ resolve(port);
217
+ });
218
+ });
219
+ server.listen(port);
220
+ };
221
+ checkPort();
222
+ });
223
+ }
224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,SAAS,EAAE,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC"}
package/dist/openapi.d.ts CHANGED
@@ -1,38 +1,25 @@
1
1
  import { Spiceflow } from './spiceflow.js';
2
2
  import type { OpenAPIV3 } from 'openapi-types';
3
- import type { HTTPMethod, LocalHook, TypeSchema } from './types.js';
4
- export declare const toOpenAPIPath: (path: string) => string;
5
- export declare const mapProperties: (name: string, schema: TypeSchema | string | undefined, models: Record<string, TypeSchema>) => {
6
- description: any;
7
- examples: any;
8
- schema: any;
9
- in: string;
10
- name: string;
11
- required: any;
12
- }[];
13
- export declare const capitalize: (word: string) => string;
14
- export declare const generateOperationId: (method: string, paths: string) => string;
15
- export declare const registerSchemaPath: ({ schema, path, method, hook, models, }: {
16
- schema: Partial<OpenAPIV3.PathsObject>;
17
- contentType?: string | string[];
18
- path: string;
19
- method: HTTPMethod;
20
- hook?: LocalHook<any, any, any, any, any, any, any>;
21
- models: Record<string, TypeSchema>;
22
- }) => void;
23
3
  /**
24
4
  * Plugin for [elysia](https://github.com/elysiajs/elysia) that auto-generate Swagger page.
25
5
  *
26
6
  * @see https://github.com/elysiajs/elysia-swagger
27
7
  */
28
- export declare const openapi: <Path extends string = "/openapi">({ path, documentation, }?: {
8
+ export declare const openapi: <Path extends string = "/openapi">({ path, ...additional }?: {
29
9
  path?: Path;
30
- /**
31
- * Customize Swagger config, refers to Swagger 2.0 config
32
- *
33
- * @see https://swagger.io/specification/v2/
34
- */
35
- documentation?: Omit<Partial<OpenAPIV3.Document>, "x-express-openapi-additional-middleware" | "x-express-openapi-validation-strict">;
10
+ } & Omit<Partial<OpenAPIV3.Document>, "x-express-openapi-additional-middleware" | "x-express-openapi-validation-strict"> & {
11
+ "x-fern-global-headers"?: Array<{
12
+ header: string;
13
+ name: string;
14
+ optional?: boolean;
15
+ }>;
16
+ "x-fern-version"?: {
17
+ version: {
18
+ header: string;
19
+ default: string;
20
+ values: string[];
21
+ };
22
+ };
36
23
  }) => Spiceflow<"", true,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