unitrail-mcp-server
v1.2.0
Published
MCP server for Uniware Unitrail (Grafana/Loki) log queries with auto-datasource detection
Downloads
158
Maintainers
Readme
Unitrail MCP
Simple MCP for querying production logs from Unitrail (Grafana + Loki).
2 tools: unitrail_status · unitrail_query_logs
Team setup (3 steps per developer)
1. Clone and build (one time)
git clone <internal-repo-url>/Unitrail_MCP.git ~/unicommerceRepo/Unitrail_MCP
cd ~/unicommerceRepo/Unitrail_MCP
npm install && npm run buildOr after npm publish: npx -y [email protected] (no clone needed).
2. Add credentials to ~/.cursor/mcp.env
UNITRAIL_USERNAME=your.ldap.user
UNITRAIL_PASSWORD=your_unitrail_passwordUses the same login as the Unitrail web UI. No cookie copying, no DevOps API token.
3. Open Uniware in Cursor
Uniware/.cursor/mcp.json already includes the unitrail server. Restart Cursor → MCP → enable unitrail.
Loki datasources
| Deployment | MCP datasource | Log file |
|------------|------------------|----------|
| Dedicated (Urbanclap, …) | dedicated | {tenantcode}.log |
| ECloud shared | eclouds | {tenantcode}.log on ecloudN-* |
| Cloud shared | clouds | {tenantcode}.log |
Example chat prompts
- Urbanclap logs last 30 min →
datasource: dedicated,tenant: urbanclap,hours: 0.5 - Mosaicwellness on ecloud1 last hour →
datasource: eclouds,tenant: mosaicwellnesspvtlmt,pod_name: ecloud1-uniware-api-0
Example tool params
{
"datasource": "dedicated",
"tenant": "urbanclap",
"hours": 0.5,
"limit": 100
}{
"datasource": "eclouds",
"tenant": "mosaicwellnesspvtlmt",
"pod_name": "ecloud1-uniware-api-0",
"search": "ERROR",
"hours": 1
}Rollout options for platform team
| Option | Pros |
|--------|------|
| A. Project mcp.json (current) | Zero config beyond mcp.env; commit Uniware/.cursor/mcp.json |
| B. npm package | npx -y unitrail-mcp-server — no fixed clone path |
| C. Cursor Team MCP | Admin enables once for whole org |
Environment variables
| Variable | Required | Description |
|----------|----------|-------------|
| UNITRAIL_USERNAME | Yes* | Unitrail LDAP username |
| UNITRAIL_PASSWORD | Yes* | Unitrail LDAP password |
| UNITRAIL_URL | No | Default https://unitrail.unicommerce.co.in |
| UNITRAIL_LOKI_DATASOURCE | No | Default eclouds |
*Or UNITRAIL_API_TOKEN / UNITRAIL_SESSION_COOKIE instead.
