Kasra
FreeNot checkedEnables local code review and security scanning by reading files and sending them to the Kasra API for analysis, integrating with AI tools like Claude Desktop a
About
Enables local code review and security scanning by reading files and sending them to the Kasra API for analysis, integrating with AI tools like Claude Desktop and Cursor via the Model Context Protocol.
README
Kasra MCP Server — local code review via the Model Context Protocol.
Reads files on your machine and sends them to the Kasra API for security scanning. Designed to work with AI tools like Claude Desktop, Cursor, Claude Code, and any MCP-compatible client.
Install
pip install kasra-mcp
Requires Python 3.11+.
Quick Start
# Verify installation
python3 -m kasra_mcp.server --help
The server connects to a Kasra API instance (default: http://localhost:8090).
Configuration
Environment variables:
| Variable | Default | Description |
|---|---|---|
KASRA_API_URL |
http://localhost:8090 |
Kasra API base URL |
KASRA_API_KEY |
"" |
API key for authentication |
Tools
kasra_scan_file
Scan a file or directory for security vulnerabilities.
| Parameter | Type | Description |
|---|---|---|
path |
string |
Path to a file or directory to scan |
Supports both single files and directories. Ignores common non-source files (images, binaries, .git, node_modules, etc.).
kasra_get_rules
List all loaded security rules.
| Parameter | Type | Description |
|---|---|---|
severity |
string? |
Filter by severity (P0, P1, P2) |
enabled_only |
boolean? |
Only return enabled rules |
health
Check the Kasra API connection and engine status.
Integration with AI Tools
Claude Desktop
{
"mcpServers": {
"kasra": {
"command": "python3",
"args": ["-m", "kasra_mcp.server"],
"env": {
"KASRA_API_URL": "http://localhost:8090",
"KASRA_API_KEY": "your-api-key-here"
}
}
}
}
Paste this into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows).
Cursor
{
"mcpServers": {
"kasra": {
"command": "python3",
"args": ["-m", "kasra_mcp.server"],
"env": {
"KASRA_API_URL": "http://localhost:8090",
"KASRA_API_KEY": "your-api-key-here"
}
}
}
}
Claude Code
{
"mcpServers": {
"kasra": {
"command": "python3",
"args": ["-m", "kasra_mcp.server"],
"env": {
"KASRA_API_URL": "http://localhost:8090",
"KASRA_API_KEY": "your-api-key-here"
}
}
}
}
How it works
Claude Desktop / Cursor / Claude Code
│
│ stdio (JSON-RPC over stdin/stdout)
▼
┌─────────────────┐ POST /v1/scan/file ┌────────────────┐
│ kasra-mcp │ ─────────────────────────────→ │ Kasra API │
│ │ POST /v1/rules/export │ (Docker) │
│ reads local │ ←───────────────────────────── │ 193 rules │
│ file content │ findings + results │ CR scanning │
└─────────────────┘ └────────────────┘
- Claude Desktop starts
kasra-mcpas a subprocess (stdio transport) - When the user asks to scan a file, Claude calls
kasra_scan_filewith a path kasra-mcpreads the file content from local disk- Sends the content to the Kasra API via
POST /v1/scan/file - Kasra API runs 83 code review rules, returns findings
kasra-mcpreturns the results to Claude
The MCP server never stores your code — it reads, sends, and discards.
Development
git clone <repo>
cd kasra-mcp
pip install -e .
python3 -m kasra_mcp.server
Install Kasra in Claude Desktop, Claude Code & Cursor
unyly install kasra-mcpInstalls into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add kasra-mcp -- uvx --from git+https://github.com/yuanjianking/kasra-mcp kasra-mcpFAQ
Is Kasra MCP free?
Yes, Kasra MCP is free — one-click install via Unyly at no cost.
Does Kasra need an API key?
No, Kasra runs without API keys or environment variables.
Is Kasra hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Kasra in Claude Desktop, Claude Code or Cursor?
Open Kasra on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
GitHub
PRs, issues, code search, CI status
by GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
by mcpdotdirectCompare Kasra with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All development MCPs
