From 9a0e3b1e82e3e200fad474493c1465d0d86204d1 Mon Sep 17 00:00:00 2001 From: Derek Gabriel Date: Sat, 8 Aug 2026 20:48:51 -1000 Subject: [PATCH 1/2] Refresh Azure Functions MCP dependencies --- CHANGELOG.md | 3 ++- README.md | 4 ++++ docs/devbrain-spec-v1.md | 7 ++++--- src/DevBrain.Functions/DevBrain.Functions.csproj | 5 ++--- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ff9622..7810ca3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,7 +12,8 @@ All notable changes to DevBrain are tracked in this file. Versions follow [Seman - Added reason-specific server-side diagnostics for OAuth refresh failures. `TokenHandler/refresh` now logs a stable rejection reason (`missing`, `expired`, `replay_window_expired`, `wrong_client`, `upstream_missing_or_expired`, etc.) plus short SHA-256 refresh-token fingerprints so stale per-session client credential generations can be correlated without logging token material. - Updated the compatibility notes for the modern unified ChatGPT/Codex Windows app, which is currently working well with DevBrain OAuth but remains under monitoring rather than being marked fully resolved. - Added optional OAuth token-window settings for deployments that need a different refresh cadence or replay tolerance: `OAUTH_ACCESS_TOKEN_LIFETIME_MINUTES` and `OAUTH_REFRESH_REPLAY_LIFETIME_MINUTES` flow through Bicep to `OAuth__AccessTokenLifetimeMinutes` and `OAuth__RefreshReplayLifetimeMinutes`. Values must be whole minutes from 1 through 1,440. If left unset, DevBrain uses its built-in defaults: 10 minutes for access tokens and 5 minutes for refresh replay markers. -- Refreshed the deployed runtime dependency stack to current compatible NuGet releases, including `Microsoft.Azure.Functions.Worker` 2.52.0, `Microsoft.Azure.Functions.Worker.Extensions.Mcp` 1.5.0, `ModelContextProtocol` 1.3.0, `Microsoft.ApplicationInsights.WorkerService` 2.23.0, `Microsoft.Azure.Cosmos` 3.60.0, `Microsoft.Extensions.Azure` 1.14.0, IdentityModel 8.18.0, `Microsoft.AspNetCore.DataProtection` 10.0.8, and `System.Security.Cryptography.Xml` 10.0.10. +- Refreshed the deployed runtime dependency stack to current compatible NuGet releases, including `Microsoft.Azure.Functions.Worker` 2.52.0, `Microsoft.Azure.Functions.Worker.Extensions.Mcp` 1.6.0, `Microsoft.ApplicationInsights.WorkerService` 2.23.0, `Microsoft.Azure.Cosmos` 3.60.0, `Microsoft.Extensions.Azure` 1.14.0, IdentityModel 8.18.0, `Microsoft.AspNetCore.DataProtection` 10.0.10, and `System.Security.Cryptography.Xml` 10.0.10. +- Removed the unused direct `ModelContextProtocol` package reference. DevBrain's MCP transport is owned by the Azure Functions host extension; Functions MCP 1.6.0 still embeds the older SDK line supporting MCP through `2025-06-18`, so this maintenance update does not claim support for MCP `2026-07-28`. - Kept Application Insights on the direct Azure Functions isolated worker integration path (`AddApplicationInsightsTelemetryWorkerService` + `ConfigureFunctionsApplicationInsights`) instead of moving to the newer OpenTelemetry telemetry wiring. - Refreshed test tooling to `Microsoft.NET.Test.Sdk` 18.6.0, `xunit.runner.visualstudio` 3.1.5, and `Microsoft.Extensions.TimeProvider.Testing` 10.6.0. - Synced the release notes with merged Dependabot PR #19, which already moved `Microsoft.AspNetCore.DataProtection` and `System.Security.Cryptography.Xml` to 10.0.7. diff --git a/README.md b/README.md index e4622e5..fd14de4 100644 --- a/README.md +++ b/README.md @@ -325,6 +325,10 @@ Access tokens are short-lived and DevBrain refresh tokens rotate on every refres ## Known Limitations +### MCP protocol revision + +DevBrain uses `Microsoft.Azure.Functions.Worker.Extensions.Mcp` 1.6.0 for its hosted MCP endpoint. That extension currently embeds the older official C# SDK line and negotiates MCP through protocol revision `2025-06-18`; updating an application-level `ModelContextProtocol` package cannot change the host's wire behavior. Supporting MCP `2026-07-28` will require either a future Azure Functions MCP host update or a deliberate migration to an application-owned MCP HTTP host. Existing clients that negotiate a supported revision continue to work normally. + ### VS Code / GitHub Copilot MCP extension — OAuth not triggered VS Code connects to the MCP endpoint, gets a 200 OK on `tools/list`, discovers all 7 tools, and proceeds as if no auth is required. Tool calls then fail with a missing Bearer token. **VS Code's behavior is correct per the MCP authorization spec** — the spec requires the server to challenge unauthenticated requests with `401 + WWW-Authenticate: Bearer resource_metadata="..."`, at which point the client reads PRM and starts OAuth. diff --git a/docs/devbrain-spec-v1.md b/docs/devbrain-spec-v1.md index 1990fef..9d33bd1 100644 --- a/docs/devbrain-spec-v1.md +++ b/docs/devbrain-spec-v1.md @@ -1,5 +1,7 @@ # DevBrain v1 — Sprint Spec +> **Historical planning document.** This records the original v1 scope and is not the current operational architecture. See the repository README and implementation for the deployed design. + **Repository:** `github.com/Ignite-Solutions-Group/devbrain` **Purpose:** A remote MCP server that gives any AI tool (Claude web, Claude Code CLI, GitHub Copilot, Cursor) persistent, shared access to developer knowledge — sprint docs, architecture decisions, project state. One brain. Zero upload tax. **Stack:** .NET 10 · C# 14 · Azure Functions (isolated worker) · Cosmos DB NoSQL · Entra ID · Bicep · `azd` @@ -89,7 +91,7 @@ Partition key path: `/key`. The `id` and `key` fields are always identical — t ## MCP Tools -All four tools are implemented in `DocumentTools.cs` using `[McpServerTool]` attributes from the `ModelContextProtocol` C# SDK. The Azure Functions MCP extension (`Microsoft.Azure.Functions.Worker.Extensions.Mcp`) wires them into the Functions runtime via `[McpToolTrigger]`. +The original four tools are implemented in `DocumentTools.cs` using `[McpToolTrigger]` and `[McpToolProperty]` from `Microsoft.Azure.Functions.Worker.Extensions.Mcp`. DevBrain does not register a second MCP server from the official `ModelContextProtocol` C# SDK in the isolated worker process; the Azure Functions host extension owns the MCP wire protocol and dispatches tool invocations to the worker. ### `UpsertDocument` @@ -148,13 +150,12 @@ Authentication is handled by Azure Functions' built-in Easy Auth (App Service Au - ``` -Use current stable/GA versions. `Microsoft.Azure.Functions.Worker.Extensions.Mcp` is GA as of late 2025. +Use current stable/GA versions. The current package versions are recorded in `DevBrain.Functions.csproj`. --- diff --git a/src/DevBrain.Functions/DevBrain.Functions.csproj b/src/DevBrain.Functions/DevBrain.Functions.csproj index 9b711f8..9743a78 100644 --- a/src/DevBrain.Functions/DevBrain.Functions.csproj +++ b/src/DevBrain.Functions/DevBrain.Functions.csproj @@ -10,15 +10,14 @@ - + - - + From fdbdc4ab995edbb173e13559eb9bb0769a943c78 Mon Sep 17 00:00:00 2001 From: Derek Gabriel Date: Sat, 8 Aug 2026 21:38:55 -1000 Subject: [PATCH 2/2] Tighten MCP dependency update scope --- CHANGELOG.md | 3 +-- README.md | 4 ---- docs/devbrain-spec-v1.md | 6 ++---- src/DevBrain.Functions/DevBrain.Functions.csproj | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7810ca3..0ed9249 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,8 +12,7 @@ All notable changes to DevBrain are tracked in this file. Versions follow [Seman - Added reason-specific server-side diagnostics for OAuth refresh failures. `TokenHandler/refresh` now logs a stable rejection reason (`missing`, `expired`, `replay_window_expired`, `wrong_client`, `upstream_missing_or_expired`, etc.) plus short SHA-256 refresh-token fingerprints so stale per-session client credential generations can be correlated without logging token material. - Updated the compatibility notes for the modern unified ChatGPT/Codex Windows app, which is currently working well with DevBrain OAuth but remains under monitoring rather than being marked fully resolved. - Added optional OAuth token-window settings for deployments that need a different refresh cadence or replay tolerance: `OAUTH_ACCESS_TOKEN_LIFETIME_MINUTES` and `OAUTH_REFRESH_REPLAY_LIFETIME_MINUTES` flow through Bicep to `OAuth__AccessTokenLifetimeMinutes` and `OAuth__RefreshReplayLifetimeMinutes`. Values must be whole minutes from 1 through 1,440. If left unset, DevBrain uses its built-in defaults: 10 minutes for access tokens and 5 minutes for refresh replay markers. -- Refreshed the deployed runtime dependency stack to current compatible NuGet releases, including `Microsoft.Azure.Functions.Worker` 2.52.0, `Microsoft.Azure.Functions.Worker.Extensions.Mcp` 1.6.0, `Microsoft.ApplicationInsights.WorkerService` 2.23.0, `Microsoft.Azure.Cosmos` 3.60.0, `Microsoft.Extensions.Azure` 1.14.0, IdentityModel 8.18.0, `Microsoft.AspNetCore.DataProtection` 10.0.10, and `System.Security.Cryptography.Xml` 10.0.10. -- Removed the unused direct `ModelContextProtocol` package reference. DevBrain's MCP transport is owned by the Azure Functions host extension; Functions MCP 1.6.0 still embeds the older SDK line supporting MCP through `2025-06-18`, so this maintenance update does not claim support for MCP `2026-07-28`. +- Refreshed the deployed runtime dependency stack to current compatible NuGet releases, including `Microsoft.Azure.Functions.Worker` 2.52.0, `Microsoft.Azure.Functions.Worker.Extensions.Mcp` 1.6.0, `Microsoft.ApplicationInsights.WorkerService` 2.23.0, `Microsoft.Azure.Cosmos` 3.60.0, `Microsoft.Extensions.Azure` 1.14.0, IdentityModel 8.18.0, `Microsoft.AspNetCore.DataProtection` 10.0.8, and `System.Security.Cryptography.Xml` 10.0.10. Removed the unused direct `ModelContextProtocol` package reference. - Kept Application Insights on the direct Azure Functions isolated worker integration path (`AddApplicationInsightsTelemetryWorkerService` + `ConfigureFunctionsApplicationInsights`) instead of moving to the newer OpenTelemetry telemetry wiring. - Refreshed test tooling to `Microsoft.NET.Test.Sdk` 18.6.0, `xunit.runner.visualstudio` 3.1.5, and `Microsoft.Extensions.TimeProvider.Testing` 10.6.0. - Synced the release notes with merged Dependabot PR #19, which already moved `Microsoft.AspNetCore.DataProtection` and `System.Security.Cryptography.Xml` to 10.0.7. diff --git a/README.md b/README.md index fd14de4..e4622e5 100644 --- a/README.md +++ b/README.md @@ -325,10 +325,6 @@ Access tokens are short-lived and DevBrain refresh tokens rotate on every refres ## Known Limitations -### MCP protocol revision - -DevBrain uses `Microsoft.Azure.Functions.Worker.Extensions.Mcp` 1.6.0 for its hosted MCP endpoint. That extension currently embeds the older official C# SDK line and negotiates MCP through protocol revision `2025-06-18`; updating an application-level `ModelContextProtocol` package cannot change the host's wire behavior. Supporting MCP `2026-07-28` will require either a future Azure Functions MCP host update or a deliberate migration to an application-owned MCP HTTP host. Existing clients that negotiate a supported revision continue to work normally. - ### VS Code / GitHub Copilot MCP extension — OAuth not triggered VS Code connects to the MCP endpoint, gets a 200 OK on `tools/list`, discovers all 7 tools, and proceeds as if no auth is required. Tool calls then fail with a missing Bearer token. **VS Code's behavior is correct per the MCP authorization spec** — the spec requires the server to challenge unauthenticated requests with `401 + WWW-Authenticate: Bearer resource_metadata="..."`, at which point the client reads PRM and starts OAuth. diff --git a/docs/devbrain-spec-v1.md b/docs/devbrain-spec-v1.md index 9d33bd1..e1bc01e 100644 --- a/docs/devbrain-spec-v1.md +++ b/docs/devbrain-spec-v1.md @@ -1,7 +1,5 @@ # DevBrain v1 — Sprint Spec -> **Historical planning document.** This records the original v1 scope and is not the current operational architecture. See the repository README and implementation for the deployed design. - **Repository:** `github.com/Ignite-Solutions-Group/devbrain` **Purpose:** A remote MCP server that gives any AI tool (Claude web, Claude Code CLI, GitHub Copilot, Cursor) persistent, shared access to developer knowledge — sprint docs, architecture decisions, project state. One brain. Zero upload tax. **Stack:** .NET 10 · C# 14 · Azure Functions (isolated worker) · Cosmos DB NoSQL · Entra ID · Bicep · `azd` @@ -91,7 +89,7 @@ Partition key path: `/key`. The `id` and `key` fields are always identical — t ## MCP Tools -The original four tools are implemented in `DocumentTools.cs` using `[McpToolTrigger]` and `[McpToolProperty]` from `Microsoft.Azure.Functions.Worker.Extensions.Mcp`. DevBrain does not register a second MCP server from the official `ModelContextProtocol` C# SDK in the isolated worker process; the Azure Functions host extension owns the MCP wire protocol and dispatches tool invocations to the worker. +All four tools are implemented in `DocumentTools.cs` using `[McpToolTrigger]` attributes from `Microsoft.Azure.Functions.Worker.Extensions.Mcp`. ### `UpsertDocument` @@ -155,7 +153,7 @@ Authentication is handled by Azure Functions' built-in Easy Auth (App Service Au ``` -Use current stable/GA versions. The current package versions are recorded in `DevBrain.Functions.csproj`. +Use current stable/GA versions. `Microsoft.Azure.Functions.Worker.Extensions.Mcp` is GA as of late 2025. --- diff --git a/src/DevBrain.Functions/DevBrain.Functions.csproj b/src/DevBrain.Functions/DevBrain.Functions.csproj index 9743a78..bdbd7e5 100644 --- a/src/DevBrain.Functions/DevBrain.Functions.csproj +++ b/src/DevBrain.Functions/DevBrain.Functions.csproj @@ -17,7 +17,7 @@ - +