microsoft / microsoft/documentdb-mcp

Add unified constructor mechanism to MCP TS API to allow client injection

Open
#8 0 comments 1 reaction 2 assignees View on GitHub

@xingfan-git is already working on this.

Since Sep 10, 2025.

enhancement
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 legacy folder 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 legacy folder).
  • 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.