Relatude.DB.MCP 1.1.12.46-alpha

This is a prerelease version of Relatude.DB.MCP.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Relatude.DB.MCP --version 1.1.12.46-alpha
                    
NuGet\Install-Package Relatude.DB.MCP -Version 1.1.12.46-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.12.46-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.12.46-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.12.46-alpha
                    
#r "nuget: Relatude.DB.MCP, 1.1.12.46-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.12.46-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.12.46-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Relatude.DB.MCP&version=1.1.12.46-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
script run scripts (Relatude.DB.Scripting), which call the other tools many times in one call, held to what the key may do
services have its scripts spend credits and send messages: AI, translation, SMS, e-mail, imaging, file-to-text, the web. Over MCP no one is asked first, so this area is the consent

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, whether search goes by meaning, the services it can use and why not, how many more operations cms_find reaches, the site's notes, the guides
site_remember Adds a line to the site's notes every agent reads (house style, words, who approves what), or takes lines away; an administrator's
guide A guide as Markdown: workflow, recipes (the shortest way through common jobs, such as a campaign page), content, queries, datamodel, templates
datamodel_list, datamodel_describe, datamodel_status The node types, one type with its own properties (inherited ones by name, whole with inherited), and whether the model can be changed here
datamodel_change Makes and changes runtime types and their properties; validateOnly checks and compiles without applying, discardDraft deletes a draft saved in the admin UI, which would otherwise stop it
content_query, content_get Finds nodes by type, condition, search (ranked, by meaning too where the site can, semanticRatio) or id; reads nodes whole, drafts included, and with fileText the text kept of their files (a transcript, a document's text), a part at a time
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, its name one or two words ("Spring campaign"); 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_fromUrl 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_fromUrl makes one from a website's address (it holds at once); site_overview lists them, and the guide design says how templates use them
design_screenshot A page as visitors will see it, drafts and the project included, as an image with the answer: by Relatude's snapshot service for a site on a public address, by the computer's own Edge or Chrome for a site on this computer (the top of the page, one part of 1,280 by up to 1,400 pixels, up to three with parts)
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
script_run, script_status, script_stop, script_list, script_api With the module script (Relatude.DB.Scripting): runs a JavaScript program on the server that calls these tools in a loop and answers a summary; waits for, stops and lists scripts; TypeScript definitions of what a script has
cms_find, cms_describe, cms_call What the site can do beyond these tools, found by what it does, read and called: importing a video from YouTube or Vimeo (library.importVideo), transcribing a recording (files.transcribe), translating a version (content.translate), a node's versions and history (content.versions, content.history, content.restoreVersion), the site's change history (site.changes), the languages (languages.*), the analytics (analytics.read), maintenance (maintenance.run), who may do what (users.*), restoring from the wastebin (wastebin.restore), copying pages (tree.copy), the file library's folders and files (library.*), a file's title and description (files.setMeta), sending e-mail and SMS, translating, the AI, describing a picture, reading a file's text, looking up an address, the logs, following long work (process.status, process.cancel)

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.
  • One list of tools. Everything else is reached through cms_call, so the list stays the same and short. A call through it is what the operation's own would be: the key's areas and MaxEffect hold, and an operation that uses a service needs the area services.
  • Long work is waited for. An operation that starts long work answers after 25 seconds with the process if it is still running, which process.status { id, wait } (through cms_call) follows and process.cancel stops.
  • 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, or "events.upcoming"
            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 tool named as one of the module's commands with its first underscore a dot (events_upcoming beside events.upcoming) is that command's operation too: one operation of the command's name, the command's handler for the interface and the tool's for agents and scripts, which a model calls events_upcoming and a script events.upcoming(…). 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. Core = false leaves it off the list, found with cms_find and called with cms_call; LongWork = true with ctx.StartProcess(start, work) answers a process the caller waits for; Capability names the service it uses, asked for with ctx.Use(name), and a module registers a service of its own with module.Capability(new AgentCapability { Name, Said, Missing, On }), On being its own on/off setting. 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 OperationCallEffect(OperationEffect.Live, "Cancels an event, which its page says at once.")),
    Handler = async ctx => {
        ctx.RequireEffect(OperationEffect.Live, "cancel an event");
        return await ctx.Command("events.cancel", new { id = ctx.Args<Args>().Id });
    },
})
  • How far a call reaches is an OperationEffect (Relatude.DB.NodeServer.Operations, with OperationCallEffect): a tool is registered as an operation of the server's registry, which carries it. 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 OperationCallEffect: 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 = OperationEffect.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.

  • Asking whatever the effect. An OperationCallEffect with Confirm is asked about before the call even when it only reads or writes drafts: it spends credits or sends messages.

  • What a call spends. ctx.Spend(credits) tells the caller of credits a call spent on a service (AgentCaller.Spent), which the agent of the interface adds to the conversation's and counts against a message's credits.

  • A longer answer. AgentCaller.MaxResultChars is the most a tool may answer that caller, where it is not AgentTools.MaxResultChars: a script reads far more than a model is given.

  • A caller in a conversation. AgentCaller.Conversation is the conversation a call is part of, where the agent talks with a person: for a tool that records what it did, as the log of script runs does.

  • More areas for the interface's agent. An IAgentAreaPolicy service answers the areas a user who is no administrator gets besides every user's, so a module decides who has its area.

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.2.13.51-alpha 10 12/1/2026
1.1.12.47-alpha 68 11/30/2026
1.1.12.46-alpha 59 11/29/2026
1.1.12.44-alpha 110 11/26/2026
1.1.11.42-alpha 59 11/24/2026
1.1.11.35-alpha 57 11/22/2026
1.1.10.34-alpha 59 11/22/2026
1.1.10.32-alpha 61 11/22/2026
1.1.9.30-alpha 61 11/20/2026
1.1.8.29-alpha 66 11/18/2026