Class Endpoint

java.lang.Object
hudson.security.csrf.CrumbExclusion
io.jenkins.plugins.mcp.server.Endpoint
All Implemented Interfaces:
ExtensionPoint, Action, ModelObject, RootAction, HttpServletFilter

@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Extension public class Endpoint extends CrumbExclusion implements RootAction, HttpServletFilter
  • Field Details

    • MCP_SERVER

      public static final String MCP_SERVER
      See Also:
    • SSE_ENDPOINT

      public static final String SSE_ENDPOINT
      See Also:
    • MCP_SERVER_SSE

      public static final String MCP_SERVER_SSE
      See Also:
    • STREAMABLE_ENDPOINT

      public static final String STREAMABLE_ENDPOINT
      See Also:
    • MCP_SERVER_STREAMABLE

      public static final String MCP_SERVER_STREAMABLE
      See Also:
    • STATELESS_ENDPOINT

      public static final String STATELESS_ENDPOINT
      See Also:
    • MCP_SERVER_STATELESS

      public static final String MCP_SERVER_STATELESS
      See Also:
    • MCP_SERVER_MESSAGE

      public static final String MCP_SERVER_MESSAGE
      See Also:
    • USER_ID

      public static final String USER_ID
    • HTTP_SERVLET_REQUEST

      public static final String HTTP_SERVLET_REQUEST
    • REQUIRE_ORIGIN_HEADER

      public static boolean REQUIRE_ORIGIN_HEADER
      Whether to require the Origin header in requests. Default is false, can be overridden by setting the system property io.jenkins.plugins.mcp.server.Endpoint.requireOriginHeader=true.
    • REQUIRE_ORIGIN_MATCH

      public static boolean REQUIRE_ORIGIN_MATCH
      Whether to require the Origin header to match the Jenkins root URL. Default is true, can be overridden by setting the system property io.jenkins.plugins.mcp.server.Endpoint.requireOriginMatch=false. The header will be validated only if present.
    • DISABLE_MCP_STATELESS

      public static boolean DISABLE_MCP_STATELESS
      Whether to disable the stateless MCP endpoint. Default is false (enabled). The stateless endpoint is available at /mcp-server/stateless
    • DISABLE_MCP_SSE

      public static boolean DISABLE_MCP_SSE
      Whether to disable the SSE MCP endpoint. Default is false (enabled). The SSE endpoint is available at /mcp-server/sse
    • DISABLE_MCP_STREAMABLE

      public static boolean DISABLE_MCP_STREAMABLE
      Whether to disable the streamable HTTP MCP endpoint. Default is false (enabled). The streamable endpoint is available at /mcp-server/mcp
  • Constructor Details

    • Endpoint

      public Endpoint()
  • Method Details

    • getRequestedResourcePath

      public static String getRequestedResourcePath(jakarta.servlet.http.HttpServletRequest httpServletRequest)
    • process

      public boolean process(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, jakarta.servlet.FilterChain chain) throws IOException, jakarta.servlet.ServletException
      Overrides:
      process in class CrumbExclusion
      Throws:
      IOException
      jakarta.servlet.ServletException
    • init

      protected void init() throws jakarta.servlet.ServletException
      Throws:
      jakarta.servlet.ServletException
    • handle

      public boolean handle(jakarta.servlet.http.HttpServletRequest req, jakarta.servlet.http.HttpServletResponse resp) throws IOException, jakarta.servlet.ServletException
      Specified by:
      handle in interface HttpServletFilter
      Throws:
      IOException
      jakarta.servlet.ServletException
    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action