An MCP server to access and updates profiles on an Apache Unomi CDP server.
Empower your Large Language Models (LLMs) with persistent user context using the Inoyu Apache Unomi MCP Server. This open-source implementation leverages the Model Context Protocol (MCP) to connect LLMs like Claude with the robust profile management capabilities of Apache Unomi.
Important Considerations: Early Stage Implementation
Please be aware that this is a pre-production implementation intended for demonstration, learning, and experimentation. It is:
- Not Validated for Production: Rigorous testing and hardening are required before deployment in production environments.
- Subject to Change: The API and functionality may evolve as the project matures.
- Unofficially Supported: Community support is available, but formal support channels are not yet established.
This initial implementation focuses on core profile management features:
Note: Advanced Unomi features such as event tracking, segmentation, and scoring are not yet implemented. We encourage community feedback to prioritize future development efforts.
See the MCP server in action, enabling Claude to maintain context and manage user profiles:
Integrate the MCP server with Claude Desktop by modifying the configuration file and setting environment variables:
~/Library/Application Support/Claude/claude_desktop_config.json
%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", // Default Unomi username: karaf "UNOMI_PASSWORD": "your-password", // Default Unomi password: karaf "UNOMI_PROFILE_ID": "your-profile-id", "UNOMI_KEY": "your-unomi-key", // Default Unomi key: 670c26d1cc413346c3b2fd9ce65dab41 "UNOMI_EMAIL": "[email protected]", "UNOMI_SOURCE_ID": "claude-desktop" } } } }
Important: Replace the placeholder values with your actual Unomi server credentials and restart Claude Desktop. Verify the server's tools are available by clicking the tools icon in the chat window.
get_my_profile
: Retrieve your profile using environment variables.
UNOMI_PROFILE_ID
or email lookup for identification.requireSegments
and requireScores
.update_my_profile
: Modify profile properties.
UNOMI_PROFILE_ID
or email lookup.{ "properties": { "firstName": "John", "age": 30, "isSubscribed": true, "oldProperty": null } }
get_profile
: Retrieve a specific profile by ID.
profileId
parameter.search_profiles
: Search for profiles based on various criteria.
query
string and optional limit
and offset
parameters.firstName
, lastName
, and email
fields.create_scope
: Create a new Unomi scope.
scope
identifier and optional name
and description
.{ "scope": "my-app", "name": "My Application", "description": "Scope for my application events" }
The server automates scope management for ease of use:
Default Scope:
claude-desktop
is used for all operations.Custom Scopes:
create_scope
tool.Automatic Scope Creation:
Note: While automatic scope creation simplifies setup, you can still use the
create_scope
tool to define scopes with custom names and descriptions.
This MCP server empowers Claude to maintain user context by leveraging Apache Unomi's profile management system.
Persistent User Recognition:
Contextual Awareness:
Seamless Integration:
The server relies on the following environment variables:
UNOMI_BASE_URL=http://your-unomi-server:8181 UNOMI_USERNAME=your-username UNOMI_PASSWORD=your-password UNOMI_PROFILE_ID=your-profile-id UNOMI_SOURCE_ID=your-source-id UNOMI_KEY=your-unomi-key UNOMI_EMAIL=your-email
The server employs a two-step process to determine the profile ID:
Email Lookup (if UNOMI_EMAIL
is set):
Fallback Profile ID:
UNOMI_EMAIL
is not set.UNOMI_PROFILE_ID
from the environment.The source
field in the response indicates the method used:
"email_lookup"
: Profile found via email."environment"
: Using the fallback profile ID.Configure Protected Events in etc/org.apache.unomi.cluster.cfg
:
# Required for protected events like property updates org.apache.unomi.cluster.authorization.key=your-unomi-key # Required to allow Claude Desktop to access Unomi # Replace your-claude-desktop-ip with your actual IP org.apache.unomi.ip.ranges=127.0.0.1,::1,your-claude-desktop-ip
Ensure Proper CORS Configuration in etc/org.apache.unomi.cors.cfg
:
# Add your Claude Desktop origin if needed org.apache.unomi.cors.allowed.origins=http://localhost:*
Restart Unomi Server: Apply the configuration changes.
Critical: The Unomi key must match exactly between the server configuration and the
UNOMI_KEY
environment variable in Claude Desktop.
Install Dependencies:
npm install
Build the Server:
npm run build
Development with Auto-Rebuild:
npm run watch
Debugging MCP servers can be challenging due to stdio communication. We recommend using the MCP Inspector:
npm run inspector
The Inspector provides a browser-based debugging interface.
You can also monitor Claude Desktop logs for MCP requests and responses:
# Real-time log monitoring tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
The get_my_profile
tool automatically generates session IDs using the following format:
[profileId]-YYYYMMDD
Example: For profile ID "user123" on March 15, 2024, the session ID would be:
user123-20240315
Protected Events Failing:
Profile Not Found:
UNOMI_EMAIL
is correctly set.UNOMI_PROFILE_ID
is valid.Session Issues:
profileId-YYYYMMDD
.Connection Problems:
UNOMI_BASE_URL
is correct.Claude Desktop Logs:
# MacOS ~/Library/Logs/Claude/mcp*.log # Windows %APPDATA%\Claude\mcp*.log
Unomi Server Logs:
# Typically located in $UNOMI_HOME/logs/karaf.log
Reset State:
# Stop Claude Desktop # Clear logs rm ~/Library/Logs/Claude/mcp*.log # Restart Claude Desktop
Verify Configuration:
# Check Unomi connection curl -u username:password http://your-unomi-server:8181/cxs/cluster # Test scope exists curl -u username:password http://your-unomi-server:8181/cxs/scopes/claude-desktop
Locate or Create the Configuration File:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
Add the Server Configuration Using NPX:
{ "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": "[email protected]", "UNOMI_SOURCE_ID": "claude-desktop" } } } }
Note: Using NPX ensures you're running the latest published version of the server.
Alternatively, specify a specific version:
{ "mcpServers": { "unomi-server": { "command": "npx", "args": ["@inoyu/[email protected]"], "env": { // ... environment variables ... } } } }
For development or local installations:
{ "mcpServers": { "unomi-server": { "command": "node", "args": ["/path/to/local/mcp-unomi-server/build/index.js"], "env": { // ... environment variables ... } } } }
๐ โ๏ธ Biomedical research server providing access to PubMed, ClinicalTrials.gov, and MyVariant.info.
๐ MCP server that provides SQL analysis, linting, and dialect conversion using [SQLGlot](https://github.com/tobymao/sqlglot)
๐ ๐ All-in-one MCP server for Postgres development and operations, with tools for performance analysis, tuning, and health checks
Supabase MCP Server with support for SQL query execution and database exploration tools