Ludus MCP Server
A Model Context Protocol server that enables natural language control of Ludus cybersecurity training environments, allowing users to deploy, manage, and configure virtualized security training ranges.
README
Ludus MCP Server
Model Context Protocol server for managing Ludus cybersecurity training environments through natural language commands.
Prerequisites
System Requirements
- Node.js 18.0.0 or higher
- npm package manager
- Ludus CLI binary installed and in PATH
- Active Ludus server environment
- Network connectivity to Ludus server via WireGuard VPN or SSH
Ludus Server Access
Ensure you have:
- Ludus server SSH access credentials
- Ludus API key (obtain via
ludus user apikeycommand) - WireGuard configuration file OR SSH tunnel capabilities (obtain wireguard conf from Ludus CLI)
- Admin or user account on Ludus server. Non admin will be limited in same ways as using ludus cli with non admin account.
Installation
Global Installation (Recommended) (not yet pushed to NPM - will not work for now. clone repo and install from source as long as this message is up)
Install the package globally to make the ludus-mcp command available system-wide:
npm install -g ludus-mcp
ludus-mcp --setup-keyring
What happens during installation:
- Downloads source code and dependencies
- Compiles native dependencies (
keytar) for your platform (Windows/Linux/macOS) - Builds TypeScript source to JavaScript (
src/→dist/) - Creates global
ludus-mcpcommand in your PATH
This is a one-time installation process that compiles everything for your specific platform.
From Source (Development)
git clone https://github.com/NocteDefensor/LudusMCP.git
cd LudusMCP
From within LudusMCP directory
npm install # Installs dependencies and builds automatically
npx ludus-mcp --setup-keyring # Use npx for local from source installations by running it from within clone/install directory
Installation Requirements
The package includes native dependencies that require compilation during installation:
- Build tools: Node.js build tools (automatically installed)
- Platform libraries: OS credential manager libraries (Windows Credential Manager, macOS Keychain, Linux libsecret)
If installation fails, ensure you have proper build tools for your platform.
Configuration
Initial Setup
Run the setup wizard to configure credentials securely: (from within cloned directory if installing from source)
npx ludus-mcp --setup-keyring
The setup wizard will prompt for:
- Connection Method: WireGuard VPN or SSH tunnel
- Ludus Admin Username: Your Ludus admin account
- API Key: Ludus API key from
ludus user apikeycommand - SSH Credentials: Host, username, and authentication method
- WireGuard Config: Path to .conf file (if using WireGuard)
Credentials are stored securely in your OS credential manager (Windows Credential Manager, macOS Keychain, Linux Secret Service).
Update Credentials (from within cloned directory if installing from source)
To modify existing credentials:
npx ludus-mcp --renew-keyring
Connection Methods
WireGuard VPN (Recommended)
- Direct connection to Ludus server for non admin functions via VPN tunnel
- Requires WireGuard client and configuration file
- Must be manually started before using MCP client
SSH Tunnel
- Port forwarding through SSH connection
- Fallback option when WireGuard unavailable
- Automatically managed by MCP server
- SSH tunnel will always be used for ADMIN API
MCP Client Integration
Setup Process Overview
- Install Package (one-time) - Compiles for your platform
- Configure Credentials (one-time) - Run setup wizard
- Configure MCP Client (one-time) - Add to client config
- Daily Usage - Start MCP client, server auto-connects
Claude Desktop Configuration
For Global Installation:
Add to your ~/.claude_desktop_config.json:
{
"mcpServers": {
"ludus": {
"command": "ludus-mcp"
}
},
"isUsingBuiltInNodeForMcp": false
}
Development/Source Installation
If running from source:
{
"mcpServers": {
"ludus": {
"command": "node",
"args": ["/path/to/LudusMCP/dist/server.js"]
}
},
"isUsingBuiltInNodeForMcp": false
}
Usage
Normal Operation
When you start your MCP client (Claude Desktop), it automatically:
- Launches the pre-compiled
ludus-mcpserver - Server loads credentials from OS keyring
- Downloads fresh configurations from GitHub
- Downloads updated schemas and documentation
- Tests connectivity to Ludus server
- Starts MCP protocol for tool communication
No manual server startup required - your MCP client handles everything.
Manual Server Testing (Optional)
For troubleshooting or testing the server independently:
ludus-mcp # If globally installed
# OR
npx ludus-mcp # run from cloned directory if locally installed
Server Startup Process:
- Load Credentials - Retrieves stored credentials from OS keyring
- Download Assets - Updates base configurations, schemas, and documentation from GitHub
- Connectivity Test - Verifies connection to Ludus server via WireGuard/SSH
- MCP Protocol - Starts Model Context Protocol server for tool communication
Available Prompts
create-ludus-range Complete guided workflow for range creation from requirements to deployment.
execute-ludus-cmd Safe execution of Ludus CLI commands with destructive action protection.
- To use prompts with Claude Desktop hunt for the "plus" + button near your chat bar.
- Click "add from ludus and you will see both prompts. Select the one you want.
<img width="1056" height="216" alt="image" src="https://github.com/user-attachments/assets/617b9205-2dc3-4e1e-8663-90fb9857b3cf" />
Available Tools
Range Management
deploy_range- Deploy virtualized training environmentget_range_status- Check deployment status and VM stateslist_user_ranges- List all ranges for userget_connection_info- Download RDP/VPN connection filesdestroy_range- Permanently delete range and VMsrange_abort- Stop stuck deploymentsludus_power- Start/stop range VMs
Configuration Management
read_range_config- Read configuration fileswrite_range_config- Create/modify range configurationsvalidate_range_config- Validate YAML syntax and schemalist_range_configs- Browse available templatesget_range_config- Get currently active configurationset_range_config- Set active configuration for deployment
Documentation & Research
ludus_docs_search- Search Ludus documentationludus_range_planner- Intelligent range planning assistantludus_roles_search- Search available Ludus rolesludus_environment_guides_search- Find environment setup guidesludus_networking_search- Network configuration helpludus_read_range_config_schema- View configuration schemaludus_range_config_check_against_plan- Validate against requirementsludus_read_role_collection_schema- View role schemas
Utility & Administration
ludus_cli_execute- Execute arbitrary Ludus CLI commandsludus_help- Get help for Ludus commandslist_all_users- List all Ludus users (admin only)get_credential_from_user- Securely collect credentialsinsert_creds_range_config- Inject credentials into configurations (note: the LLM doesn't actually interact with OS credential management/keyring at all. It passes the name the credential is stored under to the function. The function retrieves the credential and replaces placeholder with cred.
Recommended Workflow
-
Plan Your Range Use the
create-ludus-rangeprompt for guided range creation:Requirements: "AD environment with SCCM and 3 workstations" -
Review Configuration Use
list_range_configsto see available templates andread_range_configto examine them. -
Validate Before Deployment Always run
validate_range_configbefore setting configuration. -
Set Active Configuration Use
set_range_configto make configuration active for deployment. -
Deploy Range Use
deploy_rangeto create the virtualized environment. -
Get Connection Info Use
get_connection_infoto download RDP files and access VMs.
Extensive or Advanced CLI Operations
For operations not covered by specific tools, use the execute-ludus-cmd prompt:
Command Intent: "Check detailed logs for deployment issues"
File Locations
Configuration files and data are stored in ~/.ludus-mcp/:
~/.ludus-mcp/
├── range-config-templates/
│ └── base-configs/ # GitHub templates (auto-updated)
├── schemas/ # JSON schemas (auto-updated)
│ ├── ludus-roles-collections-schema.json
│ └── range-config.json
└── ludus-docs/ # Cached documentation (auto-updated)
├── environment-guides/
├── quick-start/
└── troubleshooting/
All files are automatically downloaded and updated on server startup.
Security
- This is for lab use only. Security is marginal. Some attempts have been made to limit OS command injection or path traversal. Additionally, credentials are handled via OS credential manager.
Credential Management
- External service credentials (API keys, SaaS tokens) use placeholder format:
{{LudusCredName-<user>-<name>}} - Range-internal credentials (AD passwords, domain accounts) included directly
- All credentials stored in OS credential manager
- Secure dialogs for credential collection
Network Security
- WireGuard VPN encryption for server communication
- SSH tunnel fallback with key-based authentication
- SSL certificate verification (configurable)
Operational Safety
- Destructive operations require explicit confirmation
- Automatic validation of configurations before deployment
- Comprehensive logging and error handling
Troubleshooting
Connection Issues
- Verify WireGuard tunnel is active:
wg show - Test SSH connectivity:
ssh user@ludus-host - Check API key:
ludus --url https://your-server:8080 version
Configuration Problems
- Run
validate_range_configto check syntax - Use
ludus_read_range_config_schemato verify structure - Check logs for specific error messages
Credential Issues
- Re-run setup:
npx ludus-mcp --renew-keyring - Verify OS credential manager access
- Check file permissions on WireGuard config
Common Errors
- "No configuration available": Run
--setup-keyring - "Range operations connectivity failed": Check WireGuard/SSH
- "Schema validation failed": Use
validate_range_configtool
Help
For additional help:
- Use
ludus_helptool for Ludus CLI documentation - Use
ludus_docs_searchfor comprehensive guides - Review generated configurations with
read_range_config - Check GitHub repository for issues and updates
References:
- Ludus Documentation - https://docs.ludus.cloud/docs/intro
Coming Changes
- May switch to Desktop Extension setup vs the current homegrown keyring config/renew functions.
- Will add more sample reference templates.
- Will attempt to keep up with new roles by adding them to the schema for LLM reference.
Credits
- Ludus - @badsectorlabs
- Claude - Wouldn't quite call this project vibe coding but maybe 4 beers deep in the passenger seat shouting out navigation commands.
- Reddit MCP channel for lots of researching
- MCP documentation - https://modelcontextprotocol.io/introduction
- Anthropic MCP docs - https://docs.anthropic.com/en/docs/agents-and-tools/mcp-connector
- MCP in VS Code - https://code.visualstudio.com/docs/copilot/chat/mcp-servers
License
Creative Commons Attribution ShareAlike 4.0
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。