Clarity MCP Server
A Model Context Protocol (MCP) server for interacting with the Clarity API. This server enables Cursor and other MCP-compatible clients to access Clarity backend services.
Installation
Prerequisites
- Python 3.10 or higher (required for
fastmcp) uvpackage manager (recommended for this project)
Installing uv
On macOS (using Homebrew):
brew install uv
On Linux/macOS (using curl):
curl -LsSf https://astral.sh/uv/install.sh | sh
On Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Setting up the project
Once uv is installed, it will automatically manage Python versions. You can install dependencies and run the server:
# Install dependencies (uv will automatically use Python 3.10+)
# IMPORTANT: Run this WITHOUT activating any venv - just run it directly
uv sync
# Install the package in editable mode so the 'clarity-mcp' command is available
# This makes the entrypoint script available
uv pip install -e .
# Verify the installation worked
uv run which clarity-mcp
# Run the server locally (for development)
uv run clarity-mcp
Important Notes:
- Never activate the venv manually - just run
uv syncanduv rundirectly in your shell uv synccreates a.venvdirectory automatically, but you never need to activate/deactivate ituv pip install -e .installs the package in editable mode, making theclarity-mcpcommand availableuv runautomatically uses the venv thatuvmanages - this is "no manual virtualenv management"uvx clarity-mcpwill only work after the package is published to PyPI. For local development, useuv run clarity-mcpafter runninguv syncanduv pip install -e .
The server will run over stdio and communicate with MCP clients.
Configuration
The server requires the following environment variables:
CLARITY_EMAIL(required): Your Clarity account email addressCLARITY_PASSWORD(required): Your Clarity account passwordCLARITY_BASE_URL(optional): Base URL for the Clarity API (defaults tohttps://clarity-backend.up.railway.app/)CLARITY_FRONTEND_URL(optional): Frontend URL for the Clarity Chat API (defaults tohttps://clarity-frontend.up.railway.app)
Setting Environment Variables
You can set environment variables in several ways:
Option 1: Export in your shell
export CLARITY_EMAIL=your_email@example.com
export CLARITY_PASSWORD=your_password
uv run clarity-mcp
Option 2: Use a .env file (with python-dotenv)
Create a .env file in your working directory:
CLARITY_EMAIL=your_email@example.com
CLARITY_PASSWORD=your_password
CLARITY_BASE_URL=https://clarity-backend.up.railway.app/
CLARITY_FRONTEND_URL=https://clarity-frontend.up.railway.app
Option 3: Inline with the command
CLARITY_EMAIL=your_email@example.com CLARITY_PASSWORD=your_password uv run clarity-mcp
Cursor MCP Configuration
Add the following entry to your Cursor mcp.json configuration file:
{
"mcpServers": {
"clarity": {
"command": "uvx",
"args": ["clarity-mcp"],
"env": {
"CLARITY_EMAIL": "your_email@example.com",
"CLARITY_PASSWORD": "your_password",
"CLARITY_BASE_URL": "https://clarity-backend.up.railway.app/",
"CLARITY_FRONTEND_URL": "https://clarity-frontend.up.railway.app"
}
}
}
}
Note:
- Replace
your_email@example.comandyour_passwordwith your actual Clarity credentials - The
CLARITY_BASE_URLandCLARITY_FRONTEND_URLare optional
After adding this configuration, restart Cursor to load the MCP server.
Available Tools
clarity_ping
Health check tool for the Clarity MCP server.
- Input: None
- Output:
{"status": "ok"}
get_company_info
Get company information from the Clarity API.
- Input: None
- Output: Dictionary containing company information
- Errors: Raises
ClarityAPIErrorif the API request fails
get_insights
Get insights from the Clarity API.
- Input:
status(optional): Status filter. Can be a single status (e.g.,"new") or comma-separated multiple statuses (e.g.,"new,ticket_created"). If not provided, returns all insights.
- Output: Dictionary containing insights data
- Errors: Raises
ClarityAPIErrorif the API request fails
Examples:
- Get all insights:
get_insights() - Get only new insights:
get_insights(status="new") - Get new and ticket_created insights:
get_insights(status="new,ticket_created")
chat
Ask questions about your users and their feedback using natural language.
- Input:
query(required): Natural language question about user feedback
- Output: Dictionary containing the chat response with a
responsefield - Errors: Raises
ClarityAPIErrorif the API request fails
Use this tool when you need to understand what users are saying about specific topics, find related feedback, or explore user sentiment.
Examples:
chat(query="What are users saying about onboarding?")chat(query="Where else are users reporting this problem?")chat(query="What are the main complaints about the mobile app?")chat(query="How do users feel about the new pricing?")
Authentication
Note: This server currently uses email/password authentication, which is a temporary MVP approach. The architecture is designed to allow swapping authentication methods (e.g., API keys or OAuth) in the future without changing the MCP tool interface.
Metadata
Release files for clarity-mcp 0.2.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| clarity_mcp-0.2.5.tar.gz | 8.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clarity_mcp-0.2.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.4 kB
Release files / clarity_mcp-0.2.5.tar.gz
| Download URL | clarity_mcp-0.2.5.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
48f576c72e86eb40dd6db4e7d1de73ae57d43c937ba3850e2c37ce20a114a053
|
|
BLAKE2b-256 checksum How to use checksums |
1e67484f59415ed1dc2be5d105458ef37be35754503f49fc8bf1d6e8a15325a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Release files / clarity_mcp-0.2.5-py3-none-any.whl
| Download URL | clarity_mcp-0.2.5-py3-none-any.whl |
|---|---|
| Size | 9.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
291ef0d99cb251a0025db7360ba47820f529142b5d8bb9c6817371e9aaa3107f
|
|
BLAKE2b-256 checksum How to use checksums |
9d0aedff85a5fe9d5346624135c50fd55e1801a00eb476417dc5d156602ba986
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.6.14
|
Security for clarity-mcp 0.2.5
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.