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

オープン
#8 コメント 0 件 リアクション 1 件 担当者 2 名 GitHub で見る

@xingfan-git がすでに取り組んでいます。

2025年9月10日 から。

  • #9 @copilot-swe-agent による — オープン

評価

この issue はまだ評価されていません。

説明

enhancement

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.

主要言語
TypeScript
スター
3
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/documentdb-mcp のほかの issue

microsoft/documentdb-mcp の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。