Class McpAdapterEndpoints

Namespace
Kuestenlogik.Bowire.Protocol.Mcp
Assembly
Kuestenlogik.Bowire.Protocol.Mcp.dll

Maps the MCP adapter — exposes Bowire's discovered API services as MCP tools so AI agents (Claude, Copilot, Cursor) can call them. This is a development-time feature: every discovered method becomes a tool the AI agent can invoke. Opt-in only — call this explicitly to avoid accidentally exposing an internal API surface to AI clients.

public static class McpAdapterEndpoints
Inheritance
McpAdapterEndpoints
Inherited Members

Methods

MapBowireMcpAdapter(IEndpointRouteBuilder, BowireProtocolRegistry, string, string)

Maps the MCP adapter at POST {prefix}/mcp — the modern MCP streamable HTTP transport (MCP 2025-03-26 spec): a single endpoint, JSON-RPC 2.0 in, JSON out. Every method that any registered protocol can discover is wrapped as an MCP tool. Call after MapBowire() and only if you want to expose the discovered services to AI agents.

public static IEndpointRouteBuilder MapBowireMcpAdapter(this IEndpointRouteBuilder endpoints, BowireProtocolRegistry registry, string serverUrl, string basePath = "/bowire")

Parameters

endpoints IEndpointRouteBuilder
registry BowireProtocolRegistry
serverUrl string
basePath string

Returns

IEndpointRouteBuilder

Remarks

Security warning: this endpoint allows any MCP client to invoke any discovered API method. Do not enable in production unless the surface is intentional.

WithMcpAdapter(IEndpointRouteBuilder, string?, string)

Chainable opt-in: enables the MCP adapter on the same endpoint route builder used for MapBowire(). This extension only exists when the Kuestenlogik.Bowire.Protocol.Mcp package is referenced — projects that don't depend on it cannot accidentally activate the adapter.

public static IEndpointRouteBuilder WithMcpAdapter(this IEndpointRouteBuilder endpoints, string? serverUrl = null, string prefix = "bowire")

Parameters

endpoints IEndpointRouteBuilder
serverUrl string
prefix string

Returns

IEndpointRouteBuilder

Examples

app.MapBowire(opts => opts.Title = "My API")
   .WithMcpAdapter("http://localhost:5005");