microsoft / microsoft/documentdb-mcp
Add unified constructor mechanism to MCP TS API to allow client injection
@xingfan-git is already working on this.
Since Sep 10, 2025.
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 4
- Avg merge
- 6d 21h
- Merged PRs (30d)
- 3
Description
Summary
Enhance the TypeScript MCP API (excluding files under the legacy folder) by implementing a constructor mechanism that allows for an optional client to be injected. If a client is provided, the API should use the provided client to perform the corresponding database operations. The current API interfaces should remain functional, ensuring backward compatibility.
Details
- Implement a mechanism in the MCP TypeScript API that accepts an optional client object in the constructor.
- If a client is provided, use it for all subsequent database operations within that instance.
- Maintain all existing APIs, so consumers who do not provide a client will experience no breaking changes.
- Exclude all files under the
legacyfolder from this enhancement. - If feasible, consider designing this mechanism in a unified way across all relevant classes/modules, but this is optional.
Motivation
Allowing client injection improves testability, customizability, and flexibility for advanced users without disrupting existing consumers.
Acceptance Criteria
- The MCP TypeScript API can accept an optional client in its constructor (excluding the
legacyfolder). - If provided, the API uses the injected client for all operations.
- Backward compatibility is preserved.
- Enhancement is implemented in a unified fashion if possible (optional).
This issue is written in English to facilitate Copilot Agent comprehension.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.