This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch feat/mcp-sdk-1.0.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-mcp-server.git

commit 767dc53ab0bd15d4e38f64a3b48e6bebc50bc4ad
Merge: c71dfc0 efeaaee
Author: Robert Munteanu <[email protected]>
AuthorDate: Thu Mar 12 14:06:53 2026 +0100

    Merge branch 'master' into feat/mcp-sdk-1.0.0

 README.md                                          |   7 +-
 bnd-legacy.bnd                                     |  15 +++
 bnd.bnd                                            |   3 +-
 pom.xml                                            | 112 +++++++++++++++++++--
 .../appended-resources-legacy/META-INF/LICENSE     |  13 +++
 src/main/appended-resources-legacy/META-INF/NOTICE |   2 +
 src/main/appended-resources/META-INF/LICENSE       |  14 +++
 .../apache/sling/mcp/server/impl/McpServlet.java   |  61 +++++++----
 .../libs/sling/mcp/prompts/new-sling-servlet.md    |  17 ----
 .../libs/sling/mcp/prompts/troubleshoot.md         |  45 ---------
 10 files changed, 200 insertions(+), 89 deletions(-)

diff --cc bnd-legacy.bnd
index 0000000,8a6fd89..ff9d505
mode 000000,100644..100644
--- a/bnd-legacy.bnd
+++ b/bnd-legacy.bnd
@@@ -1,0 -1,18 +1,15 @@@
 -# 1. workaround for 
https://github.com/modelcontextprotocol/java-sdk/issues/562
 -# 2. compatibility with javax.servlet
 -Private-Package: io.modelcontextprotocol.json.jackson, \
 -    io.modelcontextprotocol.json.schema.jackson, \
 -    jakarta.servlet, \
++# ensure compatibility with javax.servlet
++Private-Package: jakarta.servlet, \
+     jakarta.servlet.annotation, \
+     jakarta.servlet.descriptor, \
+     jakarta.servlet.http, \
+     org.apache.felix.http.jakartawrappers, \
+     org.apache.felix.http.javaxwrappers
+ 
+ # compatibility with slf4j 1.7 and 2.0. A bit of the gamble since we assume 
that libraries
+ # that compile against slf4j 2.x only use 1.7 APIs
+ Import-Package:  org.slf4j;version="[1.7,2)", \
+     *
+ 
+ # Strictly control exports to prevent bnd from exporting packages that from 
embedded dependencies
+ -exportcontents: org.apache.sling.mcp.server.spi
diff --cc bnd.bnd
index 10d3666,a4ad25e..926f9d6
--- a/bnd.bnd
+++ b/bnd.bnd
@@@ -1,1 -1,6 +1,2 @@@
- Sling-Initial-Content: 
SLING-INF/libs/sling/mcp/prompts;path:=/libs/sling/mcp/prompts;overwrite:=true
 -# workaround for https://github.com/modelcontextprotocol/java-sdk/issues/562
 -Private-Package: io.modelcontextprotocol.json.jackson, \
 -    io.modelcontextprotocol.json.schema.jackson
 -
+ # Strictly control exports to prevent bnd from exporting packages that from 
embedded dependencies
+ -exportcontents: org.apache.sling.mcp.server.spi
diff --cc src/main/java/org/apache/sling/mcp/server/impl/McpServlet.java
index 0fda4c6,2ba0354..8aa953d
--- a/src/main/java/org/apache/sling/mcp/server/impl/McpServlet.java
+++ b/src/main/java/org/apache/sling/mcp/server/impl/McpServlet.java
@@@ -99,9 -102,12 +100,12 @@@ public class McpServlet extends SlingAl
  
          transportProvider = HttpServletStatelessServerTransport.builder()
                  .messageEndpoint(ENDPOINT)
 -                .jsonMapper(jsonMapper)
 +                .jsonMapper(McpJsonDefaults.getMapper())
-                 .contextExtractor(request -> McpTransportContext.create(
-                         Map.of("resourceResolver", 
((SlingJakartaHttpServletRequest) request).getResourceResolver())))
+                 .contextExtractor(request -> 
McpTransportContext.create(Map.of(
+                         "resourceResolver",
+                         ((BridgedJakartaHttpServletRequest) request)
+                                 .getSlingRequest()
+                                 .getResourceResolver())))
                  .build();
  
          MethodHandles.Lookup privateLookup =

Reply via email to