OZ

opensvm/zig-mcp-server

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

52 stars 10 forks 质量 71 趋势 13MIT

opensvm/zig-mcp-server 是从 https://github.com/opensvm/zig-mcp-server. 导入的 MCP 服务器候选

概览

opensvm/zig-mcp-server 是从 https://github.com/opensvm/zig-mcp-server. 导入的 MCP 服务器候选

概述(AI 翻译)

现代Zig AI 10倍开发助手,支持全面的构建系统

强大的模型上下文协议(MCP)服务器,提供全面的Zig语言支持,包括现代构建系统支持、代码优化和最佳实践指导。

🚀 v0.2.0+ 的新内容

  • ** 🏗️ Zig 0.15.2+ 支持**:已完全更新,采用现代b.path()和root_module模式
  • ** 📦 增强模块系统**:支持最新模块系统,支持root_module.addImport()
  • ** 🔄 迁移指南**:对遗留模式的自动检测和升级建议
  • ** 🔧 增强代码分析**:改进优化建议和现代模式检测
  • ** 🧪 综合测试**:85+个测试案例,包含全覆盖报告
  • ** ⚡ 更好的代码质量**:修复了所有TypeScript编译错误和线条问题
  • ** 📚 扩展文档**:完整的Zig 0.15.2+构建系统指南及迁移提示

🛠️ 特色

🏗️ 构建系统工具(全新!)

1.构建系统生成(generate_build_zig)

生成带有Zig 0.15.2+模式的现代build.zig文件:

  • 支持最新的目标选项的交叉编译
  • 现代依赖管理,带构建。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Zig MCP Server

Modern Zig AI 10x dev assistant with comprehensive build system support

A powerful Model Context Protocol (MCP) server that provides comprehensive Zig language assistance, including modern build system support, code optimization, and best practices guidance.

🚀 What’s New in v0.2.0+

  • 🏗️ Zig 0.15.2+ Support: Fully updated with modern b.path() and root_module patterns
  • 📦 Enhanced Module System: Support for latest module system with root_module.addImport()
  • 🔄 Migration Guidance: Automated detection and upgrade suggestions for legacy patterns
  • 🔧 Enhanced Code Analysis: Improved optimization suggestions and modern pattern detection
  • 🧪 Comprehensive Testing: 85+ test cases with full coverage reporting
  • ⚡ Better Code Quality: Fixed all TypeScript compilation errors and linting issues
  • 📚 Extended Documentation: Complete Zig 0.15.2+ build system guide with migration tips

🛠️ Features

🏗️ Build System Tools (NEW!)

1. Build System Generation (generate_build_zig)

Generate modern build.zig files with Zig 0.15.2+ patterns:

  • Cross-compilation support with latest target options
  • Modern dependency management with build.zig.zon
  • Test and documentation integration
  • Enhanced module system support

2. Build System Analysis (analyze_build_zig)

Analyze existing build files and get modernization recommendations:

  • Detect deprecated patterns
  • Suggest Zig 0.15.2+ alternatives
  • Identify missing best practices
  • Module system migration guidance

3. Dependency Management (generate_build_zon)

Generate build.zig.zon files for modern package management:

  • Popular Zig packages catalog
  • Version management guidance
  • Best practices documentation

Features

Tools

1. Code Optimization (optimize_code)

Enhanced with modern Zig patterns and build mode analysis:

  • Debug, ReleaseSafe, ReleaseFast, ReleaseSmall
  • Modern optimization suggestions
  • Zig 0.12+ pattern recommendations
// Example usage
{
  "code": "const std = @import(\"std\");\n...",
  "optimizationLevel": "ReleaseFast"
}

2. Compute Units Estimation (estimate_compute_units)

Estimates computational complexity and resource usage of Zig code:

  • Memory usage analysis
  • Time complexity estimation
  • Allocation patterns detection
// Example usage
{
  "code": "const std = @import(\"std\");\n..."
}

3. Code Generation (generate_code)

Generates Zig code from natural language descriptions with support for:

  • Error handling
  • Testing
  • Performance optimizations
  • Documentation
// Example usage
{
  "prompt": "Create a function that sorts an array of integers",
在 GitHub 查看完整 README

安装

npx -y @smithery/cli install zig-mcp-server --client claude
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "zig": { "command": "node", "args": ["/path/to/zig-mcp-server/build/index.js"], "env": { "GITHUB_TOKEN": "your_token_here", "NODE_OPTIONS": "--experimental-vm-modules" }, "restart": true } } }