Add tools to the Dynamicweb MCP project. Triggers: new MCP operation/domain, tool classes, services, models, route handlers. Existing API internals -> dw-source-explorer.
Ships in dynamicweb-developer. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
| Topic | Where |
|---|---|
The Backend MCP server (Truvio Commerce MCP, package Truvio.Commerce.MCP, formerly Dynamicweb.MCP, at /admin/mcp) — installing the AddIn (AppStore first; a csproj PackageReference only on an explicit user choice, never a remembered package id), the auth model (API Key vs Claude.ai OAuth), the two AccessUserToken rows, headless token+config provisioning in code, the silent no-op catalogue for MCP/Management API writes, and the identifier-parameter convention (id vs pageId/paragraphId) | references/backend-mcp-server.md |
| Where an existing tool's model is narrower than the domain service behind it — write-only fields with no read-back, read-only fields a save cannot reach, entities with no verb at all, a delete that leaves relation rows dangling, and version-pinned broken tools. Read it before adding a tool to a domain that already has one | references/tool-surface-gaps.md |
Guide the creation of new MCP tools in this project, following the established patterns and conventions. Ensures correct attribute usage, permission levels, model design, and Dynamicweb API integration.
dw-source-explorer skill to find the right APIs (the platform source is not public; the skill reads the NuGet package metadata).Clarify:
Read, Write, Create, Delete)Before writing any code, identify the Dynamicweb APIs that will back the tool:
*/Services/ for patterns already usedDynamicweb.Ecommerce.Services.* static facades when availableServiceLocator.Current.GetInstance<T>() for dependency-injected servicesLocation: {Domain}/Models/
Conventions:
{Entity}Model -- read/response model (returned from tools){Entity}CreateModel -- input for creation tools{Entity}UpdateModel -- input for full-update tools{Entity}PatchModel / {Entity}PatchRequest -- input for partial-update tools (use Maybe<T> or *WasProvided pattern for true partial semantics){Entity}DeleteRequest -- input for delete tools when more than a simple ID is needed[Description("...")] on the class and on each property -- this is what MCP clients show to usersFromDomain(DynamicwebEntity) static factory methods to convert from Dynamicweb entities to modelsApplyToDomain(DynamicwebEntity) instance methods to apply model values to Dynamicweb entitiesExample:
using System.ComponentModel;
namespace Truvio.Commerce.MCP.Products.Models;
[Description("Represents a widget configuration.")]
public sealed class WidgetModel
{
[Description("Unique identifier.")]
public string Id { get; set; } = "";
[Description("Display name.")]
public string Name { get; set; } = "";
public static WidgetModel FromDomain(SomeDynamicwebType entity) => new()
{
Id = entity.Id,
Name = entity.Name
};
}
Location: {Domain}/Services/
Conventions:
internal sealed class (not static)BulkResponse<T> / PagedResponse<T>Dynamicweb.Ecommerce.Services.* static facades for product/commerce operationsServiceLocator.Current.GetInstance<T>() for indexed/queryable servicesBulkResponse:internal sealed class MyService
{
public BulkResponse<MyModel> CreateItems(List<MyCreateModel> items)
{
int success = 0, failed = 0;
List<string> errors = [];
List<MyModel> results = [];
foreach (var item in items ?? [])
{
try
{
// Call Dynamicweb API
var entity = new SomeDynamicwebType();
item.ApplyToDomain(entity);
SomeDynamicwebService.Save(entity);
results.Add(MyModel.FromDomain(entity));
success++;
}
catch (Exception ex)
{
failed++;
errors.Add(ex.Message);
}
}
return new BulkResponse<MyModel> { Succeeded = success, Failed = failed, Items = results, Errors = errors };
}
}
Location: {Domain}/Tools/
Required attributes on the class:
[McpServerToolType]Required attributes on each method:
[McpServerTool] or [McpServerTool(Title = "Human Readable Name")][McpToolPermission(McpToolPermissionLevel.Read|Write|Create|Delete)][Description("Clear description of what the tool does and what it returns.")]Optional attributes:
[McpServerTool(UseStructuredContent = true)] -- for tools returning complex objects (recommended for lists/bulk responses)Conventions:
public static class with [McpServerToolType]private static readonly fieldsGetProducts -> get_productsProductTools -> "Product"[Description("...")] on parameters tooMcpServer server and RequestContext<CallToolRequestParams> context as parametersPermission level guide:
| Operation | Level | Naming convention |
|---|---|---|
| Read/list/get/search | Read | Get*, List*, Search* |
| Update/patch/assign | Write | Update*, Patch*, Assign* |
| Create/save | Create | Create*, Save* |
| Delete/remove | Delete | Delete*, Remove* |
Example:
using Truvio.Commerce.MCP.Configuration;
using Truvio.Commerce.MCP.Core.Responses;
using Truvio.Commerce.MCP.Products.Models;
using ModelContextProtocol.Server;
using System.ComponentModel;
namespace Truvio.Commerce.MCP.Products.Tools;
[McpServerToolType]
public static class WidgetTools
{
private static readonly WidgetService WidgetService = new();
[McpServerTool(Title = "Get Widgets")]
[McpToolPermission(McpToolPermissionLevel.Read)]
[Description("Returns all available widgets.")]
public static List<WidgetModel> GetWidgets()
{
return WidgetService.GetAll();
}
[McpServerTool(UseStructuredContent = true, Title = "Create Widgets")]
[McpToolPermission(McpToolPermissionLevel.Create)]
[Description("Creates one or more widgets. Returns a BulkResponse with counts and created items.")]
public static BulkResponse<WidgetModel> CreateWidgets(List<WidgetCreateModel> widgets)
{
return WidgetService.Create(widgets);
}
}
Only if the tool should also be exposed as a REST endpoint alongside MCP.
Location: {Domain}/RouteHandlers/
Register in the domain's IServiceApi implementation (e.g., ProductsServiceApi.cs).
Record the new tools in the MCP project's own tool catalog/README so they are discoverable by consumers:
| \tool_name` | Short "use when" phrase |`After creating all files:
dotnet build to check for compilation errorsMcpToolRegistry discovers it automatically via reflection)[Description] on class and all propertiesBulkResponse<T> or PagedResponse<T> (never void)[McpServerToolType][McpServerTool] + [McpToolPermission] + [Description][Description] attributesdotnet build passesWhat SKILL.md sets; muted values are Claude Code's defaults
/dynamicweb-developer:dw-extend-mcp-toolsfrom dynamicweb-developer
npx claudepluginhub dynamicweb/skills --plugin dynamicweb-developer4 skills in this plugin
/dw-setup-installInstall Swift 2 on a fresh DW10 instance. Triggers: baseline database/files, initial MCP add-ins. Existing settings -> dw-setup-config; presales host/MCP/TLS scaffolding -> presales bundle./dw-source-doc-lookupLook up live DW10 documentation for feature behavior and configuration. Triggers: how-to questions, exact field/setting/macro/tag/API names, unexpected behavior. C# internals -> dw-source-explorer./dw-source-explorerFind Dynamicweb API internals and extension points from NuGet package metadata, the release changelog and the public GitHub repositories. Triggers: find classes/methods, understand implementation before coding. MCP tool implementation -> dw-extend-mcp-tools.