Getting Started with ChaosNexus Anvil
ChaosNexus Anvil is the high-performance Rust engine and Model Context Protocol (MCP) server that powers the backend of ChaosNexus. It is responsible for executing the Rhai scripts that interact with your local system.
Prerequisites
Before building ChaosNexus Anvil, ensure you have the following installed:
- Rust and Cargo: The official Rust toolchain.
- C/C++ Build Tools: Required for compiling certain native extensions.
Note: ChaosNexus Anvil is designed to run efficiently on Linux (including CachyOS/Arch), macOS, and Windows.
Building from Source
Currently, the primary way to use ChaosNexus Anvil is to build it directly from the source code.
Clone the Repository:
bashgit clone <your-repo-url> cd chaosnexus-anvilBuild the Engine:
bashcargo build --releaseThe compiled binary will be located at
target/release/anvil.
Running the Server
ChaosNexus Anvil operates as an MCP server. By default, when started, it communicates over standard I/O (stdio) which allows AI tools like Claude Desktop or Cursor to interface directly with it.
./target/release/anvil --scripts-dir /path/to/your/scriptsIf you do not specify a --scripts-dir, it will attempt to use a default chaosnexus-scripts/ directory relative to the binary or your current working directory (monorepo layout). Override with scripts_dir in host TOML.
Connecting to an LLM
To allow your AI assistant to run local scripts, you need to configure your AI client to spawn the ChaosNexus Anvil MCP server.
Claude Desktop Configuration
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"chaosnexus-anvil": {
"command": "/absolute/path/to/chaosnexus-anvil/target/release/anvil",
"args": ["--scripts-dir", "/absolute/path/to/your/scripts"]
}
}
}Cursor Configuration
In Cursor, go to Settings > Features > MCP, and add a new server using the exact absolute path to your chaosnexus-anvil binary.
Next Steps
- Learn how to write scripts in the Rhai API Reference.
- Understand how to configure the engine in the Configuration Guide.