How a2aoverlay/arxiv-2501.09674v1-agentic-delegation-demo works
Project type and purpose
• This is a toy demo of an AI-driven delegation workflow: a small “full-stack” microservice setup that shows how an OAuth server delegates access to an AI agent (the CalendarAgent) via the Model Context Protocol (MCP).
• It also contains an alternative “vc_based” subdirectory demonstrating a Verifiable-Credential–based variant of the same pattern.
File structure
• Top level:
• oauth_server.py – a Flask OAuth server that issues access tokens
• mcp_server.py – the CalendarAgent acting as an MCP server
• client_with_callback.py – an MCP client script that drives the flow and handles the OAuth callback
• servers_config.json – configuration of server endpoints/ports
• requirements.txt, Makefile – build/run scripts
• vc_based/ – a parallel demo using Verifiable Credentials:
• vc_issuer.py, vc_agent.py, vc_client.py, vc_verifier.py
• vc_based/README.md explaining the VC workflow
README for architecture hints
• Two parallel servers: Flask OAuth server & MCP CalendarAgent
User → OAuth server → MCP client → MCP server → OAuth server (calendar data) → MCP client
• Key endpoints:
• OAuth “/token” and “/authorize” for user login → token
• MCP Agent “find_slot” API requiring the token
Main components & relationships
a. Components:
– User (Browser or CLI)
– OAuth Server (Flask app)
– MCP Client (client_with_callback.py)
– CalendarAgent (MCP Server, mcp_server.py)
– (Optional) Calendar Data store or simulated data
– (Optional VC components under vc_based/)
b. Interactions:
1. User → OAuth Server: authorize agent (login → obtain access token)
2. User/Client → MCP Client: trigger “call_agent”
3. MCP Client → CalendarAgent.find_slot(token)
4. CalendarAgent → OAuth Server: fetch calendar data using token
5. CalendarAgent → MCP Client: return available time slots
c. Architectural patterns:
– Microservice separation: auth service vs. agent service
– Token-based delegation (OAuth 2.0)
– Agent API via MCP (Model Context Protocol)
– (In vc_based/) Verifiable-Credentials issuance, presentation, and verification
d. Key technologies:
– Flask for OAuth server
– FastAPI/uvicorn for MCP server (mcp_server.py uses uvicorn)
– Standard Python HTTP client libraries for MCP client
– JSON config for service discovery (servers_config.json)
– Optional VC library in vc_based folder