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

Abierto
#8 0 comentarios 1 reacción 2 asignados Ver en GitHub

@xingfan-git ya está trabajando en esto.

Desde el 10/9/2025.

  • #9 de @copilot-swe-agent — abierto

Evaluación

Este issue todavía no se ha evaluado.

Descripción

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.

Lenguaje dominante
TypeScript
Estrellas
3
Forks
4
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoft/documentdb-mcp

Todos los issues de microsoft/documentdb-mcp

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.