业务知识MCP服务器

一个生产就绪的模型上下文协议(MCP)服务器,通过环境变量提供可配置的业务知识,支持HTTP和STDIO传输。

  • by Valerii3
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 Valerii3/simple-mcp

使用说明

业务知识MCP服务器

一种生产就绪的模型上下文协议(MCP)服务器,通过环境变量提供可配置的业务知识。遵循Dedalus平台指南构建,支持HTTP和STDIO传输。

特性

  • 可配置的业务知识:通过设置您的业务信息 BUSINESS_KNOWLEDGE 环境变量
  • 双重运输支持:HTTP(生产)和STDIO(开发)传输
  • 生产就绪:健康检查、会话管理、错误处理
  • Dedalus兼容:遵循所有Dedalus平台架构指南

设置

  1. 安装依赖项:

    npm install
    
  2. 构建项目:

    npm run build
    

用法

HTTP传输(生产)

使用HTTP传输启动服务器:

npm start                    # Default port 8080
npm start -- --port 3000    # Custom port

服务器将在以下位置可用:

  • MCP端点: http://localhost:8080/mcp
  • 健康检查: http://localhost:8080/health
  • SSE端点: http://localhost:8080/sse (向后兼容性)

STDIO交通(发展)

对于MCP客户的本地开发:

npm run start:stdio

自动重建开发

npm run dev        # HTTP transport
npm run dev:stdio  # STDIO transport

配置

环境变量

使用以下工具设置您的业务知识 BUSINESS_KNOWLEDGE 环境变量:

export BUSINESS_KNOWLEDGE="Your comprehensive business information here..."

Dedalus部署示例:

BUSINESS_KNOWLEDGE="I am a professional photographer based in London, UK. Here are my key business details:

📸 **Services Offered:**
- Portrait photography (individual & family)
- Event photography (weddings, corporate events, parties)
- Commercial photography (product shots, headshots, lifestyle)
- Real estate photography
- Street photography workshops

🕒 **Working Hours:**
- Weekends: 9:00 AM - 5:00 PM (Saturday & Sunday)
- Weekdays: Available for consultations and post-processing
- Emergency shoots: Available with 24-hour notice

📍 **London Coverage Areas:**
- Central London (Westminster, City of London, Camden)
- North London (Islington, Hackney, Haringey)
- South London (Southwark, Lambeth, Wandsworth)
- East London (Tower Hamlets, Newham, Waltham Forest)
- West London (Kensington & Chelsea, Hammersmith & Fulham)

💰 **Pricing Structure:**
- Portrait sessions: £150-300 (1-2 hours)
- Event photography: £400-800 (4-8 hours)
- Commercial shoots: £200-500 per day
- Travel within London: Included
- Travel outside London: £0.50 per mile

📱 **Contact & Booking:**
- Email: hello@londonphotographer.co.uk
- Phone: +44 20 7123 4567
- Website: www.londonphotographer.co.uk
- Instagram: @london_photographer_pro

🎯 **Specializations:**
- Natural light photography
- Studio photography (access to professional studios in Shoreditch)
- Post-processing and retouching
- Photo editing and color grading
- Digital delivery within 48-72 hours

I pride myself on capturing authentic moments and providing a professional, friendly service to clients across London."

其他环境变量

  • PORT:HTTP服务器端口(默认值:8080)
  • NODE_ENV:将生产模式设置为“生产”

客户端配置

对于MCP客户端,请使用以下配置:

{
  "mcpServers": {
    "business-knowledge": {
      "url": "http://localhost:8080/mcp"
    }
  }
}

工具参考

获取_业务_知识

描述:从环境变量中检索可配置的业务知识和信息

参数:无

退货:来自 BUSINESS_KNOWLEDGE 环境变量

示例响应:

{
  "content": [
    {
      "type": "text",
      "text": "Your business knowledge content here..."
    }
  ]
}

错误处理

  • 如果 BUSINESS_KNOWLEDGE 未设置环境变量,该工具返回一条明确的错误消息
  • 检索过程中的任何其他错误都会被捕获并作为错误响应返回
  • 健康检查端点提供服务器状态监视

建筑

此服务器遵循Dedalus平台架构指南:

  • 模块化结构:通过专用模块明确区分关注点
  • 流式HTTP优先:现代HTTP传输作为主要接口
  • 类型安全:具有适当接口的完整TypeScript覆盖率
  • 生产就绪:内置错误处理、日志记录和配置管理
  • 会话管理:适当的会话处理和清理
  • 健康监测:内置健康检查端点