Skip to content

Commit f32f302

Browse files
Merge pull request #18 from connor4312/connor4312/prompt-changes
Notify clients when new prompts are available
2 parents f9c79bd + 245b80b commit f32f302

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ To read gists, notes, and gist comments, prefer using the available resources vs
106106

107107
private createRequestContext(): RequestContext {
108108
return {
109+
server: this.server,
109110
gistStore: this.gistStore,
110111
starredGistStore: this.starredGistStore,
111112
axiosInstance: this.axiosInstance,

src/tools/prompts.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,8 @@ export default {
187187
context.gistStore.update(updatedGist);
188188
}
189189

190+
await context.server.sendPromptListChanged();
191+
190192
return `Successfully added prompt "${name}" to prompts collection`;
191193
},
192194
},

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
12
import { StarredGistStore, YourGistStore } from "./store.js";
23

34
// GitHub Gist API types
@@ -39,6 +40,7 @@ export interface Gist {
3940
// MCP / GistPad server types
4041

4142
export interface RequestContext {
43+
server: Server;
4244
gistStore: YourGistStore;
4345
starredGistStore: StarredGistStore;
4446
axiosInstance: any;

0 commit comments

Comments
 (0)