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
Add prompts support to SDK
* Prompts can be accessed via dynamic proxy syntax (client.servers.foo.prompts.bar()) or explicit methods.
* Client-level methods namespace prompt names as serverName__promptName to prevent collisions across multiple servers.
* API documentation in README.
---------
Co-authored-by: Khaled Osman <thisiskhaled@proton.me>
Copy file name to clipboardExpand all lines: README.md
+105Lines changed: 105 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -228,6 +228,108 @@ if (await client.servers[serverName].hasTool("get_current_time")) {
228
228
}
229
229
```
230
230
231
+
#### `client.getPrompts(options?)`
232
+
233
+
Returns prompt schemas from all (or specific) servers with names transformed to `serverName__promptName` format.
234
+
235
+
**IMPORTANT**: Prompt names are automatically transformed to prevent naming clashes and identify server origin. Original prompt name `create_pr` on server `github` becomes `github__create_pr`.
236
+
237
+
This is useful for:
238
+
239
+
- Aggregating prompts from multiple servers
240
+
- Prompt inspection and discovery across all servers
241
+
- Custom tooling that needs raw MCP prompt schemas with unique names
0 commit comments