Inoyu Apache Unomi MCP Server

Inoyu Apache Unomi MCP Server

这是Anthropic的模型上下文协议在Apache Unomi CDP中的实现。

Inoyu Apache Unomi MCP 服务器 - 快速开始指南

简介

这是一个模型上下文协议服务器,允许 Claude 通过 Apache Unomi 的配置文件管理功能维护用户上下文。

⚠️ 早期实现,仅用于演示、学习和实验目的

安装步骤

  1. 配置 Claude Desktop

    在 MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    在 Windows: %APPDATA%/Claude/claude_desktop_config.json

    {
      "mcpServers": {
        "unomi-server": {
          "command": "npx",
          "args": ["@inoyu/mcp-unomi-server"],
          "env": {
            "UNOMI_BASE_URL": "http://your-unomi-server:8181",
            "UNOMI_USERNAME": "your-username", 
            "UNOMI_PASSWORD": "your-password",
            "UNOMI_PROFILE_ID": "your-profile-id",
            "UNOMI_KEY": "your-unomi-key",
            "UNOMI_EMAIL": "your-email@example.com",
            "UNOMI_SOURCE_ID": "claude-desktop"
          }
        }
      }
    }
    
  2. 重启 Claude Desktop

  3. 验证安装:点击聊天窗口右下角的工具图标,检查服务器工具是否可用

主要功能

可用工具

  • get_my_profile - 获取您的用户配置文件

    • 可选参数: requireSegments, requireScores
  • update_my_profile - 更新您的配置文件属性

    {
      "properties": {
        "firstName": "John",
        "age": 30,
        "isSubscribed": true,
        "oldProperty": null
      }
    }
    
  • get_profile - 通过ID检索配置文件

    • 必须参数: profileId
  • search_profiles - 搜索配置文件

    • 必须参数: 查询字符串
    • 可选参数: 限制/偏移量
  • create_scope - 创建新的Unomi作用域

    {
      "scope": "my-app",
      "name": "My Application",
      "description": "Scope for my application events"
    }
    

作用域管理

  • 默认使用claude-desktop作用域
  • 可通过create_scope创建自定义作用域
  • 如需要,系统会自动创建作用域

Unomi服务器配置

在Unomi服务器上配置:

  1. 受保护事件 (etc/org.apache.unomi.cluster.cfg):

    org.apache.unomi.cluster.authorization.key=your-unomi-key
    org.apache.unomi.ip.ranges=127.0.0.1,::1,your-claude-desktop-ip
    
  2. 配置CORS (etc/org.apache.unomi.cors.cfg):

    org.apache.unomi.cors.allowed.origins=http://localhost:*
    
  3. 重启Unomi服务器应用更改

调试

使用MCP Inspector进行调试:

npm run inspector

演示

观看演示视频了解更多功能: Apache Unomi MCP 服务器演示