程度动态eb-mcp
用于DynamicWeb10管理API的MCP(模型上下文协议)服务器。使Claude Code能够完全访问DynamicWeb项类型、字段、页面、段落和API发现,而无需接触DW管理UI。
工具
物品类型
| 工具 | 说明 |
|---|---|
dw_itemtype_list |
列出所有项目类型 |
dw_itemtype_get |
获取项目类型详细信息和限制 |
dw_itemtype_create |
在一次调用中创建包含字段、组和限制的项目类型 |
dw_itemtype_update_settings |
更新设置(名称、类别、图标、可用性等) |
dw_itemtype_update_restrictions |
更新限制(允许父母、子女、网站等) |
dw_itemtype_delete |
删除项目类型 |
领域
| 工具 | 说明 |
|---|---|
dw_field_list |
列出项目类型上的字段 |
dw_field_save |
添加或更新字段 |
dw_field_delete |
删除字段 |
dw_field_types |
列出DW实例中所有可用的编辑器类型(非硬编码) |
页面
| 工具 | 说明 |
|---|---|
dw_page_list |
列表页面,可选择按区域或父级筛选 |
dw_page_get |
获取包含所有项目字段的页面 |
dw_page_create |
在父级下创建页面 |
dw_page_set_fields |
在页面上设置项目字段值 |
dw_page_delete |
删除页面 |
dw_area_list |
列出所有区域(网站) |
段落
| 工具 | 说明 |
|---|---|
dw_paragraph_list |
在页面上列出段落 |
dw_paragraph_get |
获取包含所有项目字段的段落 |
dw_paragraph_create |
在页面上创建段落 |
dw_paragraph_set_fields |
在段落上设置项目字段值 |
dw_paragraph_delete |
删除一段 |
产品
| 工具 | 说明 |
|---|---|
dw_product_list |
列出产品,可选择按组或搜索进行筛选 |
dw_product_get |
获取单个产品(完整型号,包括自定义字段/类别字段) |
dw_product_update |
更新产品上的顶级字段、customFields和categoryFields |
dw_product_delete |
删除一个或多个产品 |
dw_product_bulk_discount |
在组或产品列表中对DefaultPrice应用百分比折扣 |
dw_product_update 接受三个输入映射:
fields-顶级产品字段(名称、默认价格、库存等)customFields-全局产品自定义字段值,由SystemName键入categoryFields-产品类别字段值,按SystemName键入
产品架构
管理PIM数据模型:产品类别(属性组)和产品字段(属性本身)。
| 工具 | 说明 |
|---|---|
dw_product_field_type_list |
列出15种产品字段类型(TypeId+别名) |
dw_product_category_list |
列出产品类别 |
dw_product_category_save |
创建或更新产品类别 |
dw_product_category_delete |
删除类别(内部处理的3步DW工作流) |
dw_product_field_list |
列出属于某个类别的字段 |
dw_product_field_save |
在类别上创建或更新字段(接受类型别名) |
dw_product_field_delete |
从单个类别中删除字段 |
文件
| 工具 | 说明 |
|---|---|
dw_files_list |
列出目录中的文件,可选择按扩展名筛选 |
dw_files_directories |
列出子目录 |
交付API(只读)
| 工具 | 说明 |
|---|---|
dw_content_areas |
从Delivery API获取区域 |
dw_content_pages |
获取包含内容的页面 |
dw_content_paragraphs |
获取包含内容的段落 |
API发现
| 工具 | 说明 |
|---|---|
dw_api_search |
按关键字在Swagger规范中搜索端点 |
dw_api_endpoint_schema |
获取端点的请求/响应架构 |
dw_api_call |
对任何管理API终结点的原始调用 |
设置
1.获取DW API令牌
在DynamicWeb管理中,转到 设置>开发人员>API密钥 并创建具有完全访问权限的新密钥。
2.配置您的AI客户端
Claude Code
添加 .mcp.json 在您的项目中:```json
{
"mcpServers": {
"dynamicweb": {
"command": "npx",
"args": ["-y", "@degree-as/dynamicweb-mcp"],
"env": {
"DW_BASE_URL": "https://your-dw-instance",
"DW_API_TOKEN": "your-token"
}
}
}
}
Claude Desktop
编辑 `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS)或 `%APPDATA%\Claude\claude_desktop_config.json` (Windows):```json
{
"mcpServers": {
"dynamicweb": {
"command": "npx",
"args": ["-y", "@degree-as/dynamicweb-mcp"],
"env": {
"DW_BASE_URL": "https://your-dw-instance",
"DW_API_TOKEN": "your-token"
}
}
}
}
Cursor
添加 ~/.cursor/mcp.json (全球)或 .cursor/mcp.json (项目):```json
{
"mcpServers": {
"dynamicweb": {
"command": "npx",
"args": ["-y", "@degree-as/dynamicweb-mcp"],
"env": {
"DW_BASE_URL": "https://your-dw-instance",
"DW_API_TOKEN": "your-token"
}
}
}
}
VS Code / GitHub Copilot
添加 `.vscode/mcp.json` 到您的项目(注意:使用 `servers`,不 `mcpServers`):```json
{
"servers": {
"dynamicweb": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@degree-as/dynamicweb-mcp"],
"env": {
"DW_BASE_URL": "https://your-dw-instance",
"DW_API_TOKEN": "your-token"
}
}
}
}
Windsurf
编辑 ~/.codeium/windsurf/mcp_config.json:```json
{
"mcpServers": {
"dynamicweb": {
"command": "npx",
"args": ["-y", "@degree-as/dynamicweb-mcp"],
"env": {
"DW_BASE_URL": "https://your-dw-instance",
"DW_API_TOKEN": "your-token"
}
}
}
}
Cline
通过Cline的MCP设置UI进行配置,或添加到其配置中:```json
{
"mcpServers": {
"dynamicweb": {
"command": "npx",
"args": ["-y", "@degree-as/dynamicweb-mcp"],
"env": {
"DW_BASE_URL": "https://your-dw-instance",
"DW_API_TOKEN": "your-token"
}
}
}
}
Zed
添加到Zed的 settings.json (注:用途 context_servers):```json
{
"context_servers": {
"dynamicweb": {
"source": "custom",
"command": "npx",
"args": ["-y", "@degree-as/dynamicweb-mcp"],
"env": {
"DW_BASE_URL": "https://your-dw-instance",
"DW_API_TOKEN": "your-token"
}
}
}
}
Continue.dev
添加 `~/.continue/config.yaml`:```yaml
mcpServers:
- name: dynamicweb
command: npx
args:
- -y
- "@degree-as/dynamicweb-mcp"
env:
DW_BASE_URL: https://your-dw-instance
DW_API_TOKEN: your-token
3.重新启动客户端
当您的AI客户端加载时,MCP服务器会自动启动。
本地开发
如果你想从源代码而不是已发布的包运行:```bash
git clone https://github.com/Degree-AS/degree-dynamicweb-mcp.git
cd degree-dynamicweb-mcp
npm install
npm run build
然后使用 `"command": "node", "args": ["/path/to/degree-dynamicweb-mcp/dist/index.js"]` 在 `.mcp.json`.
## 字段类型别名
### 项目类型字段(`dw_field_save`, `dw_itemtype_create`)
创建字段时,您可以使用短别名而不是完整别名。NET类名:
|别名|编辑器|
| ---------------- | ---------------------- |
| `text` |文本编辑器|
| `longtext` |长文本编辑器|
| `richtext` |RichTextEditor|
| `richtextlight` |里希特-编辑权|
| `file` / `image` |文件编辑器|
| `folder` |文件夹编辑器|
| `media` |媒体编辑器|
| `link` |链接编辑器|
| `itemlink` |项目链接编辑器|
| `itemrelation` |itemr.精心设计的倾听者|
| `number` |整数编辑器|
| `decimal` |小数编辑器|
| `date` |日期编辑器|
| `datetime` |日期时间编辑器|
| `checkbox` |复选框编辑器|
| `checkboxlist` |CheckboxListEditor|
| `dropdown` |dropdownlister|
| `radiolist` |收音机按钮收听器|
| `editablelist` |可编辑列表编辑器|
| `color` |颜色编辑器|
| `colorswatch` |ColorSwatch编辑器|
| `itemtype` |项目典型编辑器|
| `itemtab` |ItemTypeTabEditor|
| `user` |用户编辑器|
| `singleuser` |单用户编辑器|
| `usergroup` |单用户组编辑器|
| `geolocation` |地理定位编辑器|
| `googlefont` |谷歌字体编辑器|
| `hidden` |HiddenFieldEditor|
| `password` |密码编辑器|
任何满的。NET编辑器类名也被接受。使用 `dw_field_types` 从DW实例中发现所有可用的编辑器。
### 产品领域(`dw_product_field_save`)
产品字段使用不同的系统-整数 `TypeId` 从 `FieldTypeAll`,而不是编辑器类名:
|别名|TypeId|名称|
| -------------------- | ------ | ----------- |
| `text` / `text255` |1|文本(255)|
| `longtext` |2|长文本|
| `checkbox` |3|复选框|
| `date` |4|日期|
| `datetime` |5 |日期/时间|
| `number` / `integer` |6 |整数|
| `decimal` |7 |十进制|
| `link` |8|链接|
| `file` |9|文件|
| `text100` |10 |文本(100)|
| `text50` |11 |文本(50)|
| `text20` |12 |文本(20)|
| `text5` |13|文本(5)|
| `richtext` / `editor`|14 |编辑|
| `list` / `dropdown` |15 |列表|
数字TypeId也可以直接接受。使用 `dw_product_field_type_list` 从DW实例中获取实时列表。
## 建筑```
src/
index.ts Entry point - reads config from env, registers tools
client.ts DwClient - HTTP client for Admin API, Update API, Delivery API
utils.ts Shared Zod helpers (jsonParam, numParam) and string helpers (pascal)
tools/
itemTypes.ts Item type CRUD, fields, restrictions, settings, editor discovery
pages.ts Page and area management
paragraphs.ts Paragraph management (uses ParagraphNew + ParagraphSave)
products.ts Product CRUD, bulk discount, custom/category field value updates
productSchema.ts Product categories and product field schema management
files.ts File and directory browsing
delivery.ts Read-only Delivery API
discovery.ts Swagger search, endpoint schema, raw API calls
DW API表面
DynamicWeb管理API有三种调用约定:
- 管理员API (
GET /admin/api/{Endpoint})-带有URL参数的查询 - 命令API (
POST /admin/api/{Endpoint})-突变{ Model: {...} }身体。删除命令使用扁平体(无模型包装)。 - 更新API (
POST /Admin/Api/{Endpoint}?Query.Type={Type})-更新现有记录{ QueryData: {...}, model: {...} }身体
DwClient 每种方法都有专门的方法: get(), post(), command(), update(), delivery().
发展```bash
npm run dev # Run with tsx (hot reload)
npm run build # Compile TypeScript
npm run start # Run compiled version
```
更改后,运行 npm run build 并重新启动Claude Code以获取新版本。
