This is a Model Context Protocol (MCP) server that exposes the Kaspersky Security Center Web API as tools for LLMs.
- Async Architecture: Uses
anyioto wrap the synchronousKlAkOAPIlibrary. - Tools:
ksc_ping: Check connection.ksc_list_hosts: Find managed devices.ksc_get_host_details: Get device info.ksc_list_tasks: Enum tasks.ksc_run_task: Execute tasks.ksc_get_task_state: Check task status.
- Python 3.12+
uv(recommended)- KSC Server Credentials
- KlAkOAPI 15.1 package (included in
packages/)
- Clone the repository.
- Create a
.envfile in the root directory:KSC_HOST=https://your-ksc-server.com:13299 KSC_USERNAME=your_username KSC_PASSWORD=your_password KSC_VERIFY_SSL=false
- Install dependencies:
uv sync
uv run ksc-mcpOr directly:
uv run app/main.pyAdd the following to your claude_desktop_config.json:
{
"mcpServers": {
"ksc": {
"command": "uv",
"args": [
"--directory",
"C:\\path\\to\\ksc-mcp",
"run",
"ksc-mcp"
],
"env": {
"KSC_HOST": "https://your-ksc-server:13299",
"KSC_USERNAME": "user",
"KSC_PASSWORD": "password",
"KSC_VERIFY_SSL": "false"
}
}
}
}To add this server to the claude CLI:
claude mcp add ksc -- uv --directory C:\path\to\ksc-mcp run ksc-mcpNote: Ensure environment variables are set in your shell or the .env file is present in the working directory.
For tools that support MCP via command configuration:
Command: uv
Arguments:
--directoryC:\path\to\ksc-mcprunksc-mcp
This project uses uv for dependency management and ruff for linting.
- Install Dependencies:
uv sync- Note: This only installs packages. It does not run tests or linters.
- Run Server:
uv run ksc-mcp(ormake dev) - Run Tests:
uv run pytest(ormake test) - Lint & Fix:
uv run ruff check --fix .(ormake lint) - Format Code:
uv run ruff format .(ormake format)
For convenience, a Makefile is included:
make install
make dev
make test
make lint # Runs ruff check
make format # Runs ruff format- src/server/main.py: Entry point with tool auto-discovery.
- src/server/models.py: Pydantic models for strict schemas.
- src/server/ksc/: Core service logic (
KscService) wrappingKlAkOAPI. - src/server/tools/: Modular tool implementations (
hosts.py,tasks.py). - tests/:
pytestsuite.