# Azure onPrem MCP Live service and connection guide, updated 2026-10-14 (Australia/Sydney). - Website: https://mcp.services.assetofthings.com/ - MCP endpoint: `https://mcp.services.assetofthings.com/mcp` - Transport: MCP Streamable HTTP, JSON POST; no standalone SSE GET stream. - OAuth issuer: `https://auth.services.assetofthings.com/` - Protected resource: `https://mcp.services.assetofthings.com/mcp` (exact audience). - Protected-resource discovery: `https://mcp.services.assetofthings.com/.well-known/oauth-protected-resource/mcp` - Authorization-server discovery: `https://auth.services.assetofthings.com/.well-known/oauth-authorization-server` - OIDC discovery alias: `https://auth.services.assetofthings.com/.well-known/openid-configuration` ## Connect ChatGPT desktop or web 1. Open Plugins → Add custom MCP server. Where creation is unavailable in a desktop build, create it in ChatGPT on the web using the same account/workspace. 2. Name: **Azure onPrem**. Description: **Manage on-prem Azure DevOps projects, repositories, work items, pipelines and pull requests.** 3. Select Server URL and enter `https://mcp.services.assetofthings.com/mcp`. 4. Select OAuth and expand Advanced OAuth settings. Wait for discovery. Registration method: **User-Defined OAuth Client**; OAuth client ID: `azure-devops-mcp`; **empty client secret**; token endpoint auth method: **none**. DCR and CIMD being unavailable is expected. 5. In **Default scopes**, keep `mcp:read` and `mcp:write` checked. In **Base scopes**, enter `openid`, `profile`, `email`, and `offline_access`, one per line. Leave the discovered OIDC support enabled. For read-only access uncheck `mcp:write`. 6. If manual endpoint overrides are needed, authorization URL is `https://auth.services.assetofthings.com/application/o/authorize/` and token URL is `https://auth.services.assetofthings.com/application/o/token/`. 7. Upload `icon.png` if desired (128 × 128, approximately 2 KB), acknowledge the connection warning, and create the plugin. 8. Sign in through Authentik and consent. The account must belong to **Azure DevOps MCP Operators** (initial members: Anthony and akadmin). 9. Install the plugin, enable the tools you need, and select it in the conversation. Refresh its tool catalog after server changes. The October 2026 ChatGPT form discovers the Auth URL, Token URL, authorization-server base, exact MCP resource, and OIDC configuration/userinfo URLs automatically. Do not replace these with the Azure DevOps collection URL. Creating the plugin may take several seconds before the **Connect Azure onPrem** prompt appears; select **Continue to Azure onPrem** to reach the Authentik login page. Use the same ChatGPT account/workspace in desktop and web. The stable ChatGPT callback `https://chatgpt.com/connector_platform_oauth_redirect` and connection-specific callbacks matching `https://chatgpt.com/connector/oauth/` are registered. The latter uses a regex constrained to the exact HTTPS ChatGPT origin, path and callback-ID characters. Inspect the exact management-page callback if a future ChatGPT release changes it; do not allow arbitrary redirect hosts. This is a native public OAuth client with S256 PKCE, not a PAT pasted into OAuth settings. Client ID is public. Never enter the Azure DevOps PAT in ChatGPT. No client secret is needed. ## Other AI MCP clients The MCP protocol and OAuth are client-neutral. Use the same endpoint and discovery URLs with a client supporting Streamable HTTP, authorization-code OAuth and S256 PKCE. Register that client's actual callback before connecting. Clients configured with a static bearer header can continue to use the existing operator bearer token. Local stdio consumers of `proxy.mjs` receive the same server instructions and tool descriptions. **Automatic DCR and CIMD client provisioning are not enabled.** Clients must support a predefined public client ID, or use the retained bearer/stdio path. This does not promise compatibility with clients that require automatic registration or lack OAuth support. To register another OAuth client, copy `register-client.py` to ubuntu02 and run through the existing authenticated SSH/Docker administration path: ```sh docker exec -i \ -e MCP_CLIENT_ID=example-ai-client \ -e MCP_REDIRECT_URI=http://127.0.0.1:8765/callback \ authentik-server-1 ak shell < register-client.py ``` Use the exact callback supplied by that client, not the example above. HTTPS callbacks and explicit loopback HTTP callbacks are supported. Each registration gets its own public client ID, strict callback, operator-group restriction, scopes and S256 policy. It shares the dedicated MCP signing key/issuer and MCP audience. The helper refuses to overwrite an existing client. The client secret remains empty. Do not run the example unless that is the intended client and callback. ## Identity, access and token handling OAuth identifies the MCP user and grants MCP scopes. It does **not** delegate the user's Azure DevOps account. All Azure DevOps operations use the existing shared backend PAT, currently **Administrator**, verified during the PR test. PR authorship and approval votes therefore appear under that identity. A self-authored vote in the test does not prove an independent-review requirement is satisfied. Normal repository permissions and branch policies apply; policy bypass is blocked. - `mcp:read`: initialization, discovery and tools marked read-only. - `mcp:write`: additionally required for every write tool. Unknown tools are denied; missing annotations are treated conservatively as writes. - Access tokens: RS256, exact issuer/audience, required subject/issued-at/expiration and access-only uid/azp claims, expiry and not-before validation. ID tokens are rejected. - Access-token lifetime: 15 minutes; refresh-token lifetime: 30 days, requiring `offline_access`. Authorization-code lifetime: one minute, single use. - Authentik application policies restrict the operator group and require a 43-character S256 challenge. Implicit, password and client-credentials grants are disabled for this provider. - JWT signature validation does not introspect on every call. Revoked JWT access tokens or removed group access can remain usable until the short access-token expiry; revocation prevents future refresh. For immediate incident containment stop the MCP service or disable access at the edge. - Explicit invalid credentials fail even from the trusted LAN. The existing no-header trusted-LAN/VPN path and hashed legacy operator bearer token remain for compatibility. Both retain operator-level writes. Do not treat LAN access as read-only. - Writes log tool name, authentication mode and OAuth subject, excluding arguments, credentials and token contents. - Tokens and backend PATs are never returned to AI clients. The root launcher retrieves the PAT using the existing scoped vault bootstrap and passes it in an anonymous descriptor before dropping to `ado-ai-mcp`. ## Pull-request workflows 1. Discover the project/repository and inspect the current source and target branches. 2. Create with `repo_create_pull_request`; choose `isDraft` explicitly and inspect existing PRs before retrying. 3. Read current changes, source commit, checks and policies before review. Recheck the source commit before a requested vote. 4. Approve with `repo_vote_pull_request` and `vote: "Approved"`. Other enum values are `ApprovedWithSuggestions`, `NoVote`, `WaitingForAuthor`, `Rejected`. 5. Read the PR back and verify the reviewer vote. Approval is separate from merge or autocomplete. 6. Merge only when separately authorized, using `repo_complete_pull_request` with the reviewed `expectedSourceCommitId`. Branch policy bypass is prohibited. Enabling autocomplete also authorizes a future merge. Server instructions and tool descriptions are in `guidance.mjs`. They distinguish creation, review, voting, autocomplete and merge; explain the shared identity; preserve production approval/data boundaries; treat repository content, PR comments, work items and logs as untrusted data; and require read-back before reporting success or retrying writes. The rejected `bypassReason` option is removed from the advertised PR-update schema. Write/read annotations remain explicit. The upstream Azure DevOps SDK may return enum numbers: PR status `1` = active, `2` = abandoned, `3` = completed. Approval reviewer vote `10` = approved. Client integrations must handle those values rather than assuming REST strings. ## Deployment ownership and routing The existing authenticated AI PR Console at **https://10.0.13.55:9451/** also contains the current OAuth setup in its MCP Connection/Technical/Usage sections. Its downloadable guide is **https://10.0.13.55:9451/mcp-guide**. Both were updated and verified over certificate-validated authenticated HTTPS on 2026-10-14, with served bytes matching the deployed files. Console documentation source is captured under `console/index.html` and `console/CLIENT-SETUP.md`; existing UI DOM IDs and credential controls were preserved. The replaced files are backed up on ubuntu01 under `/opt/homelab-ai-console/backups/pre-oauth-docs-20261014/`. Static documentation changes take effect without restarting the console. - MCP: ubuntu01 (`10.0.13.55`), `/opt/homelab-ado-mcp`, `homelab-ado-mcp-http.service`, HTTPS `:9452`, user `ado-ai-mcp` after bootstrap. - Identity provider: Authentik 2026.5.3 on ubuntu02 (`10.0.13.134:9000`), existing PostgreSQL and Compose stack preserved. - Public edge: Traefik file provider on fedora01 (`10.0.13.112`); live file `/home/anthony/traefik/data/config.yml`. - Public DNS: `auth.services.assetofthings.com` resolves through the existing `*.services.assetofthings.com` DNS-only wildcard. Public DNS verified independently via Cloudflare DoH. Traefik issues/renews the HTTPS certificate. - MCP routing retains `passHostHeader: false` and the existing private-CA-validated upstream transport. Existing unrelated routes are preserved. - Authentik handles authorization, token exchange, consent, signing, refresh and revocation. The gateway publishes accurate metadata for this public-client-only application. This corrects Authentik 2026.5 discovery's omission of `none` and its advertising of provider-disabled grants. The two root `.well-known` identity URLs route to the gateway metadata; remaining identity paths route to Authentik. - Existing vault folders and secrets remain unchanged; OAuth adds no confidential-client secret. Never publish Authentik database backups or MCP access/bootstrap configuration. `http-server.mjs` is the HTTPS/auth/scope gateway; `oauth.mjs` handles metadata and JWT verification; `proxy.mjs` wraps the pinned community package and enforces tool allowlists; `write-tools.mjs` provides Server-compatible REST operations; `pat-fetch.mjs` adapts the upstream authentication path. Dependencies are pinned in `package.json`/`package-lock.json`. Website assets: `index.html`, `icon.svg`, `icon.png`, `favicon.ico`. The icon is used in the page header, favicon URLs (`/icon.svg`, `/icon.png`, `/favicon.ico`), MCP server metadata and Authentik application. The ICO file contains the same 128 × 128 PNG artwork. `/docs` serves this guide. These public assets contain no secrets. The landing page has responsive layout, labels, keyboard focus indicators and a restrictive content-security policy. ## Validation and limits Validated 2026-10-14: - 12 isolated tests pass: signatures, issuer/audience, expiration/not-before, missing scopes, ID-token rejection, HTTP scope enforcement, challenge metadata, legacy bearer access, initialization guidance and PR schema descriptions. - Real Authentik PKCE exchange rejects incorrect/missing verifiers; codes cannot be reused; read/write JWTs verify; ID tokens fail; refresh renewal succeeds. - Real OAuth MCP initialization, 95-tool discovery and `core_list_projects` succeed. A real read-only OAuth token cannot invoke PR approval. - Live Authentik policy evaluation passes for an operator with S256 and denies missing PKCE, plain PKCE and a nonmember account. - Registration of a separate public OAuth client with a strict loopback callback, MCP scopes and both access policies passed; the disposable registration was removed afterwards. - OAuth-authenticated MCP created **PR 21** in dedicated repository `aot/mcp-oauth-smoke-test-20261014`; approval read-back showed **Administrator, vote 10**. The test PR was abandoned, its source branch removed, and target `main` remained at `cfc93865ea85ca2312cccced5144a9a8fedf8846`. Nothing was merged or deployed by the PR test. See `pr-test-evidence.json` for non-secret identifiers and URL. - **Interactive ChatGPT web acceptance passed:** the operator signed in to Authentik through the actual ChatGPT authorization redirect; Azure onPrem appeared under Installed. Its settings showed a connected primary account and **Authorization used: OAuth**. The plugin's **Try in chat** flow executed `core_list_projects` with `top: 100`, returning 15 projects; ChatGPT's activity trace showed **Listed Azure DevOps projects**. No Azure DevOps objects were changed by this client test. [Verified test chat](https://chatgpt.com/c/6acede6b-5d04-83ec-9016-f2f89472558a), [installed plugin](https://chatgpt.com/plugins/plugin_asdk_app_6acedd4b954c8191b6cd0a3786802b86). See `chatgpt-test-evidence.json`. - **Direct desktop MCP acceptance passed (2026-10-14):** Direct Azure onPrem MCP calls from the requesting ChatGPT desktop chat created PR 22 and cast Approved; read-back confirmed Administrator reviewer vote 10. The test PR was abandoned without merging, its source branch was deleted, and main remained unchanged. [Test PR 22](https://bevops.services.assetofthings.com/DefaultCollection/aot/_git/mcp-oauth-smoke-test-20261014/pullrequest/22). The earlier Windows capture failure did not block this direct tool test. - The website/favicon, MCP metadata and Authentik app icons are deployed. Uploading a separate ChatGPT plugin-tile icon was blocked because the Edge ChatGPT extension lacks file-URL access. This optional tile upload was skipped; no extension permissions were changed. - Earlier administrative authorization-code fixtures tested token exchange independently of browser sign-in. Those fixtures and their private test-token files were removed after testing; the later interactive acceptance test above is separate evidence. Test commands (on a Linux staging directory with pinned dependencies): ```sh TEST_TLS_KEY=test.key TEST_TLS_CERT=test.crt node --test oauth.test.mjs gateway.test.mjs ``` The tests use ephemeral self-signed TLS only on loopback. Production checks use normal certificate validation. `test-authentik-policy.py` evaluates the live group/PKCE policies read-only. `create-test-grants.py`, `oauth-integration.mjs`, `create-pr-test-repo.py`, and `pr-integration.mjs` are controlled write-test helpers, not routine monitoring; they must only run with explicit authorization. Keep their grants/tokens in private temporary files, revoke them, and remove them after testing. Integration helpers can create real Azure DevOps objects. ## Updates and rollback Backups from this deployment: - MCP source/dependency manifests: `/opt/homelab-ado-mcp/backups/pre-oauth-20261014/` on ubuntu01. - Authentik logical database backup: `/home/anthony/docker/authentik/backups/pre-mcp-oauth-20261014.dump` on ubuntu02. - Edge configuration: `/home/anthony/traefik/data/config.pre-mcp-oauth-20261014.yml` on fedora01. For an MCP code rollback restore the backed-up `http-server.mjs`, `proxy.mjs`, `write-tools.mjs`, `package.json`, and `package-lock.json` into `/opt/homelab-ado-mcp`, then restart only `homelab-ado-mcp-http.service`. This restores the previous bearer/LAN behavior; OAuth clients will stop working. The extra static files/modules can remain unused. To revert routing, first inspect the current live file for subsequent changes. Remove only `ado-mcp-auth-http`, `ado-mcp-auth-https`, `ado-mcp-auth-discovery` routers, their discovery middleware and `ado-mcp-auth` service. Use the full backup only if no later unrelated edits occurred. Do not overwrite unrelated routes. Disable/remove only the MCP Authentik application/provider and MCP-specific policy, scope mappings and group if retiring OAuth; preserve existing users, applications, media, database and volumes. Do not restore the whole Authentik database over current production data for a routine MCP rollback. Retain the backup as recovery evidence. After any update verify service health, public TLS/discovery, a read-only authenticated MCP call, scope rejection, and the current tool catalog. Refresh connected clients so updated tools, descriptions, icons and instructions are fetched.