Maven Project Generator MCP
# 🚀 Maven Project Generator MCP
Un serveur MCP (Model Context Protocol) pour générer automatiquement des projets Maven complets avec export ZIP intégré,
spécialement conçu pour Claude Desktop.
## 📋 Table des matières
- [🎯 Fonctionnalités](#-fonctionnalités)
- [🔧 Installation](#-installation)
- [⚙️ Configuration](#️-configuration)
- [🎮 Utilisation](#-utilisation)
## 🎯 Fonctionnalités
### ✨ Génération automatique
- **Projets Maven complets** : Applications, plugins, bibliothèques
- **Structure standard** : Respect des conventions Maven
- **Templates intelligents** : Génération de pom.xml optimisés
- **Classes par défaut** : Main.java ou Mojo selon le type
### 🔍 Détection intelligente
- **Auto-détection des packages** Java depuis le code source
- **Extraction automatique** des noms de classes
- **Validation** des structures Maven
- **Gestion d'erreurs** robuste
### 📦 Export et organisation
- **Export ZIP automatique** avec structure complète
- **Gestion des répertoires** automatique
- **Support multi-fichiers** (Java, ressources, documentation)
- **Chemins personnalisés** pour fichiers spéciaux
### 🎨 Types de projets supportés
- **Applications** : Projets Java standard avec main()
- **Plugins Maven** : Avec classes Mojo et annotations
- **Bibliothèques** : Projets jar réutilisables
## 🔧 Installation
### Prérequis
- **Node.js** 18+
- **npm** ou **yarn**
- **Claude Desktop** installé
### 1. Cloner et installer
```bash
git clone <votre-repo>
cd maven-project-generator-mcp
npm install
```
### 2. Compiler le TypeScript
```bash
npm run build
```
## ⚙️ Configuration
### Configuration Claude Desktop
**Fichier de configuration :**
- **Windows** : `%APPDATA%\Claude\claude_desktop_config.json`
- **macOS/Linux** : `~/.config/claude-desktop/claude_desktop_config.json`
**Contenu :**
```json
{
"mcpServers": {
"maven-project-generator": {
"command": "node",
"args": [
"C:\\chemin\\vers\\votre\\projet\\dist\\index.js"
],
"description": "Générateur de projets Maven avec export ZIP",
"env": {
"NODE_ENV": "production"
}
}
}
}
```
### Variables d'environnement
```bash
# Optionnel : répertoire de sortie par défaut
MAVEN_OUTPUT_DIR=./output
# Optionnel : niveau de log
LOG_LEVEL=info
```
## 🎮 Utilisation
### Commandes disponibles dans Claude Desktop
#### 1. 🏗️ Créer un projet
```
Crée un nouveau projet Maven avec :
- Group ID: com.monentreprise
- Artifact ID: mon-super-plugin
- Type: plugin
- Description: Plugin Maven pour automatiser les builds
```
#### 2. ☕ Ajouter des fichiers Java
```
Ajoute cette classe Java au projet :
package com.monentreprise.utils;
public class StringHelper {
public static String capitalize(String input) {
return input.substring(0, 1).toUpperCase() + input.substring(1);
}
}
```
#### 3. 📄 Ajouter des ressources
```
Ajoute un fichier application.properties avec :
app.name=Mon Application
app.version=1.0.0
```
#### 4. 📦 Générer le ZIP final
```
Génère maintenant le projet Maven complet en ZIP
```
### Workflow typique
1. **Créer** le projet de base
2. **Ajouter** les classes Java nécessaires
3. **Configurer** les ressources
4. **Personnaliser** le pom.xml si besoin
5. **Générer** le ZIP final
## 🔍 API Documentation
### Interface `MavenProject`
```typescript
interface MavenProject {
groupId: string; // Identifiant du groupe
artifactId: string; // Identifiant de l'artifact
version: string; // Version du projet
name?: string; // Nom affiché
description?: string; // Description
javaVersion?: stringTDQS
Scored across 8 tools
Each tool has a clearly distinct purpose with no overlap: adding different file types, clearing, creating, generating, listing, and setting the POM file. The descriptions specify unique actions and targets, making it easy for an agent to select the right tool without confusion.
All tools follow a consistent verb_noun pattern in snake_case (e.g., add_java_file, create_maven_project, list_files). The naming is predictable and readable throughout the set, with no deviations in style or convention.
With 8 tools, the count is well-scoped for a Maven project generator. Each tool earns its place by covering essential operations like project creation, file management, and output generation, without being too sparse or bloated.
The tool set provides complete coverage for the domain of Maven project generation, including CRUD-like operations: create project, add/clear files, list contents, set configuration (POM), and generate output (ZIP). There are no obvious gaps that would hinder an agent's workflow.