@liangshanli/mcp-server-project-standards 2.1.1 → 2.1.2
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/package.json +1 -1
- package/src/utils/api_config.js +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liangshanli/mcp-server-project-standards",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "MCP Project Standards server with project info, structure, API standards, development standards, API debugging, login authentication and configuration management tools",
|
|
5
5
|
"main": "bin/cli.js",
|
|
6
6
|
"bin": {
|
package/src/utils/api_config.js
CHANGED
|
@@ -222,7 +222,10 @@ async function api_config(params, config, saveConfig) {
|
|
|
222
222
|
let searchResults = [];
|
|
223
223
|
|
|
224
224
|
if (apiDebugConfig.list && Array.isArray(apiDebugConfig.list)) {
|
|
225
|
-
searchResults = apiDebugConfig.list.
|
|
225
|
+
searchResults = apiDebugConfig.list.map((item, index) => ({
|
|
226
|
+
...item,
|
|
227
|
+
index: index
|
|
228
|
+
})).filter((item) => {
|
|
226
229
|
const urlMatch = item.url && item.url.toLowerCase().includes(keyword.toLowerCase());
|
|
227
230
|
const descMatch = item.description && item.description.toLowerCase().includes(keyword.toLowerCase());
|
|
228
231
|
return urlMatch || descMatch;
|
|
@@ -245,10 +248,16 @@ async function api_config(params, config, saveConfig) {
|
|
|
245
248
|
const apiDebugConfig = loadApiConfig();
|
|
246
249
|
const apiList = apiDebugConfig.list || [];
|
|
247
250
|
|
|
251
|
+
// Add index to each API
|
|
252
|
+
const apisWithIndex = apiList.map((api, index) => ({
|
|
253
|
+
...api,
|
|
254
|
+
index: index
|
|
255
|
+
}));
|
|
256
|
+
|
|
248
257
|
return {
|
|
249
258
|
success: true,
|
|
250
259
|
message: `Found ${apiList.length} configured API(s)`,
|
|
251
|
-
apis:
|
|
260
|
+
apis: apisWithIndex,
|
|
252
261
|
totalCount: apiList.length,
|
|
253
262
|
config: {
|
|
254
263
|
baseUrl: apiDebugConfig.baseUrl,
|