Azure / Azure/data-api-builder

Refactor MCP to allow post-startup hydration of config file

Offen
#3,012 0 Kommentare 0 Reaktionen 1 zugewiesene Person Beansprucht von @RubenCerna2079 Auf GitHub ansehen
mcp-server
Vorherrschende Sprache
C#
Sterne
1.5k
Forks
370
Ø Merge
3 T. 17 Std.
Gemergte PRs (30 T.)
8

Beschreibung

Currently DAB is not able to run MCP if it is started without a config file which is added later on. In order to fix this issue, the way the MCP service is added needs to be changed.

The files that need to be changed are:
- `Startup.cs`: All places where the MCP services are only added if the MCP property is enabled need to always be started, no matter if it is enabled or disabled (This will also help with allowing it to be hot-reloadable). In the section that sets the MCP endpoint it needs to be changed so that it always uses the default endpoint, similarly to how it is done in GraphQL. Lastly, in the `PerformOnConfigChangeAsync` function the Dependency Injection for MCP services need to be manually triggered, which will then populate all its services only when the config file is set, similar to how it is done for REST and GraphQL.
- `PathRewriteMiddleware.cs`: In the `InvokeAsync` function we need to change the path the user uses if it is different from the default, similarly to how we do it with GraphQL.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.