Skip to content

McpOptions

Defined in: types.ts:115

optional codeMode?: McpCodeModeProvider

Defined in: types.ts:151

Code-mode provider, e.g. codeMode() from @mantlejs/mcp-code.


optional events?: boolean

Defined in: types.ts:136

Expose service events (created/updated/patched/removed + custom) as MCP resources (mantle://events/{path}) — for services in the expose map only.

false

optional mode?: McpMode

Defined in: types.ts:149

Tool surface. "code"/"both" require codeMode (BadRequest otherwise).

“code” when codeMode is set, "tools" otherwise


optional path?: string

Defined in: types.ts:129

HTTP transport only: mount path.

"/mcp"

optional prompts?: McpPromptDefinition[]

Defined in: types.ts:142

App-authored prompt templates. The prompts capability is only declared when non-empty.


optional query?: McpQueryOptions

Defined in: types.ts:144

find() result guardrails.

{ defaultLimit: 25, maxLimit: 100 }

optional resources?: McpResourceDefinition[]

Defined in: types.ts:140

App-authored read-only resources served alongside the event resources.


optional serverInfo?: object

Defined in: types.ts:131

Server identity reported during MCP initialization. Defaults: name "mantle", version "0.0.0".

optional name?: string

optional version?: string


services: CapabilityScope | "*"

Defined in: types.ts:125

Expose map — required, deny-by-default. Maps a registered service path to the methods exposed as tools: an explicit method list, or true for every method the service registered in app.use(). "*" exposes all methods of all services registered after mcp() — a deliberate escape hatch for prototyping. An unknown path or method throws BadRequest when the server is built (at listen()/startMcp()). Same CapabilityScope shape @mantlejs/auth’s authorizeAgent() uses for agent-token scopes — one deny-by-default grant shape shared across the framework rather than two independently-typed lookalikes.


optional tools?: McpToolDefinition[]

Defined in: types.ts:138

App-authored tools registered alongside the generated ones.


transport: "stdio" | "http"

Defined in: types.ts:127

"stdio" runs a standalone MCP server via startMcp(app); "http" mounts the endpoint on the app’s HTTP transport.