Token导航 LogoToken导航

MCP Server · 开发工具

Go Standards MCP Server

一个基于MCP协议的智能Go代码质量分析服务,支持全量扫描和Git增量检测,可集成自定义编码规范。

stdio官方级别未说明来源级核验工具 5
代码分析代码质量GoClaude静态分析Claude DesktopVS Code

快速开始

作者 / 组织
MOONL0323
提供方
MOONL0323
运行时
Docker

工具数量

5

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

0

仓库热度

收录来源

1 个

MCP World

选型结论

Go Standards MCP Server 属于开发工具类 MCP Server,公开资料标注 5 个工具,通过stdio 本地进程接入,适配 Claude Desktop、Claude、VS Code,有可以直接复制的安装命令;接入前要先准备 会话凭据。

分类

开发工具

传输方式

stdio

认证方式

会话凭据

部署方式

公开资料未说明

安装与配置

安装命令

docker run -d -p 8080:8080 \

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Docker,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 5 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

Go标准MCP服务器

中文文档 |英语

用于智能Go代码质量分析的模型上下文协议(MCP)服务,将行业标准linter与自定义规则引擎集成在一起。

特性

  • MCP协议:与Claude Desktop和其他MCP客户端无缝集成
  • 双重分析模式:完整存储库扫描或基于Git的增量检测
  • 自定义规则:上传和管理团队特定的编码标准
  • 多用户就绪:专为隔离用户上下文的共享部署而设计
  • CLI+服务器:灵活的部署选项

快速开始

先决条件

  • 转到1.21+
  • golangci lint(可选,用于增强分析)

安装

# Build both server and CLI
make build-all

# Or build separately
make build-server  # MCP server
make build-cli     # Standalone CLI tool

MCP服务器设置

配置Claude桌面(%APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "go-standards": {
      "command": "D:\\path\\to\\bin\\mcp-server.exe",
      "args": []
    }
  }
}

CLI使用情况

# Full analysis
go-standards-cli --path ./myproject

# Incremental analysis (Git changes only)
go-standards-cli --path ./myproject --incremental

# Custom config
go-standards-cli --path ./myproject --config rules.yaml

使用指南

1.全代码分析

使用默认设置分析整个Go项目:

使用MCP客户端(克劳德桌面):

Please analyze the Go code at /path/to/project using analyze_go_code tool

使用CLI:

go-standards-cli --path /path/to/project

使用特定的过梁:

{
  "path": "/path/to/project",
  "mode": "full",
  "linters": ["golangci-lint", "govet"]
}

预期产量:

  • 按严重程度(错误、警告、信息)列出的问题计数
  • 包含文件位置和行号的详细问题列表
  • 建议的修复和最佳实践
  • 总体质量得分

2.Git增量分析

只分析Git中已更改的文件,对于大型项目来说要快得多。

2.1快速检查项目是否为Git仓库
# Using CLI
go-standards-cli --path /path/to/project --git-check

# Or use git_check tool in MCP

答复:

{
  "is_git_repo": true,
  "path": "/path/to/project",
  "message": "This is a valid Git repository"
}
2.2启用Git集成

步骤1:为您的项目启用Git集成

# Using CLI
go-standards-cli --path /path/to/project --git-enable

# Or use git_config tool in MCP with action="enable"

这创建了一个 .go-standards.json 项目根目录中的配置文件:

{
  "enabled": true,
  "auto_commit": false,
  "auto_push": false,
  "base_branch": "origin/main",
  "fail_on_error": true,
  "hooks_installed": false
}

步骤2:配置Git集成(可选)

# Set base branch for comparison
go-standards-cli --path /path/to/project --git-config \
  --base-branch main

# Configure via git_config tool

完整配置选项:

{
  "action": "set",
  "path": "/path/to/project",
  "config": {
    "enabled": true,
    "base_branch": "main",
    "auto_commit": true,
    "auto_push": false,
    "config_file": ".golangci.yml",
    "fail_on_error": true
  }
}
2.3运行增量分析

分析暂存文件(提交前):

go-standards-cli --path /path/to/project --incremental --mode staged

分析修改的文件(工作目录):

go-standards-cli --path /path/to/project --incremental --mode modified

分析从分支更改的文件:

go-standards-cli --path /path/to/project --incremental \
  --mode branch --base main

使用MCP工具:

{
  "path": "/path/to/project",
  "mode": "incremental",
  "linters": ["golangci-lint"]
}
2.4安装Git钩子(提交/推送时自动检查)
# Install pre-commit hook
go-standards-cli --path /path/to/project --install-hooks commit

# Install pre-push hook
go-standards-cli --path /path/to/project --install-hooks push

# Install both
go-standards-cli --path /path/to/project --install-hooks all

安装后,当您执行以下操作时,该工具将自动运行:

  • git commit -检查暂存文件
  • git push -检查从基本分支更改的文件

挂钩行为:

  • 通过:如果没有问题,提交/推送正常进行
  • 失败:如果发现问题,提交/推送将被阻止,并显示问题
  • 配置 fail_on_error: false 允许带有警告的提交

3.自定义编码标准

上传团队的编码标准并自动生成linter配置。

3.1上传标准文档

支持的格式: PDF、Markdown、文本

# Using CLI
go-standards-cli --upload-document /path/to/team-standard.pdf \
  --name "team-v1" \
  --description "Company Go coding standards v1.0"

# Using MCP upload_document tool

发生了什么:

  1. 文档被解析和分析
  2. 规则会自动提取
  3. .golangci.yml 配置已生成
  4. 配置已保存到 storage/shared/configs/
3.2使用自定义标准进行分析
go-standards-cli --path /path/to/project --config team-v1
3.3列出可用标准
go-standards-cli --list-standards

# Or use list_standards MCP tool

输出:

Available Coding Standards:
1. strict - Highest standards (complexity ≤ 5, coverage ≥ 85%)
2. standard - Balanced standards (complexity ≤ 10, coverage ≥ 70%)
3. relaxed - Basic standards (complexity ≤ 15, coverage ≥ 60%)
4. team-v1 - Company Go coding standards v1.0

4.高级配置

4.1定制过梁配置

创建 .golangci.yml 在项目根目录中:

linters:
  enable:
    - gofmt
    - golint
    - govet
    - errcheck
    - staticcheck
    - gosec
  
linters-settings:
  gocyclo:
    min-complexity: 10
  govet:
    check-shadowing: true
  errcheck:
    check-type-assertions: true

issues:
  exclude-rules:
    - path: _test\.go
      linters:
        - gocyclo
4.2多项目批量分析
# Analyze multiple projects
go-standards-cli --batch \
  --projects "project1,project2,project3" \
  --output batch-report.json
4.3 CI/CD集成

GitHub操作示例:

name: Code Quality Check

on: [push, pull_request]

jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      
      - name: Install go-standards
        run: |
          wget https://github.com/MOONL0323/go-standards-mcp-server/releases/latest/download/go-standards-cli
          chmod +x go-standards-cli
      
      - name: Run analysis
        run: |
          ./go-standards-cli --path . --incremental --mode branch --base origin/main

GitLab CI示例:

code_quality:
  script:
    - go-standards-cli --path . --incremental
  only:
    - merge_requests

建筑

flowchart TB
    subgraph Clients[MCP Clients Layer]
        Claude[Claude Desktop]
        VSCode[VS Code Extension]
        Other[Other MCP Clients]
    end

    subgraph Server[Go Standards MCP Server]
        direction TB
        
        subgraph Protocol[MCP Protocol Layer]
            Tools[MCP Tools: analyze_go_code, git_check/config, list_standards, upload_document, get/set_config]
            Resources[Resources: standards, configs]
        end

        subgraph Service[Service Layer]
            Analyzer[Analyzer Engine]
            DocService[Document Service]
            GitDetector[Git Detector]
            ConfigMgr[Config Manager]
            StorageMgr[Storage Manager]
            SessionMgr[Session Manager]
        end

        subgraph Linters[Linter Integration]
            Golangci[golangci-lint]
            GoVet[go vet]
            StaticCheck[staticcheck]
        end
    end

    subgraph Storage[Storage Layer]
        Shared[Shared: checklists, configs, templates]
        UserData[User Isolated: history, settings, reports]
    end

    Claude -->|stdio| Protocol
    VSCode -->|stdio| Protocol
    Other -->|http/sse| Protocol

    Protocol --> Service
    Service --> Linters
    Service --> Storage

    classDef serverStyle fill:#e1f5ff,stroke:#0288d1,stroke-width:2px
    classDef protocolStyle fill:#fff3e0,stroke:#f57c00,stroke-width:2px
    classDef serviceStyle fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
    classDef linterStyle fill:#e8f5e9,stroke:#388e3c,stroke-width:2px
    classDef storageStyle fill:#fce4ec,stroke:#c2185b,stroke-width:2px

    class Server serverStyle
    class Protocol protocolStyle
    class Service serviceStyle
    class Linters linterStyle
    class Storage storageStyle

架构组件:

  • MCP协议层:8个用于代码分析、git集成和配置管理的工具
  • 服务层:具有并行执行、缓存和会话管理的核心业务逻辑
  • 林特尔集成:golangci lint(40+跳棋),去兽医,统计检查
  • 存储层:共享资源和用户隔离数据,会话超时30分钟

MCP工具

analyze_go_code

使用可配置的linter和规则分析Go代码。

参数:

  • path (必填):目标目录
  • mode (可选): "full" 或 "incremental" (默认值: "full")
  • linters (可选):例如。, ["golangci-lint", "govet"]
  • config (可选):自定义配置文件路径

例子:

{
  "path": "/path/to/project",
  "mode": "incremental",
  "linters": ["golangci-lint"]
}

git_check

快速检查路径是否为Git存储库。

list_standards

列出所有可用的编码标准文件。

upload_document

上传团队编码标准(PDF/Markdown)。

参数:

  • file_path:文档路径
  • doc_type: "checklist" 或 "guideline"
  • language: "go", "python"等等。

get_config / set_config

获取或更新Git集成配置。

配置

Git集成(.go-standards-git.yaml)

git_integration:
  enabled: true
  base_branch: "main"
  ignored_paths:
    - "vendor/"
    - "*.pb.go"
  max_file_size_kb: 500

分析配置

linters:
  golangci:
    enabled: true
    config_file: ".golangci.yml"
  govet:
    enabled: true

rules:
  max_function_lines: 100
  require_comments: true

多用户部署

存储结构:

storage/
├─ shared/              # Shared resources
│   ├─ checklists/      # Team standards
│   └─ configs/         # Default configs
└─ users/{userID}/      # User-isolated data (future)
    ├─ history/
    └─ settings/

Docker:

docker build -t go-standards-mcp .
docker run -d -p 8080:8080 \
  -v /path/to/storage:/app/storage \
  go-standards-mcp

发展

make test    # Run tests
make lint    # Lint code
make fmt     # Format code
make help    # View commands

常见问题解答

Q: 如何使用增量分析?\ A: 确保您的项目是Git存储库,然后使用 "mode": "incremental" 或 --incremental 旗帜。

Q: 我可以使用自定义编码标准吗?\ A: 是的,使用 upload_document 上传团队特定标准。

Q: 多语言支持?\ A: 目前专注于Go。框架支持扩展。

Q: 多用户部署?\ A: 使用带有持久存储的Docker/Kubernetes。用户隔离架构已准备就绪(请参阅 internal/usercontext/).

许可证

MIT许可证-请参阅 许可证

工具与能力

工具数量

5

资源数量

0

提示词数量

0

能力标签

代码分析Go本地部署Go语言代码质量静态分析Git集成

支持客户端

Claude DesktopClaudeVS Code

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

  • 只提供 5 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude Desktop、Claude、VS Code,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好 Docker,换机器要重新装一遍。
  • 需要自备会话凭据,没有凭据没法直接试。
  • 公开摘要偏短,具体能力和限制要回到仓库确认。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 暂时拿不到会话凭据的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
Go Standards MCP Server

MCP World · 本页

5stdio有1 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

Go Standards MCP Server 怎么安装?

公开资料给出的安装命令是 docker run -d -p 8080:8080 \,运行环境为 Docker。装完后按客户端要求写进 MCP 配置,重启客户端生效。

Go Standards MCP Server 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Docker;保存后完全退出客户端再打开,配置才会生效。

Go Standards MCP Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

Go Standards MCP Server 需要 API Key 吗?

公开资料标注的认证方式是会话凭据,也就是要先拿到凭据才能连上;凭据只填在自己本地的配置里,不要写进公开仓库。

Go Standards MCP Server 支持哪些客户端?

公开资料标注支持 Claude Desktop、Claude、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP