Class BowireMcpServiceCollectionExtensions

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

DI registration for BowireMcpTools. Registers the Bowire protocol registry as a singleton and pulls the ModelContextProtocol server fluent API in. Choose the transport in your Program.cs after calling this — stdio for the CLI, HTTP/SSE for the embedded host:

// stdio (CLI)
services.AddBowireMcp(o => o.AllowArbitraryUrls = false)
        .WithStdioServerTransport()
        .WithTools<BowireMcpTools>()
        .WithResources<BowireMcpResources>()
        .WithPrompts<BowireMcpPrompts>();

// HTTP/SSE (embedded)
services.AddBowireMcp()
        .WithHttpTransport(o => o.Stateless = true)
        .WithTools<BowireMcpTools>()
        .WithResources<BowireMcpResources>()
        .WithPrompts<BowireMcpPrompts>();
// …then `app.MapBowireMcp();` (defaults to /bowire/mcp)
public static class BowireMcpServiceCollectionExtensions
Inheritance
BowireMcpServiceCollectionExtensions
Inherited Members

Methods

AddBowireMcp(IServiceCollection, Action<BowireMcpOptions>?)

Register Bowire-MCP services and return the SDK's Microsoft.Extensions.DependencyInjection.IMcpServerBuilder so the caller can chain a transport (WithStdioServerTransport or WithHttpTransport) and tool registration.

public static IMcpServerBuilder AddBowireMcp(this IServiceCollection services, Action<BowireMcpOptions>? configure = null)

Parameters

services IServiceCollection
configure Action<BowireMcpOptions>

Returns

IMcpServerBuilder

AddBowireMcpForwarder(IServiceCollection, Uri, string?)

Register a forwarder-mode MCP server (#286). Every incoming MCP request is relayed to parentEndpoint via an outbound BowireForwardingMcpTransport; no Bowire tools / resources / prompts are bound locally — the parent's surface is what the LLM caller sees.

public static IMcpServerBuilder AddBowireMcpForwarder(this IServiceCollection services, Uri parentEndpoint, string? bearerToken = null)

Parameters

services IServiceCollection

The application's service collection.

parentEndpoint Uri

HTTP(S) URI of the parent Bowire MCP endpoint (e.g. http://localhost:5198/bowire/mcp).

bearerToken string

Optional bearer token; attached as Authorization: Bearer … on every request to the parent. Required when the parent has --token set.

Returns

IMcpServerBuilder