Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make proxy a runnable jar from maven #125

Merged
merged 2 commits into from
Feb 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions devtools/stdio-sse-proxy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ The application can be packaged using:
This builds a Quarkus uber-jar that can be run directly:

```shell script
java -jar target/quarkus-mcp-stdio-sse-proxy-1.0.0-SNAPSHOT-runner.jar --help
java -jar target/quarkus-mcp-stdio-sse-proxy-1.0.0-SNAPSHOT.jar --help
```

Shows the following help message:

```shell script
Usage: stdio-sse-proxy [-hV] [--[no-]reconnect] -e=<sseEndpoint> [-s=<sleep>]
[-t=<timeout>]
-e, --endpoint=<sseEndpoint>
The URI of the target SSE endpoint
Usage: stdio-sse-proxy [-hV] [--[no-]reconnect] [-s=<sleep>] [-t=<timeout>]
<sseEndpoint>
<sseEndpoint> The URI of the target SSE endpoint
-h, --help Show this help message and exit.
--[no-]reconnect If set to true then the proxy attempts to reconnect
if a message endpoint returns http status 400
Expand All @@ -49,13 +48,17 @@ or if you need a custom endpoint:
java -jar target/quarkus-mcp-stdio-sse-proxy-1.0.0-SNAPSHOT-runner.jar http://my.app/mcp
```

> [!IMPORTANT]
> The target SSE endpoint is mandatory.

## JBang

You can also run the proxy as a JBang script:

```shell script
jbang --quiet src/main/java/io/quarkiverse/mcp/server/proxy/StdioSseProxy.java -h
```
jbang src/main/java/io/quarkiverse/mcp/server/proxy/StdioSseProxy.java -h
```

or when released to maven use:

```shell script
jbang io.quarkiverse.mcp:quarkus-mcp-stdio-sse-proxy:RELEASE -h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does the :RELEASE stand for? Is it handled specifically by JBang?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

standard maven coordinate syntax for getting latest released version (non-snapshot)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it? I've never heard about it. I mean, io.quarkiverse.mcp:quarkus-mcp-stdio-sse-proxy:RELEASE is not a valid Maven artifact coordinate (at least according to chatgpt and https://maven.apache.org/guides/mini/guide-naming-conventions.html). release is a valid qualifier but nothing more. But maybe I'm missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its been around since Maven 2 - see https://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-dependency/1172371#1172371

it is not jbang doing any interpretation here - its maven resolver and you can use <version>RELEASE</version> in your pom.xml dependencies (but not for plugins).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. The RELEASE and LATEST markers seem to be a deprecated legacy feature from Maven 2 ;-). At least, I wasn't able to find any official docs, except for https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=2852668#Maven3.xCompatibilityNotes-PluginMetaversionResolution.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is for plugins it was explicitly removed as makes builds irreproducible. still possible for resolver because it is useful - like in cases like this.

its like docker pull xyz:latest or sdk install quarkus where you just get the latest.

```

Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
quarkus.package.jar.type=uber-jar
quarkus.package.jar.add-runner-suffix=false
quarkus.log.console.stderr=true
#quarkus.log.category."io.quarkiverse.mcp.server.proxy".level=DEBUG