RepositoryMcpOptions Class
Assembly: CodeEffects.Rule.Mcp.dll
Namespace: CodeEffects.Rule.Mcp
Summary
Holds the settings of the Rule Repository's part of the MCP server: its database and an optional step that completes the repository configuration for each request.
Syntax
public sealed class RepositoryMcpOptions
You never create this class. WithRepository(..) creates it and passes it to your configure delegate. You set DbProvider and, if the repository endpoint of your application sets more on its configuration, Configure.
Properties
DbProvider
Type: CodeEffects.Rule.Connection.IDbProvider
Gets or sets the database provider of the Rule Repository. Use the same database as your repository endpoint does. The default is null, and WithRepository(..) throws when it is not set.
-
Type: System.Action<CodeEffects.Rule.Mcp.McpCaller, CodeEffects.Rule.Repository.Configuration>
Gets or sets a delegate that completes the repository Configuration of each request. The default is null: the configuration holds only what the caller supplies.
The server first sets the caller's user, agent and permissions on the configuration, then calls the delegate with the caller and the configuration. Use it for what your repository endpoint also sets, such as UiXml, TypeResolver, Notify and Agents, the settings that govern what AI agents may do. Do not change the user or the permissions in it: after the delegate returns, the server sets the user, the agent, AccessMode and ActionList from the caller again, so a helper shared with your browser endpoint cannot widen what an agent is allowed to do.
Example
using CodeEffects.Rule.Mcp;
using CodeEffects.Rule.Repository;
builder.Services
.AddCodeEffectsMcp(o => o.MapCaller = mapCaller)
.WithRepository(r =>
{
r.DbProvider = dbProvider;
r.Configure = (caller, config) =>
{
config.Agents = new AgentSettings();
};
});