-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: ABX
-
Needed
-
-
None
-
None
-
None
-
None
-
None
-
None
TL;DR
Create a standalone TypeScript package that provides the same user-facing behavior as the Python MongoDB session store (INTPYTHON-1109), using the official MongoDB Node.js driver.
Context
The Claude Agent SDK runs agent conversations. A session contains the main conversation and any conversations started by subagents; each conversation's recorded messages and metadata form a transcript.
The Python implementation persists these transcripts in MongoDB so applications can resume sessions, list their summaries, and manage retention. TypeScript applications should have an equivalent supported package, including the reliability and security improvements in the current Python implementation.
Desired User Experience
Today, Python users configure a MongoDB client and pass the store to the SDK. TypeScript users should be able to follow the same pattern without implementing their own adapter.
Proposed TypeScript usage — package name and SDK integration syntax must be confirmed against the supported TypeScript SDK release:
import { MongoClient } from "mongodb"; import { query } from "@anthropic-ai/claude-agent-sdk"; import { MongoDBSessionStore } from "claude-agent-sdk-mongodb-session-store"; const client = new MongoClient("mongodb://localhost:27017/claude"); // Constructors can receive a Client or a URI const store = new MongoDBSessionStore({ client }); await store.createSchema(); for await (const message of query({ prompt: "Continue", options: { sessionStore: store, resume: sessionId }, })) { /* Handle messages. */ }
Just like in the python version, TypeScript applications should also be able to configure collection names, list sessions and summaries, delete an individual subagent transcript or an entire session, and explicitly remove inactive sessions.
Task
Goal: Give TypeScript applications a reusable MongoDB persistence adapter with behavioral parity to the Python package.
- Export MongoDBSessionStore following the same interface as the Python version.
- Match the Python store's behavior for transcript operations.
- Produce an npm-ready package with type declarations and documented SDK, driver, and Node.js compatibility.
Reference implementation: Python MongoDB session store.
Acceptance Criteria
- [ ] Pass TypeScript equivalents of the minimum relevant Python tests
- [ ] Users can supply their existing MongoDB client and configure the database and collections without changing SDK code.
- [ ] The TypeScript package exposes the same functions and interfaces as the Python counterpart.
- [ ] Create a linked ticket to add the TypeScript integration to MongoDB's integration documentation.
Other References
- blocks
-
NODE-7855 [Claude Agent SDK] Package and publish
-
- Backlog
-
- is related to
-
INTPYTHON-1109 [Claude Agent SDK] SessionStorage adapter
-
- In Progress
-
- links to