Skip to content

Commit f981dea

Browse files
betegoncodex
andcommitted
fix(core): recognize per-request MCP HTTP transport
Co-Authored-By: GPT-6 (Codex) <codex@openai.com>
1 parent 3bd8773 commit f981dea

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎packages/core/src/integrations/mcp-server/sessionExtraction.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ export function getTransportTypes(transport: MCPTransport): {
258258
'StreamableHTTPServerTransport',
259259
'NodeStreamableHTTPServerTransport',
260260
'WebStandardStreamableHTTPServerTransport',
261+
'PerRequestHTTPServerTransport',
261262
'SSEServerTransport',
262263
].includes(transportName);
263264

‎packages/core/test/lib/integrations/mcp-server/networkAttributes.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@ import { buildTransportAttributes } from '../../../../src/integrations/mcp-serve
33
import { createMockStdioTransport, createMockTransport } from './testUtils';
44

55
describe('MCP network attributes', () => {
6+
it('identifies per-request HTTP without request metadata', () => {
7+
const transport = createMockTransport();
8+
Object.defineProperty(transport, 'constructor', { value: { name: 'PerRequestHTTPServerTransport' } });
9+
10+
expect(buildTransportAttributes(transport)).toEqual({
11+
'mcp.transport': 'PerRequestHTTPServerTransport',
12+
'mcp.session.id': 'test-session-123',
13+
'network.protocol.name': 'http',
14+
});
15+
});
16+
617
it('does not report JSON-RPC as a network protocol for stdio', () => {
718
const attributes = buildTransportAttributes(createMockStdioTransport());
819

0 commit comments

Comments
 (0)