内容质量验证MCP服务器

一个为Contentstack提供内容质量验证代理的自定义MCP(模块化内容平台)服务器,支持SEO、可读性、语法、合规性和可访问性验证。

  • by abhisvakil
  • JavaScript
  • 本地部署
  • 更新于
在 GitHub 查看 abhisvakil/custom-mcp-server

使用说明

内容质量MCP服务器

一个定制的MCP(模块化内容平台)服务器,为Contentstack提供内容质量验证代理。

特性

  • 🧠 内容质量代理:验证内容的SEO、可读性、语法、合规性和可访问性
  • 📋 MCP清单:完全兼容 @contentstack/mcp 客户端
  • 🚀 快递服务器:轻量级、快速的API服务器
  • 🧪 测试套件:全面的测试覆盖率

快速开始

1.安装

# Clone or create the project
mkdir content-quality-mcp-server
cd content-quality-mcp-server

# Install dependencies
npm install

2.启动服务器

# Development mode
npm run dev

# Production mode
npm start

3.测试服务器

# Run tests
npm test

# Manual testing
curl http://localhost:3000/manifest

API终点

  • GET/manifest-用于代理注册的MCP清单
  • GET/agents-列出所有可用的代理
  • POST/代理/内容质量代理-执行内容质量验证
  • GET/agents/内容质量代理/schema-获取代理输入/输出模式
  • GET/health-健康检查端点

使用Contentstack

注册MCP服务器

npx @contentstack/mcp init --url http://your-server.com/manifest

使用代理

内容质量代理接受:

{
  "content": "Your content here...",
  "contentType": "article",
  "validationRules": ["seo", "readability", "grammar", "compliance", "accessibility"]
}

退货:

{
  "score": 85,
  "issues": [
    {
      "type": "warning",
      "category": "seo",
      "message": "Content could benefit from more subheadings",
      "suggestion": "Add H2-H6 tags to improve structure"
    }
  ],
  "suggestions": ["Add more descriptive headings", "Include relevant keywords"],
  "metadata": {
    "contentLength": 1250,
    "wordCount": 200,
    "contentType": "article",
    "validationRules": ["seo", "readability"],
    "timestamp": "2024-01-15T10:30:00Z"
  }
}

部署

地方发展

npm run dev

生产部署

铁路/Heroku:

# Set environment variables
PORT=3000
NODE_ENV=production

Docker:

FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production
COPY . .
EXPOSE 3000
CMD ["npm", "start"]

Vercel/Netlify:

配置为Node.js应用程序

环境变量

  • PORT:服务器端口(默认值:3000)
  • NODE_ENV:环境(开发/生产)
  • MCP_VERSION:MCP协议版本

测试

# Run all tests
npm test

# Test individual endpoints
curl -X GET http://localhost:3000/manifest
curl -X POST http://localhost:3000/agents/content-quality-agent \
  -H "Content-Type: application/json" \
  -d '{"content": "Test content", "contentType": "article"}'

扩展服务器

添加新代理

  • 创建代理目录:代理/您的代理名称/
  • 添加代理逻辑:代理/您的代理名称/index.js
  • 定义模式:代理/您的代理名称/schema.json
  • 更新manifest.json
  • 在server.js中添加路由

代理结构

class YourAgent {
  async execute(input) {
    // Your agent logic here
    return {
      // Your response structure
    };
  }
}

module.exports = new YourAgent();

许可证

MIT许可证-有关详细信息,请参阅许可证文件