How to Connect Profinity to AI
Connect Profinity to AI tools and LLMs using the Model Context Protocol (MCP) server integration.
Prerequisites
- Profinity V2 installed and running
- Admin access to system configuration
- An AI tool or LLM that supports MCP (e.g., Claude Desktop, Cursor IDE)
- Understanding of MCP protocol
Steps
Step 1: Enable MCP Server in Profinity
- Navigate to ADMIN → System Configuration
- Find MCP Server section in Application Configuration
- Enable MCP Server option
- Click Save
Note: The MCP server will be available at http://localhost:18080/sse (using the default Profinity web server port).
Step 2: Create Service Account and Get Token
The MCP server requires authentication using JWT tokens. Users must have the SystemRead security role to access MCP endpoints.
- Create a user account with the
SystemReadrole: - Navigate to ADMIN → User Management
- Create a new user (e.g., "mcp-service")
- Set Service Account to
true - Assign the
SystemReadsecurity role -
Save the user
-
Generate a JWT token for the service account:
- Authenticate via the Profinity API:
POST /api/v2/Users/Authenticate - Use the service account username and password
- Save the token from the response (service account tokens never expire)
Example API call:
curl -X POST http://localhost:18080/api/v2/Users/Authenticate \
-H "Content-Type: application/json" \
-d '{"username":"mcp-service","password":"your-password"}'
Step 3: Configure Your AI Tool
The following should be taken as examples only, check with your tools documentation on how to configure MCP over SSE to your tool.
Examples on using SSE with OLLAMA are also available on the Prohelion GitHub page https://www.github.com/prohelion.
Example For Claude Desktop:
- Open Claude Desktop settings
- Navigate to MCP server configuration
- Add MCP server with authentication:
Note: Replace
{ "mcpServers": { "profinity": { "command": "npx", "args": [ "@modelcontextprotocol/server-fetch", "http://localhost:18080/sse" ], "env": { "AUTHORIZATION": "Bearer YOUR_JWT_TOKEN_HERE" } } } }YOUR_JWT_TOKEN_HEREwith the JWT token from Step 2. - Restart Claude Desktop
Step 4: Verify Connection
- In your AI tool, try querying Profinity data
- Check MCP server responds correctly
- Verify you can access component data, profiles, and dashboards
Step 5: Use AI Features
Once connected, you can:
- Query component data
- Analyse dashboards
- Generate scripts
- Troubleshoot issues
Example Queries
- "What components are in my active profile?"
- "Show me the current battery voltage from the BMU"
- "Create a dashboard for monitoring motor controller temperatures"
- "Help me write a script to log data every 5 seconds"
Tips
- Start Simple: Begin with basic queries to verify the connection
- Check Logs: Monitor Profinity logs for MCP connection issues
- Firewall Settings: Ensure the MCP port is accessible if connecting remotely
- Authentication: Use strong credentials for production deployments
Troubleshooting
- Connection Failed: Verify MCP server is enabled and port is correct
- No Data Available: Ensure you have active components and profiles
- Authentication Errors: Check credentials match in both systems
Related Documentation
- MCP Server - Complete MCP server documentation
- Scripting - Learn about Profinity scripting
- APIs - REST API documentation