# zshref

> zshref is an open-source MCP server for developer tools. Offline zsh syntax reference as a CLI and MCP server for terminals and AI agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, Linux, macOS, Windows, Self-hosted
- **Repository:** https://github.com/carlwr/zsh-lexicon/tree/HEAD/crates/zshref
- **MCP Registry name:** io.github.carlwr/zshref-mcp
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-20

## About

zshref answers questions about zsh syntax without touching a shell. Options, builtins, redirections, parameter expansion, prompt escapes and ZLE widgets are parsed from upstream zsh documentation into typed records, so lookups return structured JSON rather than text scraped from the man page.

The same parsed reference is exposed two ways: a command-line tool that prints one compact JSON line per call, and an MCP server that AI clients can launch over stdio. Lookups normalize input forms such as NO_* option negation, single-letter option flags and case differences, and results flag when a match came through a lossy normalization.

It is aimed mainly at scripts and agent pipelines that need exact zsh documentation. The tool makes no network calls, runs no subprocesses and writes no files, and it is distributed as a single binary or through npm. It is still in alpha, with stable install docs not yet published.

## Features

- **Structured reference records:** Each syntax element is stored as a typed record parsed from upstream zsh documentation.
- **Offline lookups:** Queries run entirely locally with no network access or shell execution.
- **Fuzzy search and listing:** Find elements by partial name and enumerate records within a category.
- **JSON output for pipelines:** CLI output is compact JSON on stdout, suitable for piping into jq or other tools.
- **MCP server over stdio:** Three tools for docs, search and list can be added to MCP clients with a single config entry.
- **Normalized key resolution:** Handles NO_* negation, single-letter option flags and redirection forms when resolving keys.

## Good for

- Look up what a zsh option such as AUTO_CD does while writing a script
- Let an AI coding agent check zsh syntax without running a shell
- Search the zsh manual for builtins or reserved words by partial name
- Pipe documented zsh element details into other command-line tooling
- Provide zsh reference lookups in air-gapped or minimal container environments

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add zshref-mcp -- npx -y @carlwr/zshref-mcp
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

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

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add zshref-mcp -- npx -y @carlwr/zshref-mcp
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.zshref-mcp]
command = "npx"
args = ["-y", "@carlwr/zshref-mcp"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user zshref-mcp npx -- -y @carlwr/zshref-mcp

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

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

```json
{
  "mcpServers": {
    "zshref-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@carlwr/zshref-mcp"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 2 of 3 tools read data; 1 name doesn't say. From the server's own tool labels and tool names; not verified by us.

- `zsh_docs`: Look up the docs for a zsh key, with optional category.
- `zsh_search` (name suggests: reads): Fuzzy discovery of zsh elements by name, with optional category and limit.
- `zsh_list` (name suggests: reads): Enumerate zsh reference records, optionally filtered by category.

## FAQ

### Does zshref run any shell commands or access the network?

No. It has no shell execution, subprocesses, network access or filesystem writes, and the MCP server reads no environment variables.

### How is zshref installed?

It can be run with npx -y @carlwr/zshref-mcp, installed globally from npm as @carlwr/zshref, installed with cargo binstall or cargo install for alpha versions, or built from source.

### Which MCP tools does the server provide?

zsh_docs looks up documentation for a key, zsh_search performs fuzzy name discovery, and zsh_list enumerates records, optionally filtered by category.

### Is zshref ready for production use?

The project describes itself as pre-release alpha, and stable installation documentation is not yet available.

### Is zshref free?

Yes. zshref is open source, so you can use and self-host it for free.

### How do I add zshref to Claude Code?

Run this command in your terminal: claude mcp add zshref-mcp -- npx -y @carlwr/zshref-mcp

### What are the best alternatives to zshref?

The closest alternatives to zshref are Ref Tools MCP, Zread MCP, Ref Tools MCP, Llmref and Zephex.

## Where this comes from

- Description: written from the project's README and its MCP Registry entry.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Ref Tools MCP](https://ai-powered.com/mcp/ref-tools-mcp-2): Ref Tools MCP is an MCP server for developer tools.
- [Zread MCP](https://ai-powered.com/mcp/zread-mcp): Zread MCP is an open-source MCP server for developer tools.
- [Ref Tools MCP](https://ai-powered.com/mcp/ref-tools-mcp): Ref Tools MCP is an MCP server for developer tools.
- [Llmref](https://ai-powered.com/mcp/llmref): Llmref is a free MCP server for developer tools.
- [Zephex](https://ai-powered.com/mcp/zephex): Zephex is a freemium MCP server for developer tools.
- [DevShelf Developer Directory & Tool Discovery MCP Server](https://ai-powered.com/mcp/devshelf-developer-directory-and-tool-discovery-mcp-server): DevShelf Developer Directory & Tool Discovery MCP Server is an open-source MCP server for developer tools.
- [Jarvis](https://ai-powered.com/mcp/jarvis): Jarvis 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.

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