Let your AI write Clean, and check it
The compiler includes an MCP server. Connect it once, and your AI assistant can look up the syntax, type-check its own code and fix errors before you ever see them.
command cln mcp-serverThe AI checks its work before you do
AI assistants guess at languages they haven't seen much. With the MCP server, they don't have to guess: they read the real syntax reference and run the real type checker.
Clean was designed for this. Its syntax is small and regular, its types are checked before code runs, and its errors say exactly what to fix. That gives an AI a tight loop: write, check, fix.
1. get_quick_reference learn the syntax
2. write the code
3. check type-check it
4. explain_error read what's wrong
5. fix and check again until it passes
6. compile produce WebAssemblyConnect your assistant
Install Clean
The MCP server is part of the compiler, so installing Clean is enough. See Install.
Print the settings for your tool
Pick your tool: claude-code, claude-desktop, cursor or vscode. The command prints the exact settings for your machine and says where to put them.
cln mcp-config --format claude-code{
"mcpServers": {
"clean-language": {
"command": "/home/you/.cleen/bin/cln",
"args": ["mcp-server"]
}
}
}Ask for something
Restart your assistant and ask it to write Clean code, for example "write a Clean function that averages a list of numbers, and check it". It will call the Clean tools on its own.
Tools the server offers
| Tool | What the assistant uses it for |
|---|---|
get_quick_reference | Learn the syntax, types and common patterns before writing |
check | Type-check code fast, without building |
compile | Build code into WebAssembly |
explain_error | Read a plain explanation of an error code and how to fix it |
diagnostics | Get every error and warning with its exact location |
parse | See how the compiler reads a piece of code |
get_specification | Look up the exact rules of the language |
list_functions, list_types, list_builtins | Find what's available instead of guessing |
list_plugins | Learn the Frame blocks for servers, data and pages |
list_error_codes | Browse every error the compiler can report |
Learn it step by step
Short lessons that build on each other. Each one ends with code you can run.
AI in your own apps
Give AI agents your app's tools
The frame.mcp plugin turns your Frame app into an MCP server, so agents can call its tools and read its data.
A map for AI crawlers
This site publishes llms.txt, a short guide AI tools read to find the docs.
Why Clean suits AI
The research behind the design: what makes a language easy for AI.
Common questions
Which assistants work with it?
Any assistant that supports MCP, the Model Context Protocol. That includes Claude Code, Claude Desktop, Cursor and VS Code.
Does my code leave my machine?
The MCP server runs locally and checks code on your machine. What your assistant sends to its own AI service is up to that assistant.
Do I need to start the server myself?
No. Your assistant starts cln mcp-server when it needs it, using the settings from cln mcp-config.
Can I learn Clean with an AI?
Yes. The last lesson of First Steps shows how: Your AI coding partner.
Want the app without the code?
Clean Studio is an AI that writes Clean for you. Describe the app, approve each change, and publish.