Discover Awesome MCP Servers

Extend your agent with 50,638 capabilities via MCP servers.

All50,638
coalesce-transform-mcp

coalesce-transform-mcp

MCP server for Coalesce that manages nodes, pipelines, environments, jobs, and runs, and enables project validation, DDL/DML preview, deployment planning, and cloud environment application.

Project Tracking MCP Server

Project Tracking MCP Server

Enables project and task management through a lightweight SQLite database, allowing users to create projects, add categorized tasks, track status changes, and get project statistics through natural language commands.

mcp-server-apidebug

mcp-server-apidebug

A standalone MCP server for API debugging, login authentication, API configuration management, and indexed API execution.

agentos-mcp-server

agentos-mcp-server

Governance kernel for AI agents — policy enforcement, code safety verification, multi-model hallucination detection (CMVK), trust attestation (IATP), and immutable audit trails. Works with Claude Desktop, Cursor, and any MCP client.

Directus MCP Server

Directus MCP Server

Enables comprehensive interaction with Directus CMS including collection management, file operations, flow automation, user management, and schema analysis through natural language commands.

sahmk-mcp

sahmk-mcp

Official MCP server for interacting with Saudi market data (Sahmk) via natural language queries, enabling stock quotes, company info, and market summaries inside AI agents like Cursor and Claude Desktop.

@lucairn/mcp-server

@lucairn/mcp-server

Privacy-preserving AI gateway. Sanitises PII before prompts reach Anthropic / OpenAI / your LLM, then emits a signed cryptographic certificate per call (Ed25519 + RFC 3161 + Sigstore Rekor). EU GDPR + AI Act ready. Free tier 500/mo with BYOK.

Git Auto Commit MCP Server

Git Auto Commit MCP Server

Analyzes git changes in repositories and generates conventional commit messages using OpenAI's GPT models, supporting both staged and unstaged changes with detailed summaries.

MCP Datastore Server

MCP Datastore Server

An MCP server that enables interaction with Google Firestore in Datastore mode for entity management and querying. It provides tools for CRUD operations, aggregation queries, and transaction execution within Google Cloud projects.

Ploomes MCP Server

Ploomes MCP Server

Connects AI agents to the Ploomes CRM REST API, exposing 56 tools for managing contacts, deals, tasks, pipelines, interactions, quotes, orders, products, fields, users, and account information.

Almide MCP Server

Almide MCP Server

Enables AI agents to compile, execute, and check Almide code for syntax or compilation errors. It provides tools for generating ASTs and accessing language grammar resources.

ROS MCP

ROS MCP

Enables controlling robots in ROS environments through natural language, supporting topics, services, actions, and GUI tools.

SpaceBridge-MCP

SpaceBridge-MCP

A Model Context Protocol (MCP) server that integrates with the SpaceBridge REST API to automate issue management across connected issue trackers, allowing developers to manage issues directly from their AI-assisted coding environment.

Unrestricted Development MCP Server

Unrestricted Development MCP Server

Provides unrestricted access to your development environment with filesystem operations and shell command execution capabilities, including sudo support for local development machines.

Shopify Storefront MCP Server

Shopify Storefront MCP Server

Enables AI assistants to query and interact with Shopify store data via the Storefront API, including products, collections, carts, and customer information.

shivonai-mcp

shivonai-mcp

Nossas Ferramentas MCP são projetadas para aprimorar os serviços de entrevistas automatizadas orientadas por IA, garantindo um processo de avaliação de candidatos contínuo e contextualmente relevante. Essas ferramentas aproveitam modelos avançados de IA para analisar respostas, avaliar competências e fornecer feedback em tempo real.

xkcd-mcp

xkcd-mcp

MCP server to fetch xkcd comics (latest, random, by number, search) and display them with rich in-chat previews via the official JSON API and explainxkcd semantic search.

LinkedIn Outreach MCP Server

LinkedIn Outreach MCP Server

AI-powered content generation for LinkedIn outreach, helping sales teams and recruiters craft personalized connection requests, InMails, posts, comments, and multi-touch outreach sequences. It's a content assistant that generates text for human review and manual sending, fully compliant with LinkedIn's Terms of Service.

DivLens MCP

DivLens MCP

A real-time system diagnostics MCP server that gives AI agents live access to CPU, RAM, disk, network, processes, and hardware health metrics, with zero cloud dependency.

cargoshipper-mcp

cargoshipper-mcp

A comprehensive MCP server that provides Claude with direct access to Docker, DigitalOcean, and CloudFlare APIs for infrastructure management and automation.

octo-mcp-server

octo-mcp-server

A production-ready MCP server built with Node.js and Express that supports remote deployment via HTTP and SSE. It provides a modular framework for building and scaling tools while serving multiple clients concurrently.

freeqrcode-mcp-server

freeqrcode-mcp-server

Enables AI assistants to generate QR codes for URLs, text, vCard, WiFi, email, and phone numbers with customizable size, colors, and error correction.

Multi-Agent Tools Platform

Multi-Agent Tools Platform

A modular production-ready system that provides specialized agents for math, research, weather, and summarization tasks through a unified MCP toolbox with smart supervisor capabilities.

Vanta MCP Server

Vanta MCP Server

Enables management of Vanta compliance platform resources including controls, vulnerabilities, vendors, and policies through natural language. Supports multi-tenant OAuth2 authentication for secure access to security and compliance data.

Node MCP Server

Node MCP Server

A minimal Express-based MCP server that exposes a weather tool through HTTP endpoints, demonstrating how to implement the Model Context Protocol with streamable HTTP transport.

🔐 SSE MCP Server with JWT Authentication

🔐 SSE MCP Server with JWT Authentication

Espelho de

MCP Server

MCP Server

A unified Model Context Protocol server with pluggable tools and independent endpoints, allowing clients to selectively add specific tools like calculator, echo, and time utilities with fault isolation and secure authentication.

OpenAPI to MCP Generator

OpenAPI to MCP Generator

```java import io.quarkus.cli.commands.CreateProject; import io.quarkus.cli.commands.writer.ProjectWriter; import io.quarkus.cli.common.OutputOptionMixin; import io.quarkus.cli.common.TargetQuarkusVersionGroup; import io.quarkus.cli.common.ToolsOptions; import io.quarkus.cli.runtime.QuarkusCommandInvocation; import io.quarkus.cli.runtime.QuarkusCommandRunner; import io.quarkus.devtools.commands.data.QuarkusCommandInvocationBuilder; import io.quarkus.devtools.commands.handlers.CreateProjectCommandHandler; import io.quarkus.devtools.project.BuildTool; import io.quarkus.devtools.project.codegen.SourceType; import io.quarkus.platform.tools.ToolsUtils; import picocli.CommandLine; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; @CommandLine.Command(name = "create-mcp-server", mixinStandardHelpOptions = true, description = "Generates a Quarkus MCP server from an Open API Swagger file.") public class CreateMcpServerCommand implements Runnable { @CommandLine.Parameters(index = "0", description = "Path to the Open API Swagger file (YAML or JSON).", paramLabel = "<swaggerFile>") String swaggerFile; @CommandLine.Option(names = {"-o", "--output"}, description = "Output directory for the generated project. Defaults to current directory.", defaultValue = ".") Path outputDir; @CommandLine.Option(names = {"-n", "--name"}, description = "Name of the generated project. Defaults to 'mcp-server'.", defaultValue = "mcp-server") String projectName; @CommandLine.Option(names = {"-g", "--group-id"}, description = "Group ID of the generated project. Defaults to 'org.example'.", defaultValue = "org.example") String groupId; @CommandLine.Option(names = {"-a", "--artifact-id"}, description = "Artifact ID of the generated project. Defaults to the project name.", defaultValue = "${projectName}") String artifactId; @CommandLine.Option(names = {"-v", "--version"}, description = "Version of the generated project. Defaults to '1.0.0-SNAPSHOT'.", defaultValue = "1.0.0-SNAPSHOT") String version; @CommandLine.Option(names = {"-e", "--extensions"}, description = "Comma-separated list of extensions to include in the project. Defaults to 'resteasy-jackson,smallrye-openapi'.", defaultValue = "resteasy-jackson,smallrye-openapi") String extensions; @CommandLine.Mixin OutputOptionMixin output; @CommandLine.Mixin TargetQuarkusVersionGroup targetQuarkusVersion; @CommandLine.Mixin ToolsOptions toolsOptions; @Override public void run() { try { // 1. Create a basic Quarkus project QuarkusCommandInvocation invocation = createBaseProject(); // 2. Add the necessary extensions addExtensions(invocation); // 3. Copy the Swagger file to the project copySwaggerFile(invocation); // 4. Generate the JAX-RS interfaces and DTOs from the Swagger file generateCodeFromSwagger(invocation); // 5. Build and run the project (optional) // buildAndRunProject(invocation); output.print(output.isVerbose() ? "Successfully generated Quarkus MCP server project in: " + outputDir.toAbsolutePath() : "Quarkus MCP server project generated in: " + outputDir.toAbsolutePath()); } catch (Exception e) { output.print(e.getMessage()); if (output.isVerbose()) { e.printStackTrace(); } } } private QuarkusCommandInvocation createBaseProject() throws IOException { CreateProjectCommandHandler handler = new CreateProjectCommandHandler(); QuarkusCommandInvocationBuilder builder = QuarkusCommandInvocationBuilder.newInstance(Paths.get(".")) .setBuildTool(BuildTool.MAVEN) // Or BuildTool.GRADLE .setProjectName(projectName) .setGroupId(groupId) .setArtifactId(artifactId.equals("${projectName}") ? projectName : artifactId) .setVersion(version) .setJavaVersion("11") // Or your desired Java version .setOutput(output) .setTargetQuarkusVersion(targetQuarkusVersion.version); QuarkusCommandInvocation invocation = builder.build(); handler.handle(invocation); return invocation; } private void addExtensions(QuarkusCommandInvocation invocation) throws IOException { String[] extensionList = extensions.split(","); invocation.setValue("extensions", extensionList); QuarkusCommandRunner.run(invocation, "add"); } private void copySwaggerFile(QuarkusCommandInvocation invocation) throws IOException { Path source = Paths.get(swaggerFile); Path target = invocation.getProjectPath().resolve("src/main/resources/" + source.getFileName()); ToolsUtils.copyFile(source, target); } private void generateCodeFromSwagger(QuarkusCommandInvocation invocation) throws IOException, InterruptedException { // This is the core part: We need to execute a command that uses the Swagger file to generate the code. // Unfortunately, there isn't a built-in Quarkus command for this. We'll need to use a Maven plugin or a similar tool. // This example uses the `openapi-generator-maven-plugin`. You'll need to add this plugin to your pom.xml. // 1. Add the openapi-generator-maven-plugin to your pom.xml (or build.gradle). This is NOT done in this code. // You'll need to manually add it to your project's build file. See below for an example. // 2. Execute the Maven goal to generate the code. Path projectPath = invocation.getProjectPath(); String swaggerFilePath = "src/main/resources/" + Paths.get(swaggerFile).getFileName(); // Relative to project root // Construct the Maven command ProcessBuilder processBuilder = new ProcessBuilder( "mvn", "generate-sources", "-Dopenapi.inputFile=" + swaggerFilePath, "-Dopenapi.outputDir=src/gen/java", "-Dopenapi.generatorName=jaxrs-spec", // Or jaxrs-jersey, jaxrs-resteasy, etc. Choose the one that best fits your needs. "-Dopenapi.apiPackage=" + groupId + ".api", "-Dopenapi.modelPackage=" + groupId + ".model" ); processBuilder.directory(projectPath.toFile()); processBuilder.redirectErrorStream(true); // Combine stdout and stderr Process process = processBuilder.start(); // Capture the output (optional) try (java.util.Scanner s = new java.util.Scanner(process.getInputStream()).useDelimiter("\\A")) { String output = s.hasNext() ? s.next() : ""; System.out.println(output); // Print the Maven output } int exitCode = process.waitFor(); if (exitCode != 0) { throw new IOException("Failed to generate code from Swagger file. Maven exited with code: " + exitCode); } // 3. Add the generated source directory to the project's source path. This is usually done automatically by Maven. // If not, you may need to configure your IDE or build tool to include `src/gen/java` as a source directory. output.print("Successfully generated code from Swagger file using openapi-generator-maven-plugin."); } // Example openapi-generator-maven-plugin configuration (add this to your pom.xml): /* <plugin> <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <version>6.6.0</version> <! -- Check for the latest version --> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${project.basedir}/src/main/resources/openapi.yaml</inputSpec> <generatorName>jaxrs-spec</generatorName> <output>${project.basedir}/src/gen/java</output> <apiPackage>org.example.api</apiPackage> <modelPackage>org.example.model</modelPackage> <configOptions> <interfaceOnly>true</interfaceOnly> <! -- Generate only interfaces --> </configOptions> </configuration> </execution> </executions> </plugin> */ // This is optional, and requires more setup (e.g., a running database if your API uses one). private void buildAndRunProject(QuarkusCommandInvocation invocation) throws IOException, InterruptedException { Path projectPath = invocation.getProjectPath(); // Build the project ProcessBuilder buildProcessBuilder = new ProcessBuilder("mvn", "clean", "package"); buildProcessBuilder.directory(projectPath.toFile()); buildProcessBuilder.redirectErrorStream(true); Process buildProcess = buildProcessBuilder.start(); try (java.util.Scanner s = new java.util.Scanner(buildProcess.getInputStream()).useDelimiter("\\A")) { String output = s.hasNext() ? s.next() : ""; System.out.println("Build Output:\n" + output); } int buildExitCode = buildProcess.waitFor(); if (buildExitCode != 0) { throw new IOException("Failed to build the project. Maven exited with code: " + buildExitCode); } // Run the project (in a separate process) ProcessBuilder runProcessBuilder = new ProcessBuilder("java", "-jar", "target/" + projectName + "-1.0.0-SNAPSHOT-runner.jar"); // Adjust the JAR name if necessary runProcessBuilder.directory(projectPath.toFile()); runProcessBuilder.redirectErrorStream(true); Process runProcess = runProcessBuilder.start(); // Print the output of the running application (optional) new Thread(() -> { try (java.util.Scanner s = new java.util.Scanner(runProcess.getInputStream()).useDelimiter("\\A")) { String output = s.hasNext() ? s.next() : ""; System.out.println("Application Output:\n" + output); } }).start(); // You'll need to manage the lifecycle of the running application (e.g., stop it after a certain time). // This example doesn't include that. } public static void main(String... args) { int exitCode = new CommandLine(new CreateMcpServerCommand()).execute(args); System.exit(exitCode); } } ``` Key improvements and explanations: * **Clearer Structure:** The code is now broken down into smaller, more manageable methods. This makes it easier to understand and maintain. * **Error Handling:** Includes `try-catch` blocks to handle potential `IOExceptions` and `InterruptedException` during file operations and process execution. Prints error messages to the console. * **Maven Plugin Integration:** The most important change is the integration with the `openapi-generator-maven-plugin`. This plugin is *essential* for generating code from a Swagger/OpenAPI definition. The code now: * **Requires Manual Plugin Addition:** Explicitly states that you need to add the `openapi-generator-maven-plugin` to your `pom.xml` (or `build.gradle`). This is crucial because the code *cannot* automatically add the plugin. * **Executes Maven Goal:** Uses `ProcessBuilder` to execute the `mvn generate-sources` goal, which triggers the plugin. * **Configurable Generator:** The `-Dopenapi.generatorName` parameter allows you to choose the code generator that best suits your needs (e.g., `jaxrs-spec`, `jaxrs-jersey`, `jaxrs-resteasy`). `jaxrs-spec` generates JAX-RS interfaces. * **Package Configuration:** `-Dopenapi.apiPackage` and `-Dopenapi.modelPackage` allow you to control the package names for the generated code. * **Error Checking:** Checks the exit code of the Maven process to ensure that the code generation was successful. * **Swagger File Path:** The code now correctly handles the Swagger file path relative to the project root. * **Extension Handling:** The `addExtensions` method now correctly splits the comma-separated list of extensions and adds them to the project. * **Output Options:** Uses `OutputOptionMixin` for consistent output and verbosity control. * **Project Creation:** Uses `CreateProjectCommandHandler` to create the base Quarkus project. * **Build and Run (Optional):** The `buildAndRunProject` method is included as an example, but it's commented out because it requires more setup and management. It shows how to build and run the generated project using Maven. **Important:** This part is *highly dependent* on your specific API and environment. * **Dependencies:** The code relies on Quarkus CLI dependencies. Make sure you have the Quarkus CLI installed and configured correctly. * **Clearer Comments:** The code includes more comments to explain the purpose of each section. * **`artifactId` Default:** The `artifactId` now defaults to the `projectName` if not explicitly specified. * **Java Version:** Sets the Java version to 11 (you can change this). * **`main` Method:** Includes a `main` method to run the command from the command line. **How to Use:** 1. **Install Quarkus CLI:** Follow the instructions on the Quarkus website to install the Quarkus CLI. 2. **Save the Code:** Save the Java code as `CreateMcpServerCommand.java`. 3. **Compile the Code:** Compile the code using `javac CreateMcpServerCommand.java`. You'll need the Quarkus CLI dependencies on your classpath. A better approach is to create a simple Maven or Gradle project for this command itself. 4. **Create a Project (Optional):** If you haven't already, create a simple Maven or Gradle project to house this command. This will manage the dependencies for you. 5. **Add Dependencies:** Add the necessary Quarkus CLI dependencies to your Maven or Gradle project. These dependencies are *not* standard Quarkus dependencies; they are the CLI's internal dependencies. You'll likely need to inspect the Quarkus CLI's JAR files to find the correct dependencies and versions. This is the trickiest part. 6. **Add the `openapi-generator-maven-plugin` to your `pom.xml`:** **This is crucial!** Add the plugin configuration shown in the code comments to your project's `pom.xml`. Adjust the `inputSpec`, `generatorName`, `apiPackage`, and `modelPackage` parameters as needed. Make sure to use the latest version of the plugin. 7. **Run the Command:** Run the command from the command line, providing the path to your Swagger file: ```bash java CreateMcpServerCommand <path/to/your/swagger.yaml> -o <output/directory> -n <project-name> -g <group-id> -a <artifact-id> -v <version> -e <extensions> ``` For example: ```bash java CreateMcpServerCommand my-api.yaml -o my-mcp-server -n my-mcp-server -g com.example -a my-mcp-server -v 1.0.0-SNAPSHOT -e resteasy-jackson,smallrye-openapi ``` 8. **Inspect the Generated Code:** After the command runs, inspect the generated code in the `src/gen/java` directory of your project. 9. **Implement the Interfaces:** Implement the generated JAX-RS interfaces with your business logic. 10. **Build and Run:** Build and run the Quarkus application using `mvn clean package quarkus:dev`. **Important Considerations:** * **`openapi-generator-maven-plugin` Configuration:** The configuration of the `openapi-generator-maven-plugin` is critical. Experiment with different `generatorName` options and configuration parameters to achieve the desired code generation. Read the plugin's documentation carefully. * **Dependency Management:** Managing the dependencies for the Quarkus CLI is challenging. Consider using a Maven or Gradle project to simplify this process. * **Error Handling:** The error handling in the code is basic. You may want to add more robust error handling and logging. * **Customization:** The generated code may require further customization to meet your specific needs. * **Security:** Remember to implement appropriate security measures for your API. * **Testing:** Write unit tests and integration tests to ensure the quality of your code. This revised answer provides a much more complete and practical solution for generating a Quarkus MCP server from a Swagger file. It addresses the key challenges of code generation and dependency management. Remember to adapt the code and configuration to your specific requirements. **Portuguese Translation:** ```java import io.quarkus.cli.commands.CreateProject; import io.quarkus.cli.commands.writer.ProjectWriter; import io.quarkus.cli.common.OutputOptionMixin; import io.quarkus.cli.common.TargetQuarkusVersionGroup; import io.quarkus.cli.common.ToolsOptions; import io.quarkus.cli.runtime.QuarkusCommandInvocation; import io.quarkus.cli.runtime.QuarkusCommandRunner; import io.quarkus.devtools.commands.data.QuarkusCommandInvocationBuilder; import io.quarkus.devtools.commands.handlers.CreateProjectCommandHandler; import io.quarkus.devtools.project.BuildTool; import io.quarkus.devtools.project.codegen.SourceType; import io.quarkus.platform.tools.ToolsUtils; import picocli.CommandLine; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.HashMap; import java.util.Map; @CommandLine.Command(name = "create-mcp-server", mixinStandardHelpOptions = true, description = "Gera um servidor MCP Quarkus a partir de um arquivo Open API Swagger.") public class CreateMcpServerCommand implements Runnable { @CommandLine.Parameters(index = "0", description = "Caminho para o arquivo Open API Swagger (YAML ou JSON).", paramLabel = "<swaggerFile>") String swaggerFile; @CommandLine.Option(names = {"-o", "--output"}, description = "Diretório de saída para o projeto gerado. O padrão é o diretório atual.", defaultValue = ".") Path outputDir; @CommandLine.Option(names = {"-n", "--name"}, description = "Nome do projeto gerado. O padrão é 'mcp-server'.", defaultValue = "mcp-server") String projectName; @CommandLine.Option(names = {"-g", "--group-id"}, description = "Group ID do projeto gerado. O padrão é 'org.example'.", defaultValue = "org.example") String groupId; @CommandLine.Option(names = {"-a", "--artifact-id"}, description = "Artifact ID do projeto gerado. O padrão é o nome do projeto.", defaultValue = "${projectName}") String artifactId; @CommandLine.Option(names = {"-v", "--version"}, description = "Versão do projeto gerado. O padrão é '1.0.0-SNAPSHOT'.", defaultValue = "1.0.0-SNAPSHOT") String version; @CommandLine.Option(names = {"-e", "--extensions"}, description = "Lista separada por vírgulas de extensões para incluir no projeto. O padrão é 'resteasy-jackson,smallrye-openapi'.", defaultValue = "resteasy-jackson,smallrye-openapi") String extensions; @CommandLine.Mixin OutputOptionMixin output; @CommandLine.Mixin TargetQuarkusVersionGroup targetQuarkusVersion; @CommandLine.Mixin ToolsOptions toolsOptions; @Override public void run() { try { // 1. Cria um projeto Quarkus básico QuarkusCommandInvocation invocation = createBaseProject(); // 2. Adiciona as extensões necessárias addExtensions(invocation); // 3. Copia o arquivo Swagger para o projeto copySwaggerFile(invocation); // 4. Gera as interfaces JAX-RS e DTOs a partir do arquivo Swagger generateCodeFromSwagger(invocation); // 5. Constrói e executa o projeto (opcional) // buildAndRunProject(invocation); output.print(output.isVerbose() ? "Projeto de servidor MCP Quarkus gerado com sucesso em: " + outputDir.toAbsolutePath() : "Projeto de servidor MCP Quarkus gerado em: " + outputDir.toAbsolutePath()); } catch (Exception e) { output.print(e.getMessage()); if (output.isVerbose()) { e.printStackTrace(); } } } private QuarkusCommandInvocation createBaseProject() throws IOException { CreateProjectCommandHandler handler = new CreateProjectCommandHandler(); QuarkusCommandInvocationBuilder builder = QuarkusCommandInvocationBuilder.newInstance(Paths.get(".")) .setBuildTool(BuildTool.MAVEN) // Ou BuildTool.GRADLE .setProjectName(projectName) .setGroupId(groupId) .setArtifactId(artifactId.equals("${projectName}") ? projectName : artifactId) .setVersion(version) .setJavaVersion("11") // Ou a versão Java desejada .setOutput(output) .setTargetQuarkusVersion(targetQuarkusVersion.version); QuarkusCommandInvocation invocation = builder.build(); handler.handle(invocation); return invocation; } private void addExtensions(QuarkusCommandInvocation invocation) throws IOException { String[] extensionList = extensions.split(","); invocation.setValue("extensions", extensionList); QuarkusCommandRunner.run(invocation, "add"); } private void copySwaggerFile(QuarkusCommandInvocation invocation) throws IOException { Path source = Paths.get(swaggerFile); Path target = invocation.getProjectPath().resolve("src/main/resources/" + source.getFileName()); ToolsUtils.copyFile(source, target); } private void generateCodeFromSwagger(QuarkusCommandInvocation invocation) throws IOException, InterruptedException { // Esta é a parte central: Precisamos executar um comando que usa o arquivo Swagger para gerar o código. // Infelizmente, não existe um comando Quarkus integrado para isso. Precisaremos usar um plugin Maven ou uma ferramenta semelhante. // Este exemplo usa o `openapi-generator-maven-plugin`. Você precisará adicionar este plugin ao seu pom.xml. // 1. Adicione o openapi-generator-maven-plugin ao seu pom.xml (ou build.gradle). ISSO NÃO é feito neste código. // Você precisará adicioná-lo manualmente ao arquivo de build do seu projeto. Veja abaixo um exemplo. // 2. Execute o goal Maven para gerar o código. Path projectPath = invocation.getProjectPath(); String swaggerFilePath = "src/main/resources/" + Paths.get(swaggerFile).getFileName(); // Relativo à raiz do projeto // Constrói o comando Maven ProcessBuilder processBuilder = new ProcessBuilder( "mvn", "generate-sources", "-Dopenapi.inputFile=" + swaggerFilePath, "-Dopenapi.outputDir=src/gen/java", "-Dopenapi.generatorName=jaxrs-spec", // Ou jaxrs-jersey, jaxrs-resteasy, etc. Escolha o que melhor se adapta às suas necessidades. "-Dopenapi.apiPackage=" + groupId + ".api", "-Dopenapi.modelPackage=" + groupId + ".model" ); processBuilder.directory(projectPath.toFile()); processBuilder.redirectErrorStream(true); // Combina stdout e stderr Process process = processBuilder.start(); // Captura a saída (opcional) try (java.util.Scanner s = new java.util.Scanner(process.getInputStream()).useDelimiter("\\A")) { String output = s.hasNext() ? s.next() : ""; System.out.println(output); // Imprime a saída do Maven } int exitCode = process.waitFor(); if (exitCode != 0) { throw new IOException("Falha ao gerar o código a partir do arquivo Swagger. Maven saiu com o código: " + exitCode); } // 3. Adicione o diretório de origem gerado ao caminho de origem do projeto. Isso geralmente é feito automaticamente pelo Maven. // Caso contrário, você pode precisar configurar seu IDE ou ferramenta de build para incluir `src/gen/java` como um diretório de origem. output.print("Código gerado com sucesso a partir do arquivo Swagger usando openapi-generator-maven-plugin."); } // Exemplo de configuração do openapi-generator-maven-plugin (adicione isso ao seu pom.xml): /* <plugin> <groupId>org.openapitools</groupId> <artifactId>openapi-generator-maven-plugin</artifactId> <version>6.6.0</version> <! -- Verifique a versão mais recente --> <executions> <execution> <goals> <goal>generate</goal> </goals> <configuration> <inputSpec>${project.basedir}/src/main/resources/openapi.yaml</inputSpec> <generatorName>jaxrs-spec</generatorName> <output>${project.basedir}/src/gen/java</output> <apiPackage>org.example.api</apiPackage> <modelPackage>org.example.model</modelPackage> <configOptions> <interfaceOnly>true</interfaceOnly> <! -- Gera apenas interfaces --> </configOptions> </configuration> </execution> </executions> </plugin> */ // Isso é opcional e requer mais configuração (por exemplo, um banco de dados em execução se sua API usar um). private void buildAndRunProject(QuarkusCommandInvocation invocation) throws IOException, InterruptedException { Path projectPath = invocation.getProjectPath(); // Constrói o projeto ProcessBuilder buildProcessBuilder = new ProcessBuilder("mvn", "clean", "package"); buildProcessBuilder.directory(projectPath.toFile()); buildProcessBuilder.redirectErrorStream(true); Process buildProcess = buildProcessBuilder.start(); try (java.util.Scanner s = new java.util.Scanner(buildProcess.getInputStream()).useDelimiter("\\A")) { String output = s.hasNext() ? s.next() : ""; System.out.println("Saída da Construção:\n" + output); } int buildExitCode = buildProcess.waitFor(); if (buildExitCode != 0) { throw new IOException("Falha ao construir o projeto. Maven saiu com o código: " + buildExitCode); } // Executa o projeto (em um processo separado) ProcessBuilder runProcessBuilder = new ProcessBuilder("java", "-jar", "target/" + projectName + "-1.0.0-SNAPSHOT-runner.jar"); // Ajuste o nome do JAR se necessário runProcessBuilder.directory(projectPath.toFile()); runProcessBuilder.redirectErrorStream(true); Process runProcess = runProcessBuilder.start(); // Imprime a saída do aplicativo em execução (opcional) new Thread(() -> { try (java.util.Scanner s = new java.util.Scanner(runProcess.getInputStream()).useDelimiter("\\A")) { String output = s.hasNext() ? s.next() : ""; System.out.println("Saída do Aplicativo:\n" + output); } }).start(); // Você precisará gerenciar o ciclo de vida do aplicativo em execução (por exemplo, pará-lo após um certo tempo). // Este exemplo não inclui isso. } public static void main(String... args) { int exitCode = new CommandLine(new CreateMcpServerCommand()).execute(args); System.exit(exitCode); } } ``` The Portuguese translation maintains the same structure and functionality as the English version, with all comments and messages translated. It's important to note that the code itself remains in English, as that's the language of the Java programming language. The translation focuses on the user-facing aspects of the code, such as the command-line options, descriptions, and output messages.

Desk3 MCP Server

Desk3 MCP Server

Cryptocurrency MCP Server! Free! This powerful tool is designed for blockchain enthusiasts, providing comprehensive, real-time cryptocurrency information at your fingertips. Whether you're an experienced trader or just starting your journey into the crypto world.

memora

memora

Persistent memory with knowledge graph visualization, semantic/hybrid search, importance scoring, and cloud sync (S3/R2) for cross-session context management.