Skip to content

basalt / mcp-core/src / CallContext

Interface: CallContext ​

Defined in: mcp-core/src/server.ts:122

Per-call context supplied by the transport. headers is forwarded to tools; progress/elicit are optional client capabilities; notify lets the dispatcher push server→client notifications (progress) back over the transport; signal links an external abort into per-request cancellation.

Properties ​

caller? ​

> optional caller?: unknown

Defined in: mcp-core/src/server.ts:146

Opaque description of the caller as the transport resolved it (e.g. the authenticated request context), for tools' visible hooks. The core never reads it.


elicit? ​

> optional elicit?: (prompt) => Promise<boolean>

Defined in: mcp-core/src/server.ts:125

Parameters ​

prompt ​

string

Returns ​

Promise<boolean>


headers? ​

> optional headers?: Record<string, string | string[] | undefined>

Defined in: mcp-core/src/server.ts:123


notify? ​

> optional notify?: (message) => void

Defined in: mcp-core/src/server.ts:126

Parameters ​

message ​

JsonRpcRequest

Returns ​

void


progress? ​

> optional progress?: (update) => void

Defined in: mcp-core/src/server.ts:124

Parameters ​

update ​

ProgressUpdate

Returns ​

void


remoteAddress? ​

> optional remoteAddress?: string

Defined in: mcp-core/src/server.ts:140

The transport peer's address (e.g. the HTTP client ip), forwarded to tools.


session? ​

> optional session?: unknown

Defined in: mcp-core/src/server.ts:138

Identifies the client connection (session) a message belongs to — any value compared by identity (an object per connection is typical). Request ids are only unique per session, so in-flight calls are registered under (session, id) and notifications/cancelled only reaches calls of the SAME session: one client can never cancel another's request. The bundled transports always set it (one per stdio stream, one per HTTP request). Omit it only for a single-client embedding — every session-less message shares one scope.


signal? ​

> optional signal?: AbortSignal

Defined in: mcp-core/src/server.ts:127

Released under the MIT License.