Open Model Context Protocol (MCP) Specification & Client Guide
This document defines the open endpoints, protocol specifications, and client connection setups for integrating with glow-prow-ai-mcp.
1. Protocol Endpoints Overview
The service fully conforms to the Model Context Protocol (MCP) standard and OAuth 2.1 (RFC 9728 & RFC 8414).
| Endpoint | Method | Protocol Standard | Description |
|---|---|---|---|
/mcp | POST/GET | Streamable HTTP / SSE | Default MCP connection endpoint (English). |
/mcp/zh-CN (or /mcp/zh) | POST/GET | Streamable HTTP / SSE | Optimized Chinese MCP connection endpoint. |
/.well-known/oauth-protected-resource | GET | RFC 9728 | Protected Resource Metadata discovery. |
/.well-known/oauth-authorization-server | GET | RFC 8414 | Authorization Server Metadata discovery. |
/api/mcp/authorize | GET | OAuth 2.1 | Authorization endpoint (redirects 302 to user consent page). |
/api/mcp/register | POST | RFC 7591 | Dynamic Client Registration (proxied to authorization server). |
/api/mcp/token | POST | RFC 6749 | Token exchange & refresh (proxied to authorization server). |
/health | GET | HTTP Status | Service health probe (database status, uptime, version). |
2. OAuth 2.1 Discovery & Authentication Flow
When an MCP client connects without credentials:
[MCP Client] [glow-prow-ai-mcp] [glow-prow-backend]
│ │ │
├─── 1. POST /mcp (unauthenticated) ──>│ │
│<── 2. 401 + WWW-Authenticate ────────┤ │
│ (resource_metadata link) │ │
│ │ │
├─── 3. GET /.well-known/oauth-protected-resource ─────────> │
│<── 4. 200 JSON (resource URI & auth_server base) ──────── │
│ │
├─── 5. GET /.well-known/oauth-authorization-server ──────────────────────>│
│<── 6. 200 JSON (authorize, token & register endpoints) ──────────────────┤
│ │
├─── 7. Browser: Open /api/mcp/authorize?client_id=... ───>│ │
│<── 8. HTTP 302 Redirect ─────────────────────────────────┴──────────────>│
│ │
│<── 9. Render Consent Page (/apps/ai-connector/consent) ──────────────────┤
│─── 10. User Approves ───────────────────────────────────────────────────>│
│<── 11. 302 Redirect to client redirect_uri with auth code ───────────────┤
│ │
├─── 12. POST /api/mcp/token (Exchange code for token) ───────────────────>│
│<── 13. Access Token (aud: glow-prow-mcp) ────────────────────────────────┤
│ │ │
├─── 14. POST /mcp (Bearer Token) ────>│ │
│<── 15. Streamable Tool Responses ────┤ │
3. Response Format & Error Handling
Unauthenticated requests receive HTTP 401 with WWW-Authenticate:
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer realm="glow-prow", error="invalid_token", resource_metadata="https://mcp.glow-prow.top/.well-known/oauth-protected-resource"
Content-Type: application/json
{
"error": "unauthorized",
"message": "Authentication required. Please connect via OAuth 2.1."
}
Tool call results follow the standard JSON-RPC 2.0 CallToolResult schema.