The Cure programming language now includes a Model Context Protocol (MCP) server that enables AI assistants to interact with the Cure compiler and toolchain.
The Model Context Protocol (MCP) is an open standard that allows AI assistants like Claude to:
- Access specialized tools and compilers
- Retrieve language-specific documentation
- Analyze code structure
- Provide intelligent assistance for domain-specific languages
The Cure MCP server provides AI assistants with:
cd /opt/Proyectos/Ammotion/cure
rebar3 get-deps
rebar3 compile
Edit your Claude configuration file:
- Linux: ~/.config/Claude/claude_desktop_config.json
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"cure": {
"command": "/path/to/cure/mcp/cure-mcp-server.sh",
"args": []
}
}
}
Close and reopen Claude Desktop completely.
Ask Claude questions about Cure:
- "Show me how to define an FSM in Cure"
- "Validate this Cure code: module Test do ... end"
- "What functions are available in Std.List?"
- "Compile examples/06_fsm_traffic_light.cure"
| Tool | Description |
|---|---|
compile_cure |
Compile Cure source to BEAM bytecode |
parse_cure |
Parse code and return AST information |
type_check_cure |
Type-check code for errors |
validate_syntax |
Quick syntax validation |
get_ast |
Get detailed AST representation |
analyze_fsm |
Analyze FSM definitions |
get_syntax_help |
Language syntax reference |
get_examples |
Example code by category |
get_stdlib_docs |
Standard library documentation |
Comprehensive documentation available in mcp/:
- README.md - Complete user guide
- QUICKSTART.md - 5-minute setup guide
- ARCHITECTURE.md - Technical architecture details
User: Is this Cure code valid?
module Calculator do
def add(x: Int, y: Int): Int = x + y
end
Claude will use the validate_syntax tool and report results.
User: Show me FSM examples in Cure
Claude will use get_examples with category "fsm" to retrieve FSM example code.
User: Compile the traffic light example
Claude will use compile_cure on the FSM traffic light example.
The MCP server is implemented in Erlang and integrates directly with the Cure compiler:
Claude Desktop ←→ JSON-RPC ←→ cure_mcp_server.erl ←→ Cure Compiler
(stdio) (modules)
Key Components:
- cure_mcp_server.erl - Main MCP protocol implementation
- cure-mcp-server.sh - Startup script with dependency checking
- Tool handlers - Direct integration with compiler modules
Test the MCP server:
cd mcp
./test_mcp.sh
This runs basic tests for:
- Protocol initialization
- Tool listing
- Syntax help
- Code validation
erl -versionrebar3 get-depsmake clean && make allEnsure all Cure modules are compiled:
cd /opt/Proyectos/Ammotion/cure
make all
The MCP server is extensible. To add new tools:
handle_tools_list/2init_state/1See ARCHITECTURE.md for details.
Planned improvements:
- Code formatting tool
- Multi-file project analysis
- Interactive debugging support
- Test generation tools
- Performance profiling integration
MIT License - same as the Cure language project.