Nexter MCP服务器
使用Nexter Blocks为WordPress提供人工智能内容管理。此MCP(模型上下文协议)服务器支持智能创建和修改使用Nexter的96个Gutenberg块构建的WordPress帖子和页面(合并重复项,优先考虑Pro版本)。
状态: 生产就绪| 查看状态
特性
- 🤖 基于人工智能的内容管理 -WordPress内容的自然语言命令
- 🎨 支持96个Nexter块 -完整的架构覆盖率(合并重复项,优先考虑Pro版本)
- 🛡️ 安全编辑 -多层验证可防止破坏现有布局
- 📝 WordPress修订版 -自动为所有更改创建修订版
- 🔄 回滚支持 -通过WordPress修订版轻松回滚
- 🎯 智能歧义解决 -模糊命令的智能处理
- 📦 Docker就绪 -只需一个命令即可在Dokloy上部署
建筑
AI-Powered CLI
↓ MCP Protocol (HTTP/JSON-RPC 2.0)
MCP Server (nexter.aiengineops.com)
↓ REST API (Application Password)
WordPress (tailoredhealth.ai)
↓ Nexter Blocks (96 blocks)
Website Visitors文档:
快速开始
先决条件
- Node.js 20+
- WordPress 5.9+与Nexter块(免费+专业版)
- WordPress应用程序密码
- Dokploy(用于生产部署)
安装
1.安装WordPress插件
# Upload wordpress-plugin/nexter-mcp-api to WordPress
# Activate: Plugins → Nexter MCP API → Activate2.创建应用程序密码
WordPress Admin → Users → Your Profile → Application Passwords
Application Name: "Nexter MCP Server"
Click: Add New Application Password
Copy the generated password (format: xxxx xxxx xxxx xxxx)3.配置环境
cp .env.example .env
# Edit .env with your WordPress URL and credentials4.提取块模式
重要: 模式必须在Nexter插件文件所在的工作区中提取,然后提交给git。
# In this workspace (has access to Nexter plugin files)
npm install
npm run extract-schemas
# This scans:
# - ../the-plus-addons-for-block-editor/classes/blocks/
# - ../the-plus-addons-for-block-editor-pro/classes/blocks/
# And generates 96 schema files in schemas/ directory
# Verify schemas created
ls schemas/*.json | wc -l
# Should show 96+ files
# Commit schemas to git
git add schemas/
git commit -m "Add extracted Nexter block schemas"注: Docker build将复制这些预先生成的模式。它不会在构建过程中提取它们。
5.本地运营(开发)
npm run dev服务器启动时间 http://localhost:3000
6.部署到Dokploy(生产)
# Push to GitHub
git init
git add .
git commit -m "Initial commit"
git remote add origin https://github.com/yourusername/nexter-mcp-server.git
git push -u origin main
# In Dokploy:
# - Create new application
# - Connect to GitHub repo
# - Set environment variables (see .env.example)
# - Configure domain: nexter.aiengineops.com
# - Deploy环境变量
看 .env.example 对于所有配置选项。
必修的:
WORDPRESS_URL-您的WordPress网站URLWP_USERNAME-WordPress管理员用户名WP_APP_PASSWORD-WordPress应用程序密码
可选:
SCHEMA_REFRESH_SECRET-架构刷新端点的密码LOG_LEVEL-日志记录级别(调试、信息、警告、错误)MCP_TRANSPORT-传输模式(远程为http,本地为stdio)
MCP工具
服务器将这些工具暴露给AI代理:
get_block_schemas
获取特定块、用例或类别的Nexter块模式。
{
"block_names": ["tpgb/tp-accordion", "tpgb/tp-heading"],
"use_case": "faq-section",
"category": "interactive"
}create_content
使用Nexter块创建新的WordPress帖子或页面(始终为草稿)。
{
"post_type": "post",
"title": "My New Post",
"blocks": [...]
}edit_content
使用目标操作编辑现有帖子/页面。
{
"post_id": 456,
"operations": [
{
"operation": "modify_block",
"block_id": "test001",
"new_attrs": {"title": "Updated Title"}
}
]
}analyze_content
分析帖子/页面以识别块和结构。
{
"post_id": 456,
"include_schemas": true
}search_content
搜索帖子或页面。
{
"query": "acne blog",
"post_type": "post",
"limit": 10
}validate_content
保存前验证块结构。
{
"blocks": [...],
"strict": false
}项目结构
nexter-mcp-server/
├── src/ # TypeScript source code
│ ├── index.ts # Server entry point
│ ├── tools/ # MCP tool implementations
│ ├── services/ # Core services (WordPress client, schema loader)
│ ├── utils/ # Utilities (logger, validators)
│ └── resources/ # MCP resources
├── schemas/ # Block schemas (generated)
├── scripts/ # Utility scripts
│ └── extract-schemas.js # Schema extraction
├── wordpress-plugin/ # WordPress plugin
│ └── nexter-mcp-api/ # Upload this to WordPress
├── docs/ # Documentation
├── Dockerfile # Docker build configuration
├── docker-compose.yml # Dokploy deployment
└── package.json # Dependencies发展
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests
npm test
# Lint code
npm run lint
# Extract schemas (after Nexter updates)
npm run extract-schemas测试
# Test health check
curl http://localhost:3000/health
# Test with WordPress
curl -X POST http://localhost:3000/test-connection
# View logs
tail -f logs/combined.log部署
Dokloy配置
- 创建应用 在Dokploy
- 连接GitHub 仓库
- 设置环境变量 (摘自.env.example)
- 配置域:nexter.aiengineops.com
- 启用SSL:让我们通过Traefik加密
- 部署
Dokloy自动:
- 构建Docker镜像
- 创建隔离网络
- 配置Traefik布线
- 提供SSL证书
- 通过健康检查启动容器
安全
- WordPress应用程序密码(可撤销)
- 环境变量中的所有凭据
- 没有硬编码的秘密
- 在所有端点上进行输入验证
- 已启用速率限制
- 通过Traefik强制执行HTTPS
监控
- 健康检查端点:
/health - 使用Winston进行结构化日志记录
- 请求/响应日志记录
- 误差跟踪
- 性能指标(可选)
维护
更新架构
更新Nexter Blocks后,在此工作区本地提取模式并推送到GitHub:
# 1. Update Nexter plugin files in workspace
# Copy latest versions to:
# - ../the-plus-addons-for-block-editor/
# - ../the-plus-addons-for-block-editor-pro/
# 2. Re-extract schemas in this workspace
cd nexter-mcp-server
npm run extract-schemas
# 3. Verify schemas updated
ls schemas/*.json | wc -l # Should be 96+
git diff schemas/ # Review changes
# 4. Commit and push to GitHub
git add schemas/
git commit -m "Update schemas for Nexter vX.X.X"
git push origin main
# 5. Dokploy auto-redeploys on push
# Or manually: Dokploy → nexter-mcp-server → Redeploy为什么是这个工作流程?
- ✅ 工作区可以访问Nexter插件源文件
- ✅ 模式受版本控制且可审查
- ✅ Docker构建速度很快(只复制预先生成的模式)
- ✅ Docker镜像中不需要Nexter插件
查看日志
# In Dokploy
docker logs nexter-mcp-server --tail=100 -f
# Local
tail -f logs/combined.log故障排除
无法连接到WordPress
# Test WordPress REST API
curl https://your-site.com/wp-json/
# Test Application Password
curl -u "username:app-password" https://your-site.com/wp-json/wp/v2/users/me
# Check plugin is activated
# WordPress Admin → Plugins → Nexter MCP API should be active架构提取失败
# Verify Nexter plugins exist in workspace
ls ../the-plus-addons-for-block-editor/classes/blocks/
ls ../the-plus-addons-for-block-editor-pro/classes/blocks/
# Run extraction with verbose output
node scripts/extract-schemas.jsDocker构建失败
# Build locally to debug
docker build -t nexter-mcp-test .
# Check logs
docker logs nexter-mcp-server文档
- 快速开始 -30分钟部署指南
- 状态 -当前项目状态和特征
- 部署指导 -完整的部署说明
- 建筑平面图 -完整的技术规格(8000多条线路)
- WordPress插件 -插件文档
许可证
麻省理工学院
作者
为量身定制的健康人工智能项目-WordPress内容管理自动化而构建。
