Class BowireMcpEndpointRouteBuilderExtensions

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

Map-time wiring for the full Bowire MCP server (the side that exposes the workbench's own tooling: bowire.discover, bowire.invoke, bowire.mock.*, &c). Pairs with the DI registration in AddBowireMcp(IServiceCollection, Action<BowireMcpOptions>?).

public static class BowireMcpEndpointRouteBuilderExtensions
Inheritance
BowireMcpEndpointRouteBuilderExtensions
Inherited Members

Remarks

The companion McpAdapterEndpoints.MapBowireMcpAdapter (from Kuestenlogik.Bowire.Protocol.Mcp) mounts the adapter-mode endpoint. Both extensions push their mount path into the same BowireMcpEndpointRegistry singleton so they can coexist on a single host: each mount is served at a distinct route prefix, overlapping prefixes throw InvalidOperationException at startup, and the dispatcher (BowireMcpDualHandlerDispatcher) routes per-request to the right handler based on Request path.

Usage in an embedded host:

builder.Services.AddBowireMcp();
builder.Services.AddBowireMcpAdapter("http://localhost:5005");
var app = builder.Build();
app.MapBowire();
app.MapBowireMcp();              // full server at /bowire/mcp
app.MapBowireMcpAdapter();       // adapter at /bowire/mcp/adapter
// manifest at /bowire/mcp/manifest (auto-mounted by either Map* call)

Fields

ManifestPath

Canonical mount path for the workbench-discoverable manifest endpoint. Kept stable across hosts (standalone CLI, embedded) so the workbench's MCP-introspection panel can probe a single well-known URL.

public const string ManifestPath = "/bowire/mcp/manifest"

Field Value

string

Methods

MapBowireMcp(IEndpointRouteBuilder, string)

Mount the full Bowire MCP server at prefix. Defaults to /bowire/mcp; pass a different prefix when you need to co-exist with another mount at that path, but be aware that MapBowireMcpAdapter (from Kuestenlogik.Bowire.Protocol.Mcp) defaults to /bowire/mcp/adapter — overlapping the two throws at startup.

public static IEndpointRouteBuilder MapBowireMcp(this IEndpointRouteBuilder endpoints, string prefix = "/bowire/mcp")

Parameters

endpoints IEndpointRouteBuilder

The endpoint route builder.

prefix string

URL prefix the streamable-HTTP transport mounts at. Pass an empty string to mount at site root (the standalone CLI does this when adapter+server are exposed in the same process).

Returns

IEndpointRouteBuilder

MapBowireMcpManifest(IEndpointRouteBuilder)

Mount the MCP-manifest endpoint at the canonical path (ManifestPath). Idempotent: the first call wins, subsequent calls (from either MapBowireMcp(IEndpointRouteBuilder, string) or MapBowireMcpAdapter) no-op.

public static IEndpointRouteBuilder MapBowireMcpManifest(this IEndpointRouteBuilder endpoints)

Parameters

endpoints IEndpointRouteBuilder

Returns

IEndpointRouteBuilder

Remarks

The endpoint returns a JSON array of every mounted MCP route with its mode tag, e.g.

[
  { "path": "/bowire/mcp",          "mode": "server"  },
  { "path": "/bowire/mcp/adapter",  "mode": "adapter" }
]

The workbench's MCP-introspection panel polls this path to render the per-endpoint badges; an embedded host that wires up only the adapter still gets a manifest with one entry. The shape is stable so external tooling can rely on it.