kotlin-security-mcp
This server provides framework-aware security analysis for Kotlin/JVM code via MCP (Model Context Protocol), acting as a specialized security expert for AI coding agents (e.g., Claude Code, Cursor).
security_scan(path)– Scan a Kotlin file or directory using a 216-rule, framework-aware analyzer. Returns only security findings (style/complexity rules are disabled) with rule ID, message, location, severity, and CWE identifiers. Detects framework-specific issues like missing@PreAuthorizeon@GetMapping, unsafe WebClient TLS config, and non-HttpOnly cookies.review_diff(diff)– Analyze a unified diff to flag only the security issues introduced by that change, enabling a pre-commit self-check.secure_pattern(task, framework?)– Retrieve vetted, framework-specific secure coding patterns for risky tasks before writing code. Supports Spring, WebFlux, Ktor, Quarkus, Micronaut, and Vert.x.
Provides security analysis for Kotlin/JVM applications built with Ktor, detecting framework-specific vulnerabilities.
Provides security analysis for Kotlin/JVM applications built with Quarkus, detecting framework-specific vulnerabilities.
Provides security analysis for Kotlin/JVM applications built with Spring, detecting framework-specific vulnerabilities.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kotlin-security-mcprun security_scan on src/Main.kt"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
code-security-mcp
A security MCP server for AI coding agents. It gives Claude Code, Cursor, and other agents real security findings while they write, not after — and each language is analyzed by its best native security tool, not one generic scanner stretched across everything.
A specialist, not a generalist. Kotlin is analyzed by detekt with a 216-rule, framework-aware ruleset (Spring, WebFlux, Ktor, Quarkus, Micronaut, Vert.x); Java by SpotBugs + FindSecBugs; Python by Bandit; C# by the Roslyn security analyzers; JS/TS by ESLint + eslint-plugin-security — each the established native security analyzer for its language, routed automatically.
New languages arrive as their own native analyzer — never a single lowest-common-denominator scanner.
Install
pipx install code-security-mcp # or: uvx code-security-mcpThis installs the code-security-mcp server. Python analysis works immediately
(pipx inject code-security-mcp bandit); the JVM/.NET/JS analyzers are external
tools you point at with env vars — the setup script below fetches them for you.
Related MCP server: Spring Toolkit MCP
Quickstart (from source, with all analyzers)
git clone https://github.com/JasminGuberinic/code-security-mcp
cd code-security-mcp
python3 -m venv .venv && .venv/bin/pip install -e ".[python]"
# Download the analyzers into an isolated cache (nothing global is touched):
./scripts/setup.sh # Kotlin + Java
./scripts/setup.sh --with-dotnet --with-eslint # + C# and JS/TS (optional)The script prints the claude mcp add … command to paste.
Why
Generic assistants and multi-language scanners are shallow on framework idioms —
they don't know that a @GetMapping is missing @PreAuthorize, that a WebClient
trusts all certificates, or that a Vert.x cookie isn't HttpOnly. This server
wraps a 216-rule, framework-aware analyzer (the
kotlin-security-scanner
detekt ruleset) and exposes it to agents through three tools.
Design principle: each language is handled by its best native security analyzer — routed automatically — never a single lowest-common-denominator generic scanner.
Languages
Language | Analyzer | Analyzes |
Kotlin | detekt + the 216-rule framework-aware ruleset | source ( |
Java | SpotBugs + FindSecBugs | compiled bytecode — point at the project root (it finds |
Python | Bandit | source ( |
C# | Roslyn security analyzers | builds the project — point at a |
JavaScript / TypeScript | ESLint + eslint-plugin-security | source ( |
Tools
Tool | What it does |
| Scan a file/directory (Kotlin, Java, Python, C#, or JS/TS) and return every security finding (rule, line, severity, CWE). |
| Review a unified diff and flag only the issues the change introduces — a pre-commit self-check. |
| Get the vetted secure way to do a risky task — before writing it. |
For Kotlin, security_scan returns security findings only — detekt's
built-in style/complexity rules are switched off, so the agent gets signal, not
noise.
Example
The agent calls security_scan and gets structured findings back:
// security_scan("src/main/kotlin/HttpClient.kt")
{
"target": "src/main/kotlin/HttpClient.kt",
"count": 2,
"findings": [
{ "rule_id": "WebClientInsecureSsl", "line": 42, "severity": "error",
"cwe": "CWE-295", "message": "Reactor-Netty WebClient trusts all certificates." },
{ "rule_id": "HardcodedJwtSecret", "line": 88, "severity": "error",
"cwe": "CWE-798", "message": "Hard-coded JWT signing secret." }
]
}…and it can ask for the fix before writing it:
"What's the secure way to create a session cookie in Vert.x?"
// secure_pattern(task = "create a session cookie", framework = "vertx") → CWE-614
val cookie = Cookie.cookie("session", token)
.setSecure(true) // only sent over HTTPS
.setHttpOnly(true) // hidden from JavaScript
.setSameSite(CookieSameSite.STRICT)
response.addCookie(cookie)Architecture
Clean, hexagonal (ports & adapters). Dependencies point inward; the domain knows nothing about detekt or MCP.
server.py MCP surface + composition root (knows MCP)
│
application/ use cases: scan / review_diff / secure_pattern
│
domain/ Finding, ScanResult, ports (pure vocabulary)
↑ implemented by
adapters/ DetektAnalyzer, JavaAnalyzer, RoutingAnalyzer,
SARIF & diff parsers, pattern catalogA RoutingAnalyzer sends each target to the analyzers that support it, so the
use cases treat "one language" and "many" identically. Adding a language = one
new adapter implementing the same LanguageAnalyzer port — the domain and use
cases do not change.
Requirements
Python 3.11+
Kotlin: a JDK + the detekt CLI jar + the ruleset jar(s)
Java: a JDK + the SpotBugs jar + the FindSecBugs plugin jar
Python: Bandit (
pip install "code-security-mcp[python]") — no JDK, no jarsC#: the .NET SDK (its Roslyn security analyzers are built in)
JS/TS: Node.js + ESLint with
eslint-plugin-security(andtypescript-eslint)
Each analyzer is optional and enabled independently — configure only the languages you need. (Python auto-enables whenever Bandit is installed.)
Configuration
./scripts/setup.sh fills these in for you and prints the ready-to-paste
command; the reference below is for when you want to point at your own tools.
The server locates its tools through environment variables:
Variable | Meaning |
| Path to the |
| Kotlin: detekt CLI ( |
| Kotlin: comma-separated ruleset jar(s) |
| Kotlin: (optional) path to a |
| Java: SpotBugs engine jar |
| Java: comma-separated plugin jar(s) (FindSecBugs) |
| Java: (optional) comma-separated dependency jars/dirs for more accurate analysis |
| C#: root of the .NET SDK install |
| C#: (optional) NuGet cache dir (keeps restores isolated) |
| C#: (optional) dotnet CLI home dir (keeps state isolated) |
| JS/TS: path to the ESLint executable |
| JS/TS: path to the security flat config (see |
Python needs no variables — install Bandit and it is used automatically.
Use with Claude Code
claude mcp add code-security -s user \
-e KSM_JAVA=/path/to/java \
-e KSM_DETEKT_CLI_JAR=/path/to/detekt-cli-<ver>-all.jar \
-e KSM_PLUGIN_JARS=/path/to/scanner-core.jar,/path/to/scanner-spring-boot.jar,... \
-- /path/to/.venv/bin/code-security-mcpThen ask the agent, e.g. "run security_scan on src/Main.kt" or "review_diff on my staged changes".
Development
python3 -m venv .venv
.venv/bin/pip install -e ".[dev]"
.venv/bin/pytestThe default suite is hermetic — it uses fake analyzers and hand-built SARIF / diff / Bandit-JSON fixtures, so it needs no external analyzer to run.
Integration tests run the real analyzers over examples/ and assert the
expected findings. They self-skip when a tool is not configured, so run them
once you have set up the analyzers (e.g. via ./scripts/setup.sh):
.venv/bin/pytest -m integrationRoadmap
Each new language arrives as its own native, framework-aware analyzer adapter (never a generic multi-language scanner):
✅ Kotlin — detekt + the 216-rule framework-aware ruleset.
✅ Java — SpotBugs + FindSecBugs.
✅ Python — Bandit.
✅ C# — Roslyn security analyzers.
✅ JavaScript / TypeScript — ESLint + eslint-plugin-security.
Deeper C# via Security Code Scan (taint analysis).
Zero-setup: auto-resolve the analyzer runtimes and rulesets.
License
MIT — see LICENSE.
Keywords: MCP server, Model Context Protocol, Kotlin security, JVM security, SAST, static analysis, detekt, Spring Security, AI coding agent, Claude Code, Cursor, secure coding.
Available Tools
1 toolsecurity_scanA
Scan Kotlin/JVM code for security issues using a 216-rule analyzer.
Point this at a file or directory. It returns every security finding the analyzer reports — rule id, message, location, and severity — so the agent can fix issues while writing, not after.
Args: path: File or directory to scan (absolute, or relative to the project).
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so the description must cover behavior. It mentions returning findings with details but does not explicitly state non-destructive nature or other behaviors like authentication. Adequate for a scanner.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with two sentences and an args line. Each sentence adds value: purpose, usage guidance, and parameter explanation. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given a simple tool with one parameter and no output schema, the description covers what the tool does, what it returns, and the parameter. It could mention handling of invalid paths or empty results, but overall complete.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The single parameter 'path' is explained in the description: 'File or directory to scan (absolute, or relative to the project).' This adds crucial meaning beyond the schema's type-only definition. Schema coverage is 0%, so description fully compensates.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it scans Kotlin/JVM code for security issues, specifies a 216-rule analyzer, and lists what it returns. The verb 'scan' and resource 'Kotlin/JVM code' are specific.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides usage context by saying 'Point this at a file or directory' and indicates it's intended for fixing issues while writing. No exclusions or alternatives are needed due to no siblings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
1 tool update
v0.1.0- First observed
security_scan
TDQS
With only one tool, there is no possibility of ambiguity between tools. The tool's purpose is clearly defined.
The single tool uses a clear verb_noun pattern (security_scan), which is consistent and predictable.
The server has only one tool, which is slightly under the typical range of 3-15 tools, but it effectively covers the core scanning functionality.
The tool provides comprehensive scanning for Kotlin/JVM security issues, but lacks additional features like configuration or rule management, which are minor gaps.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
MCP server for static security analysis of Android source code
Scan any public GitHub MCP-server repo for security issues. 37 MCP-specific L1 rules, 8 languages.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server that enables AI assistants to analyze Android APK and iOS IPA files for security issues through natural language conversation, including permission auditing, secret detection, and SDK enumeration.12424MIT
- AlicenseCqualityCmaintenanceA secure-by-default MCP server and CLI for AI agents to inspect Spring Boot repositories and interact with runtime Actuator endpoints, enabling code review, dependency scanning, and monitoring.44MIT
- AlicenseNot gradedqualityDmaintenanceAn MCP server that provides CVE-driven security prompts for code review, enabling coding agents to get actionable security checks based on real vulnerabilities.MIT
- AlicenseAqualityBmaintenanceAn MCP server that gives AI assistants the ability to check open-source packages for vulnerabilities, enrich findings with real-world exploit intelligence, and statically analyse whether vulnerable code is actually reachable in your project.31Apache 2.0
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/JasminGuberinic/code-security-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server