mcp-server-zig

mcp-server-zig

Provides Zig language intelligence for Claude Code by wrapping ZLS (Zig Language Server) and exposing 8 tools for diagnostics, formatting, hover info, go-to-definition, references, completions, document symbols, and building.

Category
Visit Server

README

mcp-server-zig

MCP server that provides Zig language intelligence for Claude Code. Wraps ZLS (Zig Language Server) and exposes 8 tools for diagnostics, formatting, hover info, go-to-definition, references, completions, document symbols, and building.

Prerequisites

  • Node.js >= 18
  • Zig compiler on PATH (zig version)
  • ZLS on PATH (zls --version)
# macOS
brew install zig zls

# Or download from:
# https://ziglang.org/download/
# https://github.com/zigtools/zls/releases

Installation

Add to Claude Code:

claude mcp add --transport stdio mcp-server-zig -- npx -y mcp-server-zig

Or from source:

git clone https://github.com/sadopc/mcp-server-zig.git
cd mcp-server-zig
pnpm install && pnpm build
claude mcp add --transport stdio zig -- node $(pwd)/build/index.js

Tools

zig_diagnostics

Get errors and warnings for a Zig source file.

Parameter Type Description
file_path string Absolute path to the .zig file

zig_format

Format Zig code using zig fmt.

Parameter Type Description
file_path string? Path to .zig file to format in-place
code string? Zig source code string to format

Provide either file_path or code, not both.

zig_hover

Get type information and documentation for a symbol at a position.

Parameter Type Description
file_path string Absolute path to the .zig file
line number Zero-based line number
character number Zero-based character offset

zig_definition

Go to definition — find where a symbol is defined.

Parameter Type Description
file_path string Absolute path to the .zig file
line number Zero-based line number
character number Zero-based character offset

zig_references

Find all references to a symbol.

Parameter Type Description
file_path string Absolute path to the .zig file
line number Zero-based line number
character number Zero-based character offset

zig_completions

Get completion suggestions at a position.

Parameter Type Description
file_path string Absolute path to the .zig file
line number Zero-based line number
character number Zero-based character offset
limit number? Max completions to return (default: 20)

zig_document_symbols

Get the document symbol outline (functions, structs, variables, etc.).

Parameter Type Description
file_path string Absolute path to the .zig file

zig_build

Run zig build in a project directory.

Parameter Type Description
project_path string Path to project directory (containing build.zig)
args string[]? Additional args for zig build

How It Works

Claude Code ←(MCP/stdio)→ mcp-server-zig ←(LSP/stdio)→ ZLS subprocess
                                          ←(shell exec)→ zig fmt / zig build
  • ZLS tools (diagnostics, hover, definition, references, completions, symbols): The server spawns ZLS as a subprocess, communicates via LSP over stdio. ZLS is started lazily on first tool call and auto-restarts on crash.
  • CLI tools (format, build): These call zig fmt and zig build directly — no ZLS needed.

Troubleshooting

"ZLS spawn error" — ZLS is not installed or not on PATH. Run which zls to verify.

"zig fmt failed" — Zig compiler is not installed or not on PATH. Run which zig to verify.

Diagnostics are empty — ZLS needs time to analyze the file. The server waits 200ms by default. For large projects, diagnostics may take longer to appear.

Tools hang — Check that ZLS is compatible with your Zig version. ZLS and Zig versions should match.

License

MIT

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured