@liangshanli/mcp-server-project-standards 2.1.3 → 2.1.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@liangshanli/mcp-server-project-standards",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
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": {
@@ -957,6 +957,16 @@ class ProjectStandardsMCPServer {
957
957
 
958
958
  result = await this[name](args || {});
959
959
 
960
+ // Check if result has contentType (MCP embedded prompt format)
961
+ if (result && result.contentType === "application/vnd.x-mcp-embedded-prompt") {
962
+ // Return the result as-is for MCP embedded prompts
963
+ return {
964
+ jsonrpc: '2.0',
965
+ id,
966
+ result
967
+ };
968
+ }
969
+
960
970
  // Tool call results need to be wrapped in content
961
971
  result = {
962
972
  content: [
@@ -74,19 +74,22 @@ async function api_debug(params, config, saveConfig) {
74
74
  } catch (parseError) {
75
75
  // 无法解析为JSON,给出建议
76
76
  return {
77
- success: false,
78
- message: 'Detected body starting with { but cannot be parsed as JSON object. Suggested approach:',
79
- suggestion: {
80
- step1: 'Use api_config tool to add the API to the list',
81
- step2: 'Use api_execute tool to execute the API by index',
82
- example: {
83
- addApi: 'api_config with action="addApi" and api={"url":"' + url + '","method":"' + requestMethod + '","body":"' + body + '"}',
84
- execute: 'api_execute with index=<returned index>'
77
+ contentType: "application/vnd.x-mcp-embedded-prompt",
78
+ content: [
79
+ {
80
+ type: "text",
81
+ text: `Detected body starting with { but cannot be parsed as JSON object. Suggested approach:
82
+
83
+ 1. Use api_config tool to add the API to the list
84
+ 2. Use api_execute tool to execute the API by index
85
+
86
+ Example:
87
+ - Add API: api_config with action="addApi" and api={"url":"${url}","method":"${requestMethod}","body":"valid JSON object"}
88
+ - Execute API: api_execute with index=<returned index>
89
+
90
+ Parse error: ${parseError.message}`
85
91
  }
86
- },
87
- body: body,
88
- parseError: parseError.message,
89
- timestamp: new Date().toISOString()
92
+ ]
90
93
  };
91
94
  }
92
95
  }