@liangshanli/mcp-server-project-standards 2.1.5 → 2.1.7

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.5",
3
+ "version": "2.1.7",
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": {
@@ -605,7 +605,6 @@ class ProjectStandardsMCPServer {
605
605
  ]
606
606
  }
607
607
  },
608
- required: ['url'],
609
608
  examples: [
610
609
  {
611
610
  description: 'Simple GET request',
@@ -32,7 +32,35 @@ async function api_debug(params, config, saveConfig) {
32
32
  const { url, method = 'GET', headers = {}, query, body, contentType } = params || {};
33
33
 
34
34
  if (!url) {
35
- throw new Error('Missing url parameter');
35
+ return {
36
+ contentType: "text",
37
+ content: [
38
+ {
39
+ type: "text",
40
+ text: "⚠️ IMPORTANT: URL parameter is required for API debugging!\n\n🔧 Step 1: Provide URL Parameter\n\nCall: api_debug with url parameter\n\nExample: {\"url\": \"/api/users\", \"method\": \"GET\"}\n\n⚠️ REMINDER: URL is required for API execution!"
41
+ },
42
+ {
43
+ type: "text",
44
+ text: "🔧 Step 2: Optional Parameters\n\nYou can also provide:\n- method: GET, POST, PUT, DELETE, PATCH\n- headers: Additional request headers\n- query: Query parameters\n- body: Request body\n- contentType: Content type override"
45
+ },
46
+ {
47
+ type: "text",
48
+ text: "🚨 REMINDER: URL is mandatory!\n\n- Use api_debug with url parameter\n- URL can be relative (/api/users) or absolute (https://api.example.com/users)"
49
+ },
50
+ {
51
+ type: "text",
52
+ text: "💡 IMPORTANT: Remember to provide URL!\n\n- First: api_debug with url parameter\n- Second: Add other optional parameters as needed"
53
+ },
54
+ {
55
+ type: "text",
56
+ text: "📋 Final Reminder: URL is required\n\n1. First: api_debug with url parameter\n2. Then: Add optional parameters\n\nThis is the ONLY way to execute API requests."
57
+ },
58
+ {
59
+ type: "text",
60
+ text: "⚠️ ESSENTIAL: URL parameter is required!\n\n- Use api_debug with url parameter\n- URL can be relative or absolute"
61
+ }
62
+ ]
63
+ };
36
64
  }
37
65
 
38
66
  try {
@@ -78,31 +106,27 @@ async function api_debug(params, config, saveConfig) {
78
106
  content: [
79
107
  {
80
108
  type: "text",
81
- text: " JSON Parse Error Detected\n\nThe request body starts with { but cannot be parsed as a valid JSON object."
109
+ text: "⚠️ IMPORTANT: You MUST use addApi to add the API to the list first! Use api_config tool.\n\n🔧 Step 1: Add API to Configuration (REQUIRED)\n\nCall: api_config with action=\"addApi\" and api={\"url\":\"${url}\",\"method\":\"${requestMethod}\",\"body\":\"your corrected JSON here\"}\n\n⚠️ REMINDER: You MUST use api_config with addApi to add the API to the list!"
82
110
  },
83
111
  {
84
112
  type: "text",
85
- text: "⚠️ IMPORTANT: You MUST use addApi to add the API to the list first!\n\nDirect execution is not possible with invalid JSON. You must follow these steps:"
113
+ text: "🔧 Step 2: Execute API by Index\n\nAfter adding the API, call: api_execute with index=<returned index>\n\nThis will execute the pre-configured API with the correct format."
86
114
  },
87
115
  {
88
116
  type: "text",
89
- text: "🔧 Step 1: Add API to Configuration (REQUIRED)\n\nCall: api_config with action=\"addApi\" and api={\"url\":\"${url}\",\"method\":\"${requestMethod}\",\"body\":\"your corrected JSON here\"}\n\nThis will store the API configuration for future use."
117
+ text: "🚨 REMINDER: You MUST use addApi first!\n\n- Use api_config with action=\"addApi\" to add the API to the list\n- Then use api_execute with the returned index to execute"
90
118
  },
91
119
  {
92
120
  type: "text",
93
- text: "🔧 Step 2: Execute API by Index\n\nAfter adding the API, call: api_execute with index=<returned index>\n\nThis will execute the pre-configured API with the correct format."
121
+ text: "💡 IMPORTANT: Remember to use addApi!\n\n- First: api_config with action=\"addApi\" to add the API\n- Second: api_execute with index to run the API"
94
122
  },
95
123
  {
96
124
  type: "text",
97
- text: "🚨 REMINDER: You MUST use addApi first!\n\n- Cannot execute API directly with invalid JSON\n- Must add to configuration list using api_config tool\n- Then use api_execute with the returned index"
98
- },
99
- {
100
- type: "text",
101
- text: "💡 Why This Approach is Required:\n- Invalid JSON cannot be processed directly\n- addApi allows you to fix the JSON format\n- Configuration is saved for reuse\n- Better error handling and debugging"
125
+ text: "📋 Final Reminder: Use addApi Then api_execute\n\n1. First: api_config with action=\"addApi\"\n2. Then: api_execute with index=<number>\n\nThis is the ONLY way to handle invalid JSON requests."
102
126
  },
103
127
  {
104
128
  type: "text",
105
- text: "📋 Final Reminder: Use addApi Then api_execute\n\n1. First: api_config with action=\"addApi\"\n2. Then: api_execute with index=<number>\n\nThis is the ONLY way to handle invalid JSON requests."
129
+ text: "⚠️ ESSENTIAL: You MUST use addApi!\n\n- First: api_config with action=\"addApi\" to add the API\n- Second: api_execute with index to run the API"
106
130
  }
107
131
  ]
108
132
  };