APIs & exposure
Expose your agentic systems through a variety of endpoint types including REST, gRPC, MCP, and WebSocket interfaces. This pattern covers how to define typed APIs, add JWT-based authentication, generate OpenAPI specifications, and expose agents as MCP-compatible tool servers for integration with external AI systems.
Overview
When to Use This Pattern
-
You need to expose agents or services via REST APIs with OpenAPI documentation
-
Your application requires gRPC endpoints for high-performance service-to-service communication
-
You want to expose agents as MCP tool servers for integration with AI assistants and IDEs
-
You need JWT-based authentication and authorization on your endpoints
Sample Projects
The following sample projects demonstrate this pattern:
-
endpoint-jwt — HTTP endpoint with JWT-based authentication
-
trip-booking-with-tools — agent exposed via multiple endpoint types with tool integration