Skip to content

Instantly share code, notes, and snippets.

View ehsavoie's full-sized avatar

Emmanuel Hugonnet ehsavoie

View GitHub Profile
@ehsavoie
ehsavoie / ChicoryMcpServer.java
Created March 18, 2025 12:01
Chicory MCP Server
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17+
//REPOS mavencentral,jboss=https://repository.jboss.org/
//DEPS org.wildfly.bom:wildfly-expansion:${wildfly.version:35.0.1.Final}@pom
//DEPS org.wildfly:wildfly-ai-bom:0.4.2@pom
//DEPS org.wildfly.glow:wildfly-glow:1.3.3.Final
//DEPS jakarta.ws.rs:jakarta.ws.rs-api
//DEPS jakarta.enterprise:jakarta.enterprise.cdi-api
//DEPS org.wildfly:wildfly-mcp-api
//DEPS org.extism.sdk:chicory-sdk:0.1.3
@ehsavoie
ehsavoie / SimpleMcpServer.java
Last active March 18, 2025 12:13
Simple MCP server with JBang (you need the beans.xml file next to the java file)
///usr/bin/env jbang "$0" "$@" ; exit $?
//JAVA 17+
//REPOS mavencentral,jboss=https://repository.jboss.org/
//DEPS org.wildfly.bom:wildfly-expansion:${wildfly.version:35.0.1.Final}@pom
//DEPS org.wildfly:wildfly-ai-bom:0.4.2@pom
//DEPS org.wildfly.glow:wildfly-glow:1.3.3.Final
//DEPS jakarta.ws.rs:jakarta.ws.rs-api
//DEPS jakarta.enterprise:jakarta.enterprise.cdi-api
//DEPS org.wildfly:wildfly-mcp-api
//GLOW --spaces=incubating --server-version=35.0.1.Final
@ehsavoie
ehsavoie / myaiapp.java
Last active March 17, 2025 08:06 — forked from jmesnil/myaiapp.java
myaiapp.java
///usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS org.wildfly.bom:wildfly-expansion:35.0.1.Final@pom
//DEPS org.wildfly:wildfly-ai-bom:1.0.0-SNAPSHOT@pom
//DEPS org.wildfly.glow:wildfly-glow:1.3.2.Final
//DEPS jakarta.ws.rs:jakarta.ws.rs-api
//DEPS jakarta.enterprise:jakarta.enterprise.cdi-api
//DEPS dev.langchain4j:langchain4j
//GLOW --spaces=incubating
import dev.langchain4j.data.message.*;
//DEPS info.picocli:picocli:4.7.5
//JAVA 21
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Callable;
import picocli.CommandLine;
import picocli.CommandLine.Command;
{
"name" : "artemis-cli-2.16.0.redhat-00022.jar",
"version" : "",
"attributes" : {
"path" : "org/apache/activemq/artemis/main/artemis-cli-2.16.0.redhat-00022.jar",
"module-root" : "/home/ehsavoie/tmp/patched_7411/jboss-eap-7.4/modules/system/layers/base",
"overridden" : "true"
}
}, {
"name" : "artemis-cli-2.16.0.redhat-00032.jar",
wildfly-configuration:
subsystem:
logging:
console-handler:
CONSOLE:
level: !undefine
logger:
org.jboss.resteasy:
level: TRACE
undertow:
@ehsavoie
ehsavoie / SchemaPusher.java
Last active March 28, 2023 06:59
SchemaPusher.java
package com.redhat.schemas.schemapusher;
//DEPS info.picocli:picocli:4.7.0
//DEPS com.hierynomus:sshj:0.34.0
//DEPS org.bouncycastle:bcpkix-jdk18on:1.72
//DEPS org.bouncycastle:bcprov-jdk18on:1.72
//DEPS org.bouncycastle:bcutil-jdk18on:1.72
//DEPS org.slf4j:slf4j-api:2.0.5
//DEPS org.slf4j:slf4j-reload4j:2.0.5
//DEPS ch.qos.reload4j:reload4j:1.2.24
@ehsavoie
ehsavoie / SimpleHttpServer.java
Last active December 14, 2022 14:11
SimpleServer
//DEPS info.picocli:picocli:4.7.0
//JAVA 19
import com.sun.net.httpserver.SimpleFileServer;
import com.sun.net.httpserver.HttpServer;
import java.io.File;
import java.net.InetSocketAddress;
import java.util.concurrent.Callable;
import picocli.CommandLine;
import picocli.CommandLine.Command;
wildfly-configuration:
subsystem:
datasources:
jdbc-driver:
postgresql:
driver-name: postgresql
driver-xa-datasource-class-name: org.postgresql.xa.PGXADataSource
driver-module-name: org.postgresql.jdbc
data-source:
PostgreSQLDS:
//usr/bin/env jbang "$0" "$@" ; exit $?
//DEPS info.picocli:picocli:4.2.0
//DEPS org.eclipse.jgit:org.eclipse.jgit:5.8.1.202007141445-r
import org.eclipse.jgit.api.ListBranchCommand;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Ref;
import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;