fa-mcp-sdk 0.2.184 → 0.2.192
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/cli-template/.claude/agents/fa-mcp-sdk.md +158 -0
- package/cli-template/FA-MCP-SDK-DOC/00-FA-MCP-SDK-index.md +216 -0
- package/cli-template/FA-MCP-SDK-DOC/01-getting-started.md +209 -0
- package/cli-template/FA-MCP-SDK-DOC/02-tools-and-api.md +321 -0
- package/cli-template/FA-MCP-SDK-DOC/03-configuration.md +415 -0
- package/cli-template/FA-MCP-SDK-DOC/04-authentication.md +544 -0
- package/cli-template/FA-MCP-SDK-DOC/05-ad-authorization.md +476 -0
- package/cli-template/FA-MCP-SDK-DOC/06-utilities.md +394 -0
- package/cli-template/FA-MCP-SDK-DOC/07-testing-and-operations.md +171 -0
- package/dist/core/_types_/types.d.ts +0 -5
- package/dist/core/_types_/types.d.ts.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/web/home-api.js +1 -1
- package/dist/core/web/home-api.js.map +1 -1
- package/dist/core/web/openapi.d.ts +64 -0
- package/dist/core/web/openapi.d.ts.map +1 -0
- package/dist/core/web/openapi.js +235 -0
- package/dist/core/web/openapi.js.map +1 -0
- package/dist/core/web/server-http.d.ts.map +1 -1
- package/dist/core/web/server-http.js +11 -9
- package/dist/core/web/server-http.js.map +1 -1
- package/dist/core/web/static/home/index.html +4 -2
- package/dist/core/web/static/home/script.js +2 -2
- package/package.json +8 -7
- package/src/template/api/router.ts +66 -4
- package/src/template/start.ts +0 -5
- package/cli-template/FA-MCP-SDK.md +0 -2540
- package/src/template/api/swagger.ts +0 -167
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import swaggerJsdoc from 'swagger-jsdoc';
|
|
2
|
-
import swaggerUi from 'swagger-ui-express';
|
|
3
|
-
import { appConfig } from '../../core/index.js';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Generic Swagger configuration template for MCP Server
|
|
7
|
-
* Customize this file according to your API endpoints and schemas
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// Build servers array from config with fallback
|
|
11
|
-
const buildServers = () => {
|
|
12
|
-
const servers = [];
|
|
13
|
-
|
|
14
|
-
// Use servers from config if available
|
|
15
|
-
if (appConfig.swagger?.servers?.length) {
|
|
16
|
-
appConfig.swagger.servers.forEach((server: any) => {
|
|
17
|
-
servers.push({
|
|
18
|
-
url: server.url,
|
|
19
|
-
description: server.description
|
|
20
|
-
});
|
|
21
|
-
});
|
|
22
|
-
} else {
|
|
23
|
-
// Fallback to default development server
|
|
24
|
-
servers.push({
|
|
25
|
-
url: `http://localhost:${appConfig.webServer.port}`,
|
|
26
|
-
description: 'Development server'
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return servers;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const options = {
|
|
34
|
-
definition: {
|
|
35
|
-
openapi: '3.0.0',
|
|
36
|
-
info: {
|
|
37
|
-
title: 'MCP Server API',
|
|
38
|
-
version: appConfig.version,
|
|
39
|
-
description: `
|
|
40
|
-
REST API for your MCP Server. This is a template configuration.
|
|
41
|
-
Customize the endpoints, schemas, and documentation according to your needs.
|
|
42
|
-
`,
|
|
43
|
-
},
|
|
44
|
-
servers: buildServers(),
|
|
45
|
-
components: {
|
|
46
|
-
schemas: {
|
|
47
|
-
HealthResponse: {
|
|
48
|
-
type: 'object',
|
|
49
|
-
description: 'Health check response',
|
|
50
|
-
properties: {
|
|
51
|
-
status: {
|
|
52
|
-
type: 'string',
|
|
53
|
-
example: 'ok'
|
|
54
|
-
},
|
|
55
|
-
timestamp: {
|
|
56
|
-
type: 'string',
|
|
57
|
-
format: 'date-time',
|
|
58
|
-
example: '2024-11-05T12:00:00.000Z'
|
|
59
|
-
},
|
|
60
|
-
version: {
|
|
61
|
-
type: 'string',
|
|
62
|
-
example: '1.0.0'
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
required: ['status', 'timestamp', 'version']
|
|
66
|
-
},
|
|
67
|
-
ErrorResponse: {
|
|
68
|
-
type: 'object',
|
|
69
|
-
description: 'Error response format',
|
|
70
|
-
properties: {
|
|
71
|
-
success: {
|
|
72
|
-
type: 'boolean',
|
|
73
|
-
description: 'Indicates failed operation',
|
|
74
|
-
example: false
|
|
75
|
-
},
|
|
76
|
-
error: {
|
|
77
|
-
type: 'string',
|
|
78
|
-
description: 'Human-readable error message',
|
|
79
|
-
example: 'Validation failed'
|
|
80
|
-
},
|
|
81
|
-
code: {
|
|
82
|
-
type: 'string',
|
|
83
|
-
description: 'Error code for programmatic handling',
|
|
84
|
-
example: 'VALIDATION_ERROR'
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
required: ['success', 'error', 'code']
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
paths: {
|
|
92
|
-
'/health': {
|
|
93
|
-
get: {
|
|
94
|
-
summary: 'Health check',
|
|
95
|
-
description: 'Simple health check endpoint for monitoring',
|
|
96
|
-
tags: ['Server'],
|
|
97
|
-
responses: {
|
|
98
|
-
'200': {
|
|
99
|
-
description: 'Service is healthy',
|
|
100
|
-
content: {
|
|
101
|
-
'application/json': {
|
|
102
|
-
schema: {
|
|
103
|
-
$ref: '#/components/schemas/HealthResponse'
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
'/example': {
|
|
112
|
-
get: {
|
|
113
|
-
summary: 'Example endpoint',
|
|
114
|
-
description: 'Template endpoint - customize as needed',
|
|
115
|
-
tags: ['Example'],
|
|
116
|
-
responses: {
|
|
117
|
-
'200': {
|
|
118
|
-
description: 'Success response',
|
|
119
|
-
content: {
|
|
120
|
-
'application/json': {
|
|
121
|
-
schema: {
|
|
122
|
-
type: 'object',
|
|
123
|
-
properties: {
|
|
124
|
-
success: {
|
|
125
|
-
type: 'boolean',
|
|
126
|
-
example: true
|
|
127
|
-
},
|
|
128
|
-
message: {
|
|
129
|
-
type: 'string',
|
|
130
|
-
example: 'Template endpoint response'
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
},
|
|
137
|
-
'400': {
|
|
138
|
-
description: 'Bad request',
|
|
139
|
-
content: {
|
|
140
|
-
'application/json': {
|
|
141
|
-
schema: {
|
|
142
|
-
$ref: '#/components/schemas/ErrorResponse'
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
},
|
|
151
|
-
tags: [
|
|
152
|
-
{
|
|
153
|
-
name: 'Server',
|
|
154
|
-
description: 'Server management endpoints'
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
name: 'Example',
|
|
158
|
-
description: 'Template endpoints to customize'
|
|
159
|
-
}
|
|
160
|
-
]
|
|
161
|
-
},
|
|
162
|
-
apis: [] // Add your API files here if using JSDoc comments
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
const swaggerSpecs = swaggerJsdoc(options);
|
|
166
|
-
|
|
167
|
-
export const swagger = { swaggerSpecs, swaggerUi };
|