You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(extensions): Cleanup active servers prompt markdown (#195)
* chore: only one H1 in @mcp prompt
* chore: remove spaces at EOL
* chore: remove space at EOL in @mcp prompt
* chore: fix Input Schema indent and add code block in @mcp prompt
* chore: fix header trailing punctuation in @mcp prompt
* chore: fix indent for multiline description in @mcp prompt
* chore: add empty line before server description in @mcp prompt
* chore: fix extra empty lines in examples in @mcp prompt
@@ -156,7 +159,7 @@ function M.get_use_mcp_tool_prompt(example)
156
159
157
160
returnstring.format(
158
161
[[
159
-
## use_mcp_tool
162
+
### use_mcp_tool
160
163
161
164
Description: Request to use a tool provided by a connected MCP server. Each MCP server can provide multiple tools with different capabilities. Tools have defined input schemas that specify required and optional parameters.
162
165
Parameters:
@@ -182,7 +185,7 @@ function M.get_access_mcp_resource_prompt(example)
182
185
183
186
returnstring.format(
184
187
[[
185
-
## access_mcp_resource
188
+
### access_mcp_resource
186
189
187
190
Description: Request to access a resource provided by a connected MCP server. Resources represent data sources that can be used as context, such as files, API responses, or system information.
188
191
Parameters:
@@ -201,14 +204,14 @@ end
201
204
functionM.server_to_text(server)
202
205
localtext=""
203
206
-- Add server section
204
-
text=text..string.format("## %s", server.name)
207
+
text=text..string.format("### %s", server.name)
205
208
localis_disabled=server.status=="disabled"
206
209
ifis_disabledthen
207
210
text=text.." (Disabled)"
208
211
end
209
212
localdesc=M.get_description(server)
210
213
-- Add description
211
-
text=text.. (desc=="" and"" or"\n" ..desc)
214
+
text=text.. (desc=="" and"" or"\n\n" ..desc)
212
215
ifis_disabledthen
213
216
returntext
214
217
end
@@ -251,11 +254,11 @@ function M.get_active_servers_prompt(servers, add_example, enable_toggling_mcp_s
251
254
returns.status=="disabled"
252
255
end, servers)
253
256
254
-
prompt=prompt.."\n# Connected MCP Servers"
257
+
prompt=prompt.."\n## Connected MCP Servers"
255
258
256
259
prompt=prompt
257
260
.."\n\nWhen a server is connected, you can use the server's tools via the `use_mcp_tool` tool, "
258
-
.."and access the server's resources via the `access_mcp_resource` tool.\nNote: Server names are case sensitive and you should always use the exact full name like `Firecrawl MCP` or `src/user/main/time-mcp` etc\n\n"
261
+
.."and access the server's resources via the `access_mcp_resource` tool.\nNote: Server names are case sensitive and you should always use the exact full name like `Firecrawl MCP` or `src/user/main/time-mcp` etc\n\n"
259
262
if#connected_servers==0then
260
263
prompt=prompt.."(No connected MCP servers)\n\n"
261
264
else
@@ -265,7 +268,7 @@ function M.get_active_servers_prompt(servers, add_example, enable_toggling_mcp_s
265
268
end
266
269
267
270
-- instead of removing the whole disabled section, if we dont want auto toggling we set (NO disabled servers) to avoid llm hallucinating server names
268
-
prompt=prompt.."# Disabled MCP Servers\n\n"
271
+
prompt=prompt.."## Disabled MCP Servers\n\n"
269
272
prompt=prompt
270
273
.."When a server is disabled, it will not be able to provide tools or resources. You can start one of the following disabled servers by using the `toggle_mcp_server` tool on `mcphub` MCP Server if it is connected using `use_mcp_tool`\n\n"
@@ -275,7 +278,9 @@ function M.get_active_servers_prompt(servers, add_example, enable_toggling_mcp_s
275
278
prompt=prompt..M.server_to_text(server) .."\n\n"
276
279
end
277
280
end
278
-
localtoggle_example=[[## Toggling a MCP Server
281
+
localtoggle_example=[[
282
+
283
+
### Toggling a MCP Server
279
284
280
285
When you need to start a disabled MCP Server or vice-versa, use the `toggle_mcp_server` tool on `mcphub` MCP Server using `use_mcp_tool`:
281
286
@@ -286,17 +291,15 @@ Pseudocode:
286
291
use_mcp_tool
287
292
server_name: "mcphub"
288
293
tool_name: "toggle_mcp_server"
289
-
tool_input:
294
+
tool_input:
290
295
server_name: string (One of the available server names to start or stop)
291
296
action: string (one of `start` or `stop`)
292
297
]]
293
298
294
299
localexample=[[
300
+
## Examples
295
301
296
-
297
-
# Examples:
298
-
299
-
## `use_mcp_tool`
302
+
### `use_mcp_tool`
300
303
301
304
When you need to call a tool on an MCP Server, use the `use_mcp_tool` tool:
302
305
@@ -307,7 +310,7 @@ use_mcp_tool
307
310
tool_name: string (name of the tool in the server to call)
308
311
tool_input: object (Arguments for the tool call)
309
312
310
-
## `access_mcp_resource`
313
+
### `access_mcp_resource`
311
314
312
315
When you need to access a resource from a MCP Server, use the `access_mcp_resource` tool:
313
316
@@ -316,7 +319,6 @@ Pseudocode:
316
319
access_mcp_resource
317
320
server_name: string (One of the available server names)
318
321
uri: string (uri for the resource)
319
-
320
322
]]
321
323
322
324
ifenable_toggling_mcp_serversthen
@@ -534,7 +536,7 @@ Server Details:
534
536
535
537
Installation Instructions:
536
538
1. Review README instructions below
537
-
2. Follow setup steps from README
539
+
2. Follow setup steps from README
538
540
3. Ask the user to provide any env variables or details required for the server configuration.
539
541
4. Update config at %s
540
542
5. Ask the user to Restart MCPHub by opening the UI and pressing "R" to restart the hub with updated config and ask the user to provide you with mcp tool if not already provided.
0 commit comments