Model Context Protocol (MCP) server for Dharma grammar-based fuzzing. This server exposes Dharma’s grammar-based test case generation capabilities via MCP, enabling integration with tools like Claude Desktop.
Transport: stdio (no HTTP server).
| Tool | Description |
|---|---|
dharma_generate |
Generate test cases using a Dharma grammar file located on the server. |
dharma_generate_custom |
Generate test cases from a custom Dharma grammar provided as a string. Useful for dynamically generated grammars or quick testing without saving files. |
docker build -t dharma-mcp .docker run --rm -i dharma-mcpMount your grammar files under /app/grammars and collect generated outputs under /app/output:
docker run --rm -i \
-v /path/to/grammars:/app/grammars\:ro \
-v /path/to/output:/app/output \
dharma-mcpTo integrate with Claude Desktop, add the following to your configuration:
{
"mcpServers": {
"dharma": {
"command": "docker",
"args": [
"run", "--rm", "-i",
"-v", "/path/to/grammars:/app/grammars\:ro",
"-v", "/path/to/output:/app/output",
"dharma-mcp\:latest"
]
}
}
}| Variable | Default | Description |
|---|---|---|
DHARMA_GRAMMAR_DIR |
/app/grammars |
Directory containing Dharma grammar files. |
Generate 10 test cases using the grammar at /app/grammars/json.dg
Run dharma_generate_custom with grammar_content="<grammar content here>" and count=5
Run dharma_generate with grammar_path=/app/grammars/json.dg and count=5