Skip to content

Fix formatting and additional prod verification steps #2299

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

Merged
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
19 changes: 14 additions & 5 deletions _posts/2025-04-28-secure-mcp-sse-server.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,16 @@ Launch https://modelcontextprotocol.io/docs/tools/inspector[MCP inspector]:
npx @modelcontextprotocol/inspector
----

Paste the copied GitHub access token to the `Bearer Token` field and connect to the Quarkus MCP SSE server:
[NOTE]
====
Ensure that you have https://github.com/modelcontextprotocol/inspector/releases/tag/0.6.0[modelcontextprotocol/inspector] version 0.6.0 or later installed as it adds support for specifying bearer token authentication.
====

Navigate to the URL provided into a browser.

Change the _Transport Type_ dropdown to `SSE` and the _URL_ to `http://localhost:8080/mcp/sse` so that it targets the running Quarkus MCP Server:

Select the _Authorization_ button and paste the copied GitHub access token from the browser to the `Bearer Token` field and connect to the Quarkus MCP SSE server:

image::mcp_inspector_connect.png[MCP Inspector Connect,align="center"]

Expand All @@ -329,7 +338,7 @@ You will see the name from your GitHub account returned.

Finally, let's use `curl` and also learn a little bit how both the MCP protocol and MCP SSE transport work.

First, access the main SSE endpoint without the GitHub access token:
First, open a new terminal window and access the main SSE endpoint without the GitHub access token:

[source,shell]
----
Expand All @@ -338,7 +347,7 @@ curl -v localhost:8080/mcp/sse

You will get HTTP 401 error.

Use the access token to access MCP server:
Use the access token that was obtained previously to access MCP server:

```shell script
curl -v -H "Authorization: Bearer gho_..." localhost:8080/mcp/sse
Expand All @@ -357,7 +366,7 @@ data: /messages/ZTZjZDE5MzItZDE1ZC00NzBjLTk0ZmYtYThiYTgwNzI1MGJ
The SSE connection is created. Note the unique path in the received `data`, we need this path to invoke the tools.
We cannot invoke the tool directly, we first need to follow the MCP handshake protocol.

Open another window and use the same access token to initialize the curl as MCP client, and access the tool, using the value of the `data` property to build the target URL.
Open another terminal window and use the same GitHub access token to initialize the curl as MCP client, and access the tool, using the value of the `data` property to build the target URL.

Send the client initialization request:

Expand Down Expand Up @@ -429,7 +438,7 @@ where the `call.json` file has a content like this:
}
----

Now look at the SSE connection window and you will see the name from your GitHub account returned.
Now look at the terminal window containing the SSE connection and you will see the name from your GitHub account returned.

== Conclusion

Expand Down
Loading