# mort-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/0xmortuex/mort-mcp  
**GitHub Stars:** 0  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mort-mcp

## Description
Write, type-check and run Mort code, with language spec and stdlib lookup.

## Tools
Capabilities this server exposes over MCP:

- **mort_check** — Type-check `source` text or `files` without building. Fast, and needs no C compiler. Returns diagnostics as `file:line:col` with the source line.
- **mort_run** — Compile and run, with `stdin`, `args` and a timeout. Reports output and exit code.
- **mort_emit_c** — Show the generated C. `freestanding=True` shows the kernel-mode output.
- **mort_format** — Format with the official formatter (`mortc fmt`).
- **mort_std** — List std modules, or show one module's public API: exact signatures, struct fields and doc comments.
- **mort_docs** — Search the language specification and reference docs, e.g. "resource struct cleanup" or "integer overflow".
- **mort_examples** — List or read the compiler's example programs.
- **mort_version** — Compiler and language version, and where the compiler was found.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "mort-mcp": {
    "command": "uvx",
    "args": ["mort-mcp"],
    "env": {
      "MORT_HOME": ""
    }
  }
}
```

**Requires environment variables:** `MORT_HOME` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What mort-mcp MCP server does

The mort-mcp MCP server connects an MCP-capable agent to the Mort compiler and its supporting documentation. Mort is a statically typed systems language that compiles to C and is used for MORT OS. The server is designed to give an agent reliable feedback instead of requiring it to infer Mort syntax or APIs from another language.

It can validate source text or files, compile and execute programs, display generated C, apply the official formatter, inspect standard-library APIs, search reference documentation, read compiler examples, and report compiler and language versions. The tools use the installed compiler and expose information tied to that compiler version.

## How it works

Each tool runs `mortc` through its command-line interface. Type checking does not build the program or require a C compiler, making `mort_check` suitable for quick iteration. Its diagnostics include the file, line, and column together with the relevant source line.

`mort_run` compiles and executes a program. Inputs can include standard input, command-line arguments, and a timeout, and the result includes program output and its exit code. `mort_emit_c` exposes the generated C; setting `freestanding=True` requests the kernel-mode output. `mort_format` delegates formatting to `mortc fmt`.

Reference tools read information from the compiler installation. `mort_std` can list modules or show a module's public functions, structure fields, signatures, and documentation comments. `mort_docs` searches the language specification and reference material, while `mort_examples` lists or reads compiler example programs.

## Setup and configuration

The Mort compiler is required. The documented setup clones the Mort repository, installs `mort-mcp` and `ziglang`, and registers the command with an MCP client while setting `MORT_HOME` to the Mort checkout. The `ziglang` package is used for the C backend needed by `mort_run`.

If `MORT_HOME` is not set, the server looks for `mortc` on the executable path; the documented alternative installs the compiler directly from the Mort repository. Checking, running, and standard-library lookup work with that path-based arrangement. The documentation search and example tools require a Mort checkout, so they are not available through the minimal path-only setup.

## Tools and capabilities

- `mort_check`: type-checks source text or files and returns precise diagnostics.
- `mort_run`: compiles and runs Mort with optional standard input, arguments, and timeout.
- `mort_emit_c`: displays generated C, including freestanding output when requested.
- `mort_format`: formats code with the official Mort formatter.
- `mort_std`: lists standard modules or displays a module's public API.
- `mort_docs`: searches the language specification and reference documentation.
- `mort_examples`: lists or reads compiler examples.
- `mort_version`: reports compiler and language versions and the compiler location.

## Limitations and notes

A compiler installation is necessary for the server to operate. Without `MORT_HOME`, `mortc` must be available on the executable path. The checkout-dependent documentation and examples require more than that path-only installation. Results reflect the compiler, standard-library signatures, and documentation available in the configured installation, so changing compiler versions can change the reference information returned.

_Full upstream README: https://allmcps.com/mcp/mort-mcp/readme_

