ERP集成服务

SyteLine MCP Server是一个企业级ERP集成服务,提供完整的SyteLine IDORequestService API覆盖,智能令牌管理,以及优化的AI助手工具。

  • by JasonTiraDev
  • TypeScript
  • 本地部署
  • 3 星标
  • 更新于
在 GitHub 查看 JasonTiraDev/Syteline-MCP

使用说明

SyteLine MCP服务器

🔑 SyteLine IDORequestService MCP服务器 -面向AI助手的企业ERP集成

🚨 关键:首先需要身份验证!

此服务器连接到SyteLine/Mongoose ERP系统。每个会话都必须从身份验证开始!

// REQUIRED FIRST CALL - Nothing works without this!
await syteline_get_security_token({
  config: "SL_PROD",        // Your SyteLine configuration
  username: "your_user",    // Your SyteLine username  
  password: "your_pass"     // Your SyteLine password
});

该项目提供:

  • ✅ 完整的SyteLine IDORequestService API覆盖范围 -已实现所有端点
  • ✅ 智能令牌管理 -自动缓存和刷新
  • ✅ LLM优化工具 -清晰的描述和使用模式
  • ✅ 交互式帮助系统 -内置使用指南工具
  • ✅ 生产准备就绪 -全面的错误处理和验证

🚦 入门指南

⚙️ 先决条件

在开始之前,请确保您已经:

📥 安装和设置

1.安装依赖项

从项目的根目录运行:

npm install

2.构建TypeScript项目

npm run build

3.配置环境变量

创建一个 .env 通过复制项目根目录中的文件 .env.example 文件:

cp .env.example .env

打开新 .env 文件并添加您的API凭据:

# The base URL for the API
BASE_URL=https://api.example.com

# Your API Key for authentication (if required)
API_KEY=your_secret_api_key_here

生成的工具将使用这些环境变量进行API调用。您可以通过传递以下命令来覆盖每次呼叫 BASE_URL 或 API_KEY 在工具的论证中。

▶️ 运行服务器

您可以在两种模式下运行服务器:

1.标准模式(默认-适用于克劳德桌面等)

此模式非常适合像Claude Desktop这样的MCP客户端。

npm start

对于自动重新加载的开发:

npm run dev

2.HTTP模式

此模式在以下位置公开HTTP端点 /mcp 它可以被任何HTTP客户端调用。

node dist/index.js --http

默认情况下,服务器将在端口3001上启动(可通过以下方式配置 PORT env变量)。

🚀 快速使用指南

基本操作顺序

  1. 先进行身份验证 (必填):

    await syteline_get_security_token({
      config: "SL_PROD",
      username: "your_user", 
      password: "your_pass"
    });
    
  2. 发现可用数据:

    // See what IDOs are available
    const idoList = await syteline_get_ido_collection_names();
    
    // Get schema for specific IDO
    const schema = await syteline_get_ido_info({ idoName: "UserNames" });
    
  3. 查询数据:

    const data = await syteline_load_collection({
      ido: "UserNames",
      properties: ["UserId", "UserName", "UserDesc"],
      filter: "Active = 1",
      recordCap: 50
    });
    
  4. 获取交互式帮助:

    // Complete usage guide
    await syteline_usage_guide();
    
    // Specific help sections
    await syteline_usage_guide({ section: "authentication" });
    await syteline_usage_guide({ section: "querying" });
    

成功的关键规则

  • ⚠️ 始终先进行身份验证 -没有它,其他操作都无法进行
  • 🔑 令牌会自动缓存 -无需手动管理令牌
  • 📋 使用行指针进行更新 -从LoadCollection查询中获取它们
  • 📝 IDO名称区分大小写 -通常PascalCase类似“用户名”
  • 🔍 在筛选器中使用单引号 - "UserId = 'admin'" 不 "UserId = \"admin\""

📊 项目结构

src/
  ├── index.ts          # Main server entry point
  ├── lib/
  │   └── tools.ts      # Tool discovery logic
  └── tools/
      ├── paths.ts      # Tool registry
      └── [api_name]/   # Generated API tools
          └── *.ts      # Individual tool files
dist/                   # Compiled JavaScript (generated)

🔧 发展

观看模式 (更改时自动重新编译):

npm run watch

🔌 与Claude Desktop一起使用

添加到您的Claude桌面配置(~/Library/Application Support/Claude/claude_desktop_config.json 在macOS上):

{
  "mcpServers": {
    "infor-idorequestservice-api": {
      "command": "node",
      "args": [
        "/absolute/path/to/your/project/dist/index.js"
      ]
    }
  }
}