Relatude.DB.MCP 1.1.11.42-alpha

This is a prerelease version of Relatude.DB.MCP.
dotnet add package Relatude.DB.MCP --version 1.1.11.42-alpha
                    
NuGet\Install-Package Relatude.DB.MCP -Version 1.1.11.42-alpha
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Relatude.DB.MCP" Version="1.1.11.42-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Relatude.DB.MCP" Version="1.1.11.42-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Relatude.DB.MCP" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Relatude.DB.MCP --version 1.1.11.42-alpha
                    
#r "nuget: Relatude.DB.MCP, 1.1.11.42-alpha"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Relatude.DB.MCP@1.1.11.42-alpha
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Relatude.DB.MCP&version=1.1.11.42-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Relatude.DB.MCP&version=1.1.11.42-alpha&prerelease
                    
Install as a Cake Tool

Relatude.DB.MCP

An MCP server for a site on Relatude.CMS. An AI agent such as Claude connects to the site and works on it while it runs: it reads and extends the datamodel, makes and changes content, and writes the templates and stylesheets that render it. Nothing is rebuilt.

Setup

builder.AddRelatudeCMS()
    .AddApi()                        // the CMS API, which the tools run on
    .AddModule<ScribanModule>()      // a template engine, for the template tools (Relatude.DB.Scriban)
    .AddModule<McpModule>();

app.UseRelatudeCMS();
app.MapRelatudeCmsApi();
app.MapRelatudeCMS();                // maps the MCP endpoint with the modules' other routes

The endpoint is {api}/mcp, so /relatude.cms/api/mcp: Streamable HTTP, stateless (protocol revision 2026-07-28, and the earlier ones clients still speak). Connect Claude Code with:

claude mcp add --transport http mysite https://example.com/relatude.cms/api/mcp --header "Authorization: Bearer rk_…"

On your own machine, give Claude Code the site's http:// address (http://localhost:5000/relatude.cms/api/mcp). Claude Code does not trust a development certificate: with an https://localhost address it reports Failed to connect (unable to verify the first certificate in its log), though a browser opens the same address. claude mcp list shows whether each server connects.

McpOptions.Path moves the endpoint. It is built on the official C# SDK (ModelContextProtocol.AspNetCore), whose one MCP server per application this module configures.

Who an agent is

An agent signs in with a key and acts as the user the key is for. It has that user's rights and no more: what the user may not read is not there for it, and what the user may not change is refused by the database, as for anyone. A key also names the areas the agent may work in besides reading:

Area Lets the agent
(every key) read the datamodel, content and templates
content make and change content, as drafts; put content in the wastebin
publish publish and unpublish
templates save and delete templates and design files, and say which renders a page type
datamodel make and change runtime node types

An administrator makes keys in the CMS interface, under Settings › AI agents, where a new key is shown once; only its SHA-256 is kept, in the database's MCP settings (McpSettings, saved for this server). Taking a key away stops its agent at once. The mcp.* commands of the CMS API do the same: mcp.status, mcp.keys, mcp.key-create { name, userId?, areas, days? } (answers the key, this once) and mcp.key-revoke { id }.

On this machine no key is needed. A request from localhost, sent to a localhost address, acts as the database's administrator, exactly where the database's admin UI lets this machine in without a login (NoLoginRequiredForLocalhost). McpOptions.AllowLocalhost = false always asks for a key. A request that carries an Origin other than the site's own is refused, so a page in a browser cannot post to the endpoint.

The tools

Tool What it does
site_overview Who the agent acts as, what its key allows, the sites, languages and modules, the guides
guide A guide as Markdown: workflow, content, queries, datamodel, templates
datamodel_list, datamodel_describe, datamodel_status The node types, one type whole, and whether the model can be changed here
datamodel_change Makes and changes runtime types and their properties; validateOnly checks and compiles without applying
content_query, content_get Finds nodes by type, condition, search or id; reads nodes whole, drafts included
content_tree, content_url The page tree; the page at an address and the address of a page
content_write Creates, updates, moves, links and deletes, as drafts; deletes go to the wastebin
content_set_file Puts a file in a file property: text (an SVG), base64, a copy of another node's, or a file a person attached where the agent talks with one
content_publish Publishes drafts, unpublishes
projects_list, projects_get, projects_create, projects_publish, projects_discard Projects: a piece of work as drafts, previewed and published as one; every content and template tool takes project, reading the project's drafts and writing into them; a node read says which project holds it, and a change to it outside that project is refused; site_overview lists the projects open
design_profiles, design_profile, design_profile_from_url Design profiles: how the site should look and sound (brief, CSS tokens, logos, files, reference websites); design_profile gives one whole, by key or a site's own, with its files' addresses; design_profile_from_url makes one from a website's address (it holds at once); site_overview lists them, and the guide design says how templates use them
templates_list, templates_read, templates_check The design library's files by path and what renders which page type
templates_preview Renders a node with its template, or with a text not saved yet; drafts render
templates_save, templates_delete, templates_bind Writes templates and design files; says which template renders a page type

What the tools do for an agent that the commands under them do not:

  • Drafts. New content is a draft, and a change to a published node goes into its draft. Visitors see nothing until content_publish, or publish: true with a key that may.
  • Languages and sites. A page made below or beside another goes in that page's site and language, as the CMS interface puts it; other content goes in the site's own language (the first its site names). The database's own types and file library files are in none, and so is everything on a database without languages. language says another.
  • The wastebin. A delete puts the node in the wastebin unless permanent is said.
  • A model change is checked first. datamodel_change validates with the database's model editor, compiling the model, before anything is written. Warnings the change itself brings (it would lose data, say) must be accepted. Only runtime types are changed; what is compiled into the site is refused.
  • A template with errors is not saved, as it would fail every page rendering with it.
  • Short answers. Lists cut long texts and come a page at a time, and an answer over 80 000 characters is refused with what to ask for instead (AgentTools.MaxResultChars). An answer escapes only what JSON needs (AgentJson.Options): a quote is \" and a letter outside ASCII is itself, never six characters of \u0022, as a model pays for every character it reads.

A model change reopens the database, which takes some seconds during which pages answer "not found". The tool takes a whole change set in one call for that reason.

Tools of your own

The tools are not the MCP module's. They are the CMS's agent tools (Relatude.DB.CMS.Agents), which this module lists and calls; an agent inside the CMS interface would call the same ones. A module adds its own:

public sealed class EventsModule : CmsModule {
    public override string Name => "events";
    public override void Configure(CmsModuleBuilder module) => module
        .Command("events.upcoming", EventCommands.Upcoming, readOnly: true)
        .AgentTool(new AgentTool {
            Name = "events_upcoming",              // the module's name first
            Area = AgentAreas.Read,
            ReadOnly = true,
            Description = "The events that have not started yet, the soonest first.",
            InputSchema = AgentTool.Schema("""{ "type": "object", "properties": { "take": { "type": "integer" } } }"""),
            Handler = async ctx => await ctx.Command("events.upcoming", new { take = ctx.Args<Args>().Take }),
        })
        .AgentGuide("events", "Events and venues", _ => Task.FromResult("…Markdown…"));
}

A handler runs CMS API commands as the agent's user (ctx.Command), so the user's rights apply; ctx.Require(area, what) refuses a caller without an area; a CmsApiException is a refusal the agent is told, and can put right. A tool is left out while its module is not active. Code with no request calls a command the same way: CmsApiCommands.InvokeAsync(type, payload, userId).

What a call would do

A tool that changes something says how far a call reaches, without doing any of it, and says it again where it makes the change:

.AgentTool(new AgentTool {
    Name = "events_cancel",
    Area = AgentAreas.Content,
    Description = "Cancels an event: its page says so at once.",
    InputSchema = AgentTool.Schema("""{ "type": "object", "properties": { "id": { "type": "string" } }, "required": ["id"] }"""),
    Effect = ctx => Task.FromResult(new AgentCallEffect(AgentEffect.Live, "Cancels an event, which its page says at once.")),
    Handler = async ctx => {
        ctx.RequireEffect(AgentEffect.Live, "cancel an event");
        return await ctx.Command("events.cancel", new { id = ctx.Args<Args>().Id });
    },
})
  • How far a call reaches is an AgentEffect. Read changes nothing. Draft writes drafts, which visitors do not see. Live holds at once or takes something away: publishing, deleting, moving and linking content, a template or page template outside a project, the datamodel, content of a type that has no drafts.
  • One tool, several effects. Effect gets the call's arguments, as one tool can write a draft with some and publish with others: content_write is a draft until an action deletes, moves or links, or publish is true. A tool marked ReadOnly reads. A tool that changes things and gives no Effect is taken to be Live whatever it is given.
  • Asking first. AgentTools.ClassifyAsync(name, arguments, caller) answers an AgentCallEffect: the effect, a sentence for a person asked to allow it, and Credits where the call spends any. Whatever carries an agent's calls uses it to ask before a call that is no draft.
  • A caller held to drafts. new AgentCaller(userId) { MaxEffect = AgentEffect.Draft } writes drafts and nothing else. A call that would do more is refused before any of it is done, so a call of several actions never stops halfway. ctx.RequireEffect holds a tool that does more than it said. site_overview tells the agent (heldTo); where each call is held tighter than the agent is, AgentCaller.HeldTo is what it is told.
  • A caller with files. new AgentCaller(userId) { Attachments = id => … } answers the files a person gave the agent, each an AgentAttachment(name, contentType, bytes), by the ids the agent was told. A tool takes one with ctx.Caller.Attachments?.Invoke(id), as content_set_file does for its attachment. Over MCP there are none.
  • A caller in one project. new AgentCaller(userId) { Project = id } has every call read and write in that project, whatever project a call names. In a tool, ctx.Project is the project worked in and ctx.ProjectArgument the one the arguments name.

An agent over MCP is held by its key's areas and its user's rights, not by an effect: its MaxEffect is Live.

Notes

  • Turn the module off in the CMS settings (Modules: mcp) and the endpoint is gone; datamodel and templates turn those tools off.
  • The agent's writes are stamped with the key's user, so the history says who changed what. Give an agent a user of its own.
  • Runtime types saved on a server are kept in its data folder (relatude.data), not in source control; templates are text files of the database's design library, in the file library.
Product Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.11.42-alpha 0 11/24/2026
1.1.11.35-alpha 42 11/22/2026
1.1.10.34-alpha 45 11/22/2026
1.1.10.32-alpha 47 11/22/2026
1.1.9.30-alpha 48 11/20/2026
1.1.8.29-alpha 51 11/18/2026