mcp-zig
Provides code completions, hover information, go-to-definition, and find-references for Zig projects via integration with the Zig Language Server (zls).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-zigShow me completions for this function"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
MCP Zig Server
MCP server providing Zig language features (completions, hover info, definitions, references) via integration with the Zig Language Server (zls).
Works with any MCP-compatible client: AI assistants, IDEs, or coding agents that support the Model Context Protocol.
Quick Setup
1. Install zls
# macOS/Linux
brew install zls
# Windows
scoop install zls
# Or download binary: https://github.com/zigtools/zls/releases2. Configure Your MCP Client
Add to your MCP settings file:
{
"mcpServers": {
"mcp-zig": {
"command": "npx",
"args": ["-y", "@dungngo4520/mcp-zig"],
"env": {
"WORKSPACE_ROOT": "/path/to/your/zig/project"
}
}
}
}Common config locations:
macOS:
~/Library/Application Support/<client>/config.jsonWindows:
%APPDATA%\<client>\config.jsonLinux:
~/.config/<client>/config.json
Replace <client> with your MCP client's name. Check your client's documentation for exact path.
3. Restart Your MCP Client
You'll have access to 4 new tools:
zig_complete- Code completionszig_hover- Symbol informationzig_goto_definition- Jump to definitionszig_find_references- Find all usages
Related MCP server: zig-mcp
Usage
Ask natural language questions about your Zig code:
"What does this function do?"
"Show me completions here"
"Where is this defined?"
"Find all usages of this symbol"
Your AI assistant automatically chooses the right tool.
Troubleshooting
Tools not showing up?
Verify
zlsis installed:zls --versionCheck the config file path for your MCP client
Restart your MCP client after config changes
Make sure
WORKSPACE_ROOTpoints to a valid Zig project
Contributing
git clone https://github.com/dungngo4520/mcp-zig.git
cd mcp-zig
npm install
npm run buildLicense
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Lean 4 MCP server: compile, prove theorems, and formalize math with Mathlib.
The official Svelte MCP server providing docs and autofixing tools for Svelte development
A MCP server built for developers enabling Git based project management with project and personal…
MCP Server for JFrog, providing tools for development and artifact management.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceAn MCP server that exposes Language Server Protocol features to external clients, allowing access to hover information, definitions, completions, references, and rename functionalities.9 npm40MIT
- FlicenseNot gradedqualityCmaintenanceMCP server for Zig that connects AI coding assistants to ZLS (Zig Language Server) via LSP. Provides 16 tools for code intelligence (hover, go-to-definition, references, completions, diagnostics, rename, format) and build/test operations.5-
- AlicenseNot gradedqualityCmaintenanceExposes Language Server Protocol (LSP) tools such as diagnostics, goto definition, find references, symbols, and rename as a stdio MCP server.7MIT
- AlicenseNot gradedqualityCmaintenanceProvides up-to-date Zig standard library and builtin function documentation via MCP tools, using local Zig installation or remote ziglang.org sources.25 npm170MIT