Skip to main content
Glama
YanceLint MCP Server

YanceLint MCP Server

by xihe-lab

YanceLint MCP Server

npm License

让 AI(Claude Code)实时感知代码规约违规。

简介

YanceLint MCP Server 是 YanceLint 的 Model Context Protocol (MCP) 接口,让支持 MCP 的 AI 工具(如 Claude Code)能够实时获取代码规约检查结果。

Related MCP server: lsp-mcp

安装

无需手动安装,Claude Code 通过 npx 自动拉取最新版本。只需在项目中配置 MCP Server 即可(见下方「注册到 Claude Code」)。

如需手动运行:

npx @xihe-lab/yance-mcp-server

注册到 Claude Code

方式一:项目级配置(推荐)

在项目根目录创建 .mcp.json,团队成员共享:

{
  "mcpServers": {
    "yancelint": {
      "command": "npx",
      "args": ["-y", "@xihe-lab/yance-mcp-server"]
    }
  }
}

方式二:全局配置

在 ~/.claude/settings.json 中添加,所有项目生效:

{
  "mcpServers": {
    "yancelint": {
      "command": "npx",
      "args": ["-y", "@xihe-lab/yance-mcp-server"]
    }
  }
}

方式三:全局安装后使用

npm install -g @xihe-lab/yance-mcp-server

配置中直接使用命令名:

{
  "mcpServers": {
    "yancelint": {
      "command": "yance-mcp-server"
    }
  }
}

npx -y 会自动从 npm 拉取最新版本运行,无需手动安装。

工具列表

工具

描述

get_file_violations

获取指定文件的规约违规列表(来自 P3C/ESLint/Stylelint/Checkstyle)

get_project_summary

获取项目级扫描摘要,包含各工具违规总数

check_health

检查 YanceLint Server 运行状态

前置条件

需要 YanceLint 插件 在 IntelliJ IDEA 中运行:

  1. 安装 YanceLint 插件到 IDEA

  2. 打开项目时,HTTP Server 自动在 localhost:63742 启动

  3. 确保 ESLint/Stylelint/P3C/Checkstyle 相关工具已配置

使用示例

在 Claude Code 中:

> 检查 src/pages/Home.tsx 有什么规约违规

AI 会自动调用 get_file_violations 工具获取违规列表并给出修复建议。

相关项目

许可证

Apache License 2.0

Copyright 2025 Xihe Lab (羲和实验室)

详见 LICENSE 和 NOTICE 文件。

联系方式

Available Tools

3 tools
check_healthA

检查 YanceLint Server 是否运行,返回可用的扫描工具列表。

Inputs: no named parameters.

get_file_violationsA

获取指定文件的代码规约违规列表。YanceLint 会根据文件类型自动选择 P3C(Java)、ESLint(JS/TS)、Stylelint(CSS/SCSS)、Checkstyle(Java)进行扫描。返回违规消息、严重等级、行号等信息。

Inputs: file_path (required).

get_project_summaryA

获取项目级代码规约扫描摘要,包含各工具(P3C/ESLint/Stylelint/Checkstyle)的违规总数。

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a distinct purpose: check_health verifies server status and lists scanners, get_file_violations returns violations for a specific file, and get_project_summary provides aggregated totals. No overlap or ambiguity.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern using snake_case (check_health, get_file_violations, get_project_summary), with clear and predictable naming.

    Tool Count4/5

    The server has 3 tools, which is reasonable for a focused linting service. While slightly lean, the tools cover the core functionality without unnecessary redundancy.

    Completeness4/5

    The set covers health checking, file-level violation retrieval, and project summary. Missing explicit support for per-tool configuration or detailed project-wide results, but the core use cases are addressed.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A Model Context Protocol server that provides clj-kondo linting capabilities for Clojure/ClojureScript/EDN files, useful for environments like Claude code and desktop that lack built-in linting.
      1
      7 npm
      4
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      A multi-language code analysis server that helps LLMs or humans automatically lint, type-check, and improve code with minimal installation friction, currently supporting Python with plans for other languages.
      1
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Bridges Claude Code to Language Server Protocol (LSP) servers to enable semantic code intelligence features like navigation, refactoring, and real-time diagnostics. It supports multiple languages including TypeScript, Python, and Rust with multi-root workspace capabilities.
      19
      1,961 npm
      23
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants and developers to analyze code for language-specific best practices and idiomatic patterns across programming languages, CI automation, and configuration formats.
      16
      2
      MIT