IM

itxaiohanglover/mcp-codestyle-server

开发工具

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

56 stars 8 forks 质量 61 趋势 0MIT

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

概览

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

概述(AI 翻译)

基于 Spring AI 的 MCP 服务器,为 IDE 和 AI 代理提供代码分析与代码模板搜索、检索工具。


🚀 核心特性

  • MCP 工具:支持 Cherry Studio、Cursor、TRAE 等 MCP 客户端
  • 代码分析:analyzeProject(一站式分析,3~6个关键词→位置+调用链+预览)、exploreCodeContext(展开 / 追踪 / 搜索读代码)
  • 模板:codestyleSearch / getTemplateByPath / uploadTemplate / uploadTemplateFromFileSystem / deleteTemplate
  • 骨架:extractProjectSkeleton(AST 解析项目骨架)
  • 工具组:通过 codestyle.tool-group 按需暴露工具,默认 all 暴露全部工具;若仅需代码分析可设为 analyze(2 工具),减少客户端 令牌
  • Lucene 全文检索:中文分词(SmartChineseAnalyzer),离线可用
  • 双模式检索:本地 Lucene(默认) / 远程 Open API(签名认证)
  • 配置验证:启动时自动验证配置,快速失败
  • 增量更新:SHA256 比对,按需下载
  • 多版本共存:groupId/artifactId/version/ Maven 风格目录

📦 技术栈

  • Java 17,Maven 3.9+
  • Spring Boot 3.4.12,Spring AI MCP Server 2.0.0-M2
  • Apache Lucene 9.12.3,Hutool 5.8.42

🎯 快速开始

方式 1: MCP 客户端使用(推荐)

1.构建 JAR 包

2.配置 MCP 客户端

在 MCP 客户端(如 Cherry Studio、Cursor)中添加配置:

默认 all 暴露全部工具;若仅需代码分析(2 工具)可加 -Dcodestyle.tool-group=analyze。

配置示例:

MCP 客户端配置示例

3.安装后效果

配置完成后,MCP 服务器会自动启动:

MCP 服务器成功启动

4.搜索模板

使用 codestyleSearch 工具搜索模板:

搜索 CRUD 模板示例

5.生成代码

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

README

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


🚀 核心特性

  • MCP 工具:支持 Cherry Studio、Cursor、TRAE 等 MCP 客户端
    • 代码分析:analyzeProject(一站式分析,3~6 个关键词→位置+调用链+预览)、exploreCodeContext(expand / trace / search 读代码)
    • 模板:codestyleSearch / getTemplateByPath / uploadTemplate / uploadTemplateFromFileSystem / deleteTemplate
    • 骨架:extractProjectSkeleton(AST 解析项目骨架)
  • 工具组:通过 codestyle.tool-group 按需暴露工具,默认 all 暴露全部工具;若仅需代码分析可设为 analyze(2 工具),减少客户端 token
  • Lucene 全文检索:中文分词(SmartChineseAnalyzer),离线可用
  • 双模式检索:本地 Lucene(默认) / 远程 Open API(签名认证)
  • 配置验证:启动时自动验证配置,快速失败
  • 增量更新:SHA256 比对,按需下载
  • 多版本共存:groupId/artifactId/version/ Maven 风格目录

📦 技术栈

  • Java 17, Maven 3.9+
  • Spring Boot 3.4.12, Spring AI MCP Server 2.0.0-M2
  • Apache Lucene 9.12.3, Hutool 5.8.42

🎯 快速开始

方式 1: MCP 客户端使用(推荐)

1. 构建 JAR 包

git clone https://github.com/itxaiohanglover/mcp-codestyle-server.git
cd mcp-codestyle-server
mvn clean package -DskipTests

2. 配置 MCP 客户端

在 MCP 客户端(如 Cherry Studio、Cursor)中添加配置:

{
  "mcpServers": {
    "codestyle": {
      "command": "java",
      "args": [
        "-Dspring.ai.mcp.server.stdio=true",
        "-Dspring.main.web-application-type=none",
        "-Dlogging.pattern.console=",
        "-Dfile.encoding=UTF-8",
        "-jar",
        "/path/to/codestyle-server.jar"
      ]
    }
  }
}

默认 all 暴露全部工具;若仅需代码分析(2 工具)可加 -Dcodestyle.tool-group=analyze。

配置示例:

3. 安装后效果

配置完成后,MCP 服务器会自动启动:

4. 搜索模板

使用 codestyleSearch 工具搜索模板:

5. 生成代码

使用 getTemplateByPath 获取模板并生成代码:

方式 2: Claude Skill 使用

详见 Codestyle Skill 文档



📖 使用教程

从市场安装(推荐)

1. 在 MCP 市场搜索

2. 一键安装

点击安装按钮,系统会自动配置 MCP 服务器。

3. 开始使用

安装完成后,即可在对话中使用代码模板功能。

完整使用流程

步骤 1: 搜索模板

在对话中说:

帮我搜索 CRUD 模板

系统会调用 codestyleSearch 工具,返回匹配的模板列表和目录结构。

步骤 2: 选择模板

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "codestyle": { "command": "java", "args": [ "-Dspring.ai.mcp.server.stdio=true", "-Dspring.main.web-application-type=none", "-Dlogging.pattern.console=", "-Dfile.encoding=UTF-8", "-jar", "/path/to/codestyle-server.jar" ] } } }