@@ -284,19 +284,6 @@ When using VNet configuration, additional Azure resources are provisioned:
284284
285285This project supports deploying with OAuth 2.0 authentication using Keycloak as the identity provider, implementing the [ MCP OAuth specification] ( https://modelcontextprotocol.io/specification/2025-03-26/basic/authorization ) with Dynamic Client Registration (DCR).
286286
287- ### Architecture
288-
289- ``` text
290- βββββββββββββββ 1. DCR + Token βββββββββββββββ
291- β LangChain β βββββββββββββββββββββββΊ β Keycloak β
292- β Agent β βββββββββββββββββββββββ β (direct) β
293- β β βββββββββββββββ
294- β β 2. MCP + Bearer
295- β β βββββββββββββββββββββββΊ βββββββββββββββ
296- β β βββββββββββββββββββββββ β mcproutes β β MCP Server
297- βββββββββββββββ βββββββββββββββ
298- ```
299-
300287### What gets deployed
301288
302289| Component | Description |
@@ -343,7 +330,7 @@ This project supports deploying with OAuth 2.0 authentication using Keycloak as
343330
344331 Login with ` admin ` and your configured password.
345332
346- ### Testing with the LangChain agent
333+ ### Testing with the agent
347334
3483351 . Generate the local environment file:
349336
@@ -356,33 +343,20 @@ This project supports deploying with OAuth 2.0 authentication using Keycloak as
3563432 . Run the agent:
357344
358345 ``` bash
359- uv run agents/langchainv1_keycloak .py
346+ uv run agents/agentframework_http .py
360347 ```
361348
349+ The agent automatically detects ` KEYCLOAK_REALM_URL ` in the environment and authenticates via DCR + client credentials.
350+
362351 Expected output:
363352
364353 ``` text
365- ============================================================
366- LangChain Agent with Keycloak-Protected MCP Server
367- ============================================================
368-
369- Configuration:
370- MCP Server: https://mcproutes.<env>.azurecontainerapps.io/mcp
371- Keycloak: https://mcp-<name>-kc.<env>.azurecontainerapps.io/realms/mcp
372- LLM Host: azure
373- Auth: Dynamic Client Registration (DCR)
374-
375- [11:40:48] INFO π Registering client via DCR...
376- INFO β
Registered client: caef6f47-0243-474d-b...
377- INFO π Getting access token from Keycloak...
378- INFO β
Got access token (expires in 300s)
379- INFO π‘ Connecting to MCP server...
380- INFO π§ Getting available tools...
381- INFO β
Found 1 tools: ['add_expense']
382- INFO π¬ User query: Add an expense: yesterday I bought a laptop...
383- ...
384- INFO π Agent Response:
385- The expense of $1200 for the laptop purchase has been successfully recorded.
354+ INFO π Auth enabled - connecting to https://mcproutes.<env>.azurecontainerapps.io/mcp with Bearer token
355+ INFO π Registering client via DCR...
356+ INFO β
Registered client: agentframework-20251205-...
357+ INFO π Getting access token from Keycloak...
358+ INFO β
Got access token (expires in 300s)
359+ The expense of $1200.0 for 'laptop' on 2025-12-04 has been successfully added.
386360 ```
387361
388362### Known limitations (demo trade-offs)
0 commit comments