AgentPrismMcpServerBuilderExtensions
AgentPrism.AspNetCore.dllExtensions that register the services needed to publish AgentPrism agents as MCP tools.
public static class AgentPrismMcpServerBuilderExtensionsInheritance
Section titled “Inheritance”object ← AgentPrismMcpServerBuilderExtensions
Inherited Members
Section titled “Inherited Members”object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Methods
Section titled “Methods”UseMcpServer(IAgentPrismBuilder, Action<AgentPrismMcpServerOptions>?)
Section titled “ UseMcpServer(IAgentPrismBuilder, Action<AgentPrismMcpServerOptions>?)”Registers the MCP server services. The HTTP endpoint must still be
connected separately with app.MapAgentPrismMcpServer(...).
public static IAgentPrismBuilder UseMcpServer(this IAgentPrismBuilder builder, Action<AgentPrismMcpServerOptions>? configure = null)Parameters
Section titled “Parameters”builder IAgentPrismBuilder
The AgentPrism configuration chain.
configure Action<AgentPrismMcpServerOptions>?
Options mutator.
Returns
Section titled “Returns”The chain, for further configuration.
Remarks
Section titled “Remarks”Registration happens HERE, not in MapAgentPrismMcpServer: the MCP
SDK’s AddMcpServer call operates on IServiceCollection
and must happen BEFORE the application is Build-ed. The
Map... extensions only connect already-built services to HTTP.
By default no agent is exposed. Exposing one requires an explicit choice via AgentPrismMcpServerOptions.ExposedAgents or AgentPrismMcpServerOptions.ExposeAllAgents.
builder.AddAgentPrism() .UseOpenAI(apiKey) .UsePostgreSql(connectionString) .UseMcpServer(o => o.ExposedAgents.Add("asistan"));// ...app.MapAgentPrism("/agentprism");app.MapAgentPrismMcpServer();Exceptions
Section titled “Exceptions”builder is null.