Lugh
Write, check and dry-run Lugh agent programs with policy, budgets and approvals
- Pricing
- Open source
- Platforms
- CLI, Web
- Runs
- Locally
- Version
- 0.7.1
- Listing updated
- 2 days ago
About Lugh
Lugh is an open-source MCP server for ai models and llm tooling. It runs locally on your machine and is started by your AI client.
Lugh is a programming language for AI agents. A program declares which systems the agent may touch with use, its limits with budget, and which actions need a person with policy. Each action is typed as read, write, send, submit, spend, delete or execute and checked before it runs.
This MCP server lets an assistant write a Lugh program for a task, check it, dry-run it and show you the policy log before anything real happens. The npm package runs Lugh Core compiled to WebAssembly in a sandbox where fs, http, mcp and shell act on a simulated world, but every call passes the real policy gate. Running for real requires installing the Rust Lugh Core, which asks approvals in a terminal or web inbox and keeps an audit log.
The package is MIT licensed, and a browser playground is available.
Install
Run in a terminal
claude mcp add lugh -- npx -y lugh-langAdd to claude_desktop_config.json
{
"mcpServers": {
"lugh": {
"command": "npx",
"args": [
"-y",
"lugh-lang"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"lugh": {
"command": "npx",
"args": [
"-y",
"lugh-lang"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"lugh": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"lugh-lang"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"lugh": {
"command": "npx",
"args": [
"-y",
"lugh-lang"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"lugh": {
"command": "npx",
"args": [
"-y",
"lugh-lang"
]
}
}
}Tools this server provides (5)
Taken from the project documentation; the running server may differ.
- lugh_reference
- Language reference.
- lugh_check
- Compiles a program without running it.
- lugh_run
- Runs goals and prints the policy log.
- lugh_test
- Runs test blocks.
- lugh_sandbox
- Shows what the simulated world contains.
What it does
- Typed actions
- Every action is read, write, send, submit, spend, delete or execute.
- Policy gate
- Declared policy decides what needs approval.
- Budgets
- Programs set limits on what an agent may use.
- Sandboxed dry runs
- Simulated files, APIs and shell with real checks.
- Test blocks
- Run tests and decline approvals to see outcomes.
- Browser playground
- Try programs without installing.
Good for
- Preview what an agent would do before it acts
- Write approval rules for spend or delete actions
- Test an agent program with every approval declined
- Show a person the policy log first
Pricing
Open source
MIT licensed
Prices change. Check ashutosh3142857.github.io before you buy.
Lugh FAQ
Does it touch real files?
Not in the npm package; it acts on a simulated world.
How do I run it?
npx lugh-lang mcp for the server.
What licence?
MIT.
How do I run for real?
Install Lugh Core (Rust) from the repository.
Is Lugh free?
Yes. Lugh is open source, so you can use and self-host it for free.
How do I add Lugh to Claude Code?
Run this command in your terminal: claude mcp add lugh -- npx -y lugh-lang
What are the best alternatives to Lugh?
The closest alternatives to Lugh are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to Lugh

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools