Lcontext
About
An MCP server that exposes user behavior as queryable data for AI coding agents.
Details
- Author
- lcontext
- Categories
- Other, Developer Tools, AI
Jump to
Setup
Install Lcontext in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/lcontext/Lcontext
Follow the installation instructions in the repository README, then restart your MCP client.
The product analytics agent for your AI coding tools. Lcontext studies how users navigate your product, where they engage, hesitate, and drop off, and delivers behavioral context via MCP.
Works with:Claude Code, Claude Desktop, Cursor, Windsurf, Cline, and any MCP-compatible AI coding tool.
The fastest way to get started -- sign up, configure your agent, and get your tracking script in one command:
Or using the standalone installer (no Node required):
curl -fsSL https://lcontext.com/api/cli/install | bash
Both will open your browser to sign up (or log in), configure your coding agent, and print the tracking script to add to your app.
If you prefer to set things up manually:
- Create a free account atlcontext.com
- Add the tracking script to your app (find your tag in the dashboard):
<script src="https://lcontext.com/it.js?iTag=YOUR_SITE_TAG" defer></script>
- Page views- URL, title, referrer
- Clicks- Buttons, links, interactive elements (label text only, no personal data)
- Form submissions- Form metadata (no field values captured)
- Scroll depth- How far users scroll (25% increments)
- Device metadata- Screen size, browser language, viewport
Privacy-focused:No passwords, input values, or personal information collected. ~4KB minified.
Associate the anonymous visitor with your application's user ID:
lcontext('setProfileId', 'user-123');
lcontext('trackEvent', 'purchase', { productId: 'abc', amount: 99.99 });
claude mcp add lcontext -s user -e LCONTEXT_API_KEY=your-api-key -- npx -y lcontext-mcp@latest
After clicking, replaceyour-api-key-herewith your actual API key in Cursor settings.
curl -fsSL https://lcontext.com/api/cli/install | bash
Then open Cursor Settings (Cmd/Ctrl + Shift + J), and add the server:
{ "lcontext": { "command": "lcontext", "env": { "LCONTEXT_API_KEY": "your-api-key-here" } } }
curl -fsSL https://lcontext.com/api/cli/install | bash
Then open Windsurf and navigate toCascade > Configure > MCP Servers(or click the hammer icon), then click "Add Server" and select "Add custom server". Add this configuration:
{ "lcontext": { "command": "lcontext", "env": { "LCONTEXT_API_KEY": "your-api-key-here" } } }
curl -fsSL https://lcontext.com/api/cli/install | bash
- Open Cline settings (click gear icon in Cline panel)
- Navigate toMCP Serverssection
- Add a new server:
{ "lcontext": { "command": "lcontext", "env": { "LCONTEXT_API_KEY": "your-api-key-here" } } }
curl -fsSL https://lcontext.com/api/cli/install | bash
Lcontext works with any tool that supports the Model Context Protocol. The general configuration pattern is:
- Command:lcontext
- Environment Variable:LCONTEXT_API_KEY=your-api-key-here
Refer to your tool's documentation for MCP server configuration.
The install script used above (curl -fsSL https://lcontext.com/api/cli/install | bash) is the recommended approach. If you need an alternative:
Download the binary for your platform from thelatest release:
git clone https://github.com/lcontext/lcontext.git cd lcontext npm install npm run build
Get comprehensive analytics context for a page including stats, visitor metrics, Web Vitals (LCP, FCP, FID, CLS), and all interactive elements with their engagement data.
- path(required): The page path (e.g.,/products,/checkout)
- startDate(optional): Start date for stats (ISO format)
- endDate(optional): End date for stats (ISO format)
- periodType(optional):dayorweek(default:day)
Get the analytics context for the /checkout page for the last 7 days
- limit(optional): Maximum pages to return (default: 50, max: 200)
- search(optional): Filter by path (e.g.,/product)
Get detailed analytics for a specific interactive element by its label or ID.
- elementLabel(optional): Element's label text or aria-label
- elementId(optional): Element's HTML ID
- pagePath(optional): Filter by page path
Show me analytics for the "Add to Cart" button
Get application-wide analytics including sessions, visitors, page views, engagement metrics, device breakdown (mobile/tablet/desktop), top browsers, top OS, Web Vitals (LCP, FCP, FID, CLS), and AI-generated insights.
- periodType(optional):dayorweek(default:day)
- limit(optional): Number of periods to return (default: 7, max: 30)
Give me an overview of my app's behavioral analytics for the last week
Get a list of visitors with AI-generated profiles, interests, engagement trends, segment assignments, device info (type, browser, OS), and location (city, region, country).
- limit(optional): Maximum visitors to return (default: 20, max: 100)
- offset(optional): Offset for pagination
- segmentId(optional): Filter by segment ID
- search(optional): Search in visitor ID, title, summary, interests, goals, action, evidence
- firstVisitAfter(optional): Filter by first visit date (ISO format)
- firstVisitBefore(optional): Filter by first visit date (ISO format)
- lastVisitAfter(optional): Filter by last visit date (ISO format)
- lastVisitBefore(optional): Filter by last visit date (ISO format)
- engagementTrend(optional):increasing,stable, ordecreasing
- overallSentiment(optional):positive,negative,neutral, ormixed
Show me visitors with increasing engagement trend
Get detailed profile and recent sessions for a specific visitor, including device info (type, browser, OS) and location.
- visitorId(required): The visitor's unique identifier
Get a list of user sessions with AI-generated summaries, titles, sentiment analysis, and device type.
- limit(optional): Maximum sessions to return (default: 20, max: 100)
- offset(optional): Offset for pagination
- visitorId(optional): Filter by visitor ID
- sentiment(optional):positive,negative, orneutral
- startDate(optional): Start date for filtering (ISO format)
- endDate(optional): End date for filtering (ISO format)
- search(optional): Search in session title and description
- minDuration(optional): Minimum session duration in seconds
- maxDuration(optional): Maximum session duration in seconds
- minEventsCount(optional): Minimum number of events
- maxEventsCount(optional): Maximum number of events
- pagePath(optional): Filter sessions that visited a specific page path
Show me negative sentiment sessions from the last 24 hours
Get detailed information about a specific session including full event timeline, visitor context, device type, and location (city, region, country).
- sessionId(required): The session's numeric ID
Get automatically detected user journey patterns showing how users navigate through the application. Each flow represents a common page sequence with engagement metrics and drop-off points.
- limit(optional): Maximum flows to return (default: 10, max: 50)
- category(optional): Filter by category:conversion,exploration,onboarding,support,engagement,other
- minSessions(optional): Minimum session count for a flow to be included
- periodType(optional):dayfor daily flows,weekfor weekly aggregated flows
Show me the most common user journeys on my app
Get a pre-computed daily or weekly analysis report. Contains problem areas, funnel health, session findings, and prioritized recommendations — all referencing specific page paths, element IDs, and session IDs you can investigate with other tools.
- periodType(optional):dayfor daily report (default),weekfor weekly report
- date(optional): ISO date string for the period start (e.g.,2026-02-23). Defaults to most recent completed analysis.
Get the latest daily analysis for my app
A comprehensive guide for analyzing user behavior data with Lcontext tools. Includes step-by-step analysis workflows, decision trees for common scenarios (e.g., "this page isn't converting", "performance feels slow"), and a reference table connecting analytics findings to code investigations.
AI agents can request this prompt to get expert-level guidance on how to use the tools effectively.
The binary includes a self-update command:
SeeCONTRIBUTING.mdfor development setup and build instructions.
AI Agent Supply Chain Security - Intercepts and validates every package installation, git clone, and script download triggered by AI coding agents before it executes.
Collective intelligence for AI shopping agents — 23 MCP tools for buyer intelligence, seller analytics, price alerts, and trend tracking.
Code Mode enabled MCP server - save 90% of token usage for any MCP-compatible agent
Behavioral trust layer for the AI agent economy. Check MCP server reliability scores, report interactions, detect anomalies, and discover the most trusted servers. 8 tools, free, real-time.
Behavioral trust scoring for 14,820+ MCP servers. Check reliability, latency, and success rates before tool calls.
A paid financial analytics API for AI agents on MPP
an open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
MCP server for Langfuse — query traces, debug errors, analyze sessions and prompts from any AI agent
Structural observability for AI conversations. Detects loops, stuck states, and convergence patterns across 17 channels without analyzing content.
Real-time AI company intelligence — track which AI companies are actually shipping vs just announcing, with live rankings, hype/reality gaps, and momentum signals.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





