# Lugh

> Lugh is an open-source MCP server for ai models and llm tooling. Write, check and dry-run Lugh agent programs with policy, budgets and approvals. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Web
- **Website:** https://ashutosh3142857.github.io/lugh-lang/
- **Repository:** https://github.com/ashutosh3142857/lugh-lang/tree/HEAD/npm
- **MCP Registry name:** io.github.Ashutosh3142857/lugh
- **Categories:** AI models and LLM tooling, developer tools
- **Listing updated:** 2026-11-15

## About

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.

## Features

- **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

## Install

### Claude Code (Terminal)

```sh
claude mcp add lugh -- npx -y lugh-lang
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "lugh": {
      "command": "npx",
      "args": [
        "-y",
        "lugh-lang"
      ]
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "lugh": {
      "command": "npx",
      "args": [
        "-y",
        "lugh-lang"
      ]
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "lugh": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "lugh-lang"
      ]
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "lugh": {
      "command": "npx",
      "args": [
        "-y",
        "lugh-lang"
      ]
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "lugh": {
      "command": "npx",
      "args": [
        "-y",
        "lugh-lang"
      ]
    }
  }
}
```

## Tools

- `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.

## 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

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github-2): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [Ouroboros](https://ai-powered.com/mcp/ouroboros): Ouroboros is an open-source MCP server for developer tools.
- [Claude Code Ultimate Guide](https://ai-powered.com/mcp/claude-code-ultimate-guide): Claude Code Ultimate Guide is an open-source MCP server for ai models and llm tooling.
- [Concord MCP](https://ai-powered.com/mcp/concord-mcp): Concord MCP is a freemium MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/lugh
