Relatude.DB.MCP
1.1.12.44-alpha
dotnet add package Relatude.DB.MCP --version 1.1.12.44-alpha
NuGet\Install-Package Relatude.DB.MCP -Version 1.1.12.44-alpha
<PackageReference Include="Relatude.DB.MCP" Version="1.1.12.44-alpha" />
<PackageVersion Include="Relatude.DB.MCP" Version="1.1.12.44-alpha" />
<PackageReference Include="Relatude.DB.MCP" />
paket add Relatude.DB.MCP --version 1.1.12.44-alpha
#r "nuget: Relatude.DB.MCP, 1.1.12.44-alpha"
#:package Relatude.DB.MCP@1.1.12.44-alpha
#addin nuget:?package=Relatude.DB.MCP&version=1.1.12.44-alpha&prerelease
#tool nuget:?package=Relatude.DB.MCP&version=1.1.12.44-alpha&prerelease
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, 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 |
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 |
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, orpublish: truewith 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.
languagesays another. - The wastebin. A delete puts the node in the wastebin unless
permanentis said. - A model change is checked first.
datamodel_changevalidates 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.Readchanges nothing.Draftwrites drafts, which visitors do not see.Liveholds 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.
Effectgets the call's arguments, as one tool can write a draft with some and publish with others:content_writeis a draft until an action deletes, moves or links, orpublishis true. A tool markedReadOnlyreads. A tool that changes things and gives noEffectis taken to beLivewhatever it is given.Asking first.
AgentTools.ClassifyAsync(name, arguments, caller)answers anAgentCallEffect: the effect, a sentence for a person asked to allow it, andCreditswhere 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.RequireEffectholds a tool that does more than it said.site_overviewtells the agent (heldTo); where each call is held tighter than the agent is,AgentCaller.HeldTois what it is told.A caller with files.
new AgentCaller(userId) { Attachments = id => … }answers the files a person gave the agent, each anAgentAttachment(name, contentType, bytes), by the ids the agent was told. A tool takes one withctx.Caller.Attachments?.Invoke(id), ascontent_set_filedoes for itsattachment. 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.Projectis the project worked in andctx.ProjectArgumentthe one the arguments name.Asking whatever the effect. An
AgentCallEffectwithConfirmis 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.MaxResultCharsis the most a tool may answer that caller, where it is notAgentTools.MaxResultChars: a script reads far more than a model is given.A caller in a conversation.
AgentCaller.Conversationis 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
IAgentAreaPolicyservice 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;datamodelandtemplatesturn 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 | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- ModelContextProtocol.AspNetCore (>= 2.4.0)
- Relatude.DB.CMS (>= 1.1.12.44-alpha)
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.12.44-alpha | 0 | 11/26/2026 |
| 1.1.11.42-alpha | 43 | 11/24/2026 |
| 1.1.11.35-alpha | 53 | 11/22/2026 |
| 1.1.10.34-alpha | 54 | 11/22/2026 |
| 1.1.10.32-alpha | 56 | 11/22/2026 |
| 1.1.9.30-alpha | 58 | 11/20/2026 |
| 1.1.8.29-alpha | 61 | 11/18/2026 |