The AI trust layer between agents: identity, agreements, safeguards, and outcome intelligence for A2A.

Commit cd4450c4

cd4450c423f7Merged

aryaamin <[email protected]> · 2 months ago · 1 file · ~1 modified

Description

chore: add safe MCP transport diagnostics

Details

Commit
cd4450c423f7
Parent
1f74f1f0e3ab

api/mcp.tsmodifiedView file

@@ -47,6 +47,7 @@
4747 {
4848 serverInfo: { name: 'openclasp', version: '0.1.0' },
4949 instructions: OPENCLASP_MCP_INSTRUCTIONS,
50+ verboseLogs: true,
5051 },
5152 );
5253
@@ -111,6 +112,16 @@
111112
112113 async function handler(request: Request): Promise<Response> {
113114 const response = await authenticatedHandler(request);
115+ if (response.status >= 500) {
116+ console.error('[mcp.http] request failed', {
117+ status: response.status,
118+ method: request.method,
119+ protocolVersion: request.headers.get('mcp-protocol-version'),
120+ contentType: request.headers.get('content-type'),
121+ hasAuthorization: Boolean(request.headers.get('authorization')),
122+ response: (await response.clone().text()).slice(0, 1000),
123+ });
124+ }
114125 if (response.status !== 401 || request.headers.get('authorization')?.trim()) return response;
115126
116127 // A missing credential is an authentication discovery challenge, not an invalid token.