Skip to content

Commit 75bd743

Browse files
committed
feat(mcp): fix storage key
1 parent c9a8919 commit 75bd743

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

doit-mcp-server/src/index.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,25 +83,20 @@ export class DoitMCPAgent extends McpAgent {
8383
// Persist props to Durable Object storage
8484
private async saveProps(): Promise<void> {
8585
if (this.ctx?.storage) {
86-
await this.ctx.storage.put("persistedProps", {
87-
customerContext: this.props.customerContext,
88-
lastUpdated: Date.now(),
89-
});
86+
await this.ctx.storage.put("persistedProps", this.props.customerContext);
9087
}
9188
}
9289

9390
// Load props from Durable Object storage
9491
private async loadPersistedProps(): Promise<void> {
9592
if (this.ctx?.storage) {
96-
const persistedProps = await this.ctx.storage.get<{
97-
apiKey: string;
98-
customerContext: string;
99-
lastUpdated: number;
100-
}>("persistedProps");
93+
const persistedProps = await this.ctx.storage.get<string>(
94+
"persistedProps"
95+
);
10196
if (persistedProps) {
10297
console.log("Loading persisted props:", persistedProps);
10398
// Update props with persisted values
104-
this.props.customerContext = persistedProps.customerContext;
99+
this.props.customerContext = persistedProps;
105100
}
106101
}
107102
}

0 commit comments

Comments
 (0)