Soklet Logo

Model Context Protocol

MCP Public API Reference

Use this reference to find the types and extension points for server configuration, endpoint authoring, security policy, values, subscriptions, localization, metrics, and testing. Each table links to the type's Javadoc; nested types use Java's binary-name separator, $.

API stability and protocol support

Types marked 4.0 belong to the Soklet 4.0 API. Provisional marks the Tasks and 2025 session/HTTP admission APIs, whose contracts may change. A Java API's availability does not establish interoperability with a particular client or host. See Compatibility and Scope for supported revisions and known limitations.

Resource-not-found errors

Use this factory on McpJsonRpcError:

@NonNull
public static McpJsonRpcError fromResourceNotFound(@NonNull URI resourceUri);

It carries canonical -32602 and data.uri; the resource-read handler boundary renders -32002 for the two supported 2025 revisions. See Resource not found.

API conventions

These conventions apply across the APIs below:

Protocol names, identifiers, descriptions, instructions and error/progress/status messages reject unpaired UTF-16 surrogates with a sanitized IllegalArgumentException during construction or the setter, before changing builder state. Valid Unicode is retained; operation-specific byte and wire-size limits still apply later.

  • The transport is closed: McpServer is sealed and Soklet supplies the only implementation. Applications configure policy and handlers; they do not replace the MCP transport.
  • Exported scalar fields and signatures use reference types such as Integer, Long, Boolean, and Double. Values are non-null unless an explicit nullable contract says otherwise. Public constants also use reference types. Primitive exceptions are limited to <code>void</code>, language-required annotation elements, and overrides of external Java or Servlet contracts.
  • Most values and SPIs are thread-safe. Builders, McpHandlerContinuation, and exception objects are not. A handler, interceptor, limiter, admission controller, protector, publisher, listener, collector, or authorizer can be invoked concurrently unless its contract says otherwise.
  • JSON values and explicitly closed decision families support exhaustive switches. Content blocks, resource contents, subscription events, operation results and observability enums are evolutionary: constants or permitted subtypes may be added in Soklet 4.x, so application switches should include a safe default. Each type's Javadoc states its policy. Request state is exposed directly through mode-specific typed accessors. McpOperationResult is sealed to its six framework-owned result families; each MCP method accepts only compatible results.
  • McpOperationType is the high-level classification for application branching. The request, admission, and rate-limit contexts retain their exact JSON-RPC method strings for diagnostics, future protocol methods, and extensions; these classify as OTHER until recognized.
  • The typed complete-tool DSL and advanced operation-result DSL are intentionally different. Only the advanced tool builder can declare multi-round input and return <code>input_required</code>.
  • Annotation-driven and programmatic authoring are not perfectly symmetric. Review each annotation's exact elements rather than assuming every builder method is available as an annotation element.
  • Soklet supplies generated schemas and keyring snapshots; applications receive these values and catch McpProtectionKeyInUseException. These types have no public constructors.
  • Security defaults are deliberate: a present <code>Origin</code> is rejected when no CORS authorizer is configured; an absent <code>Origin</code> is allowed by default; Host validation is independent; unknown mirrored headers are ignored by default.
  • McpServer.Builder.logRawValidatedTraceIds(Boolean) is an explicit opt-in for high-cardinality logs. Production attempts the bounded LogEventType.MCP_TRACE_CORRELATION record at admitted-request finish; the raw validated trace ID never becomes a metric dimension or framework exception field.
  • Public identifiers use the compatibility spelling “Cancelation” with one <code>l</code>, as in McpMetricsEvent.CancelationSignaled.
  • Simulation exercises the real request processor off-network, but does not test listener sockets, operating-system buffers, or live write-idle behavior. It does not advertise an MCP capability.
  • Metric dimensions are intentionally bounded. Built-in semantic metrics do not label by principal, resource URI, mirrored-header name, trace value, argument, or result.
  • The 2025 session APIs are provisional and require both server ownership/bounds and explicit endpoint revision selection. Modern and default 2025 views remain stateless. Automatic host recovery remains unverified; see session configuration.
  • New CLIENT_CANCELED, SESSION_EXPIRED, and SESSION_CLOSED enum values require downstream exhaustive switches/mappings to be updated. CLIENT_CANCELED is a neutral cancelation-token category used for explicit client cancellation and for legacy session or grant retirement other than session expiry or server stop. Authorization loss, subscription lease/lifetime expiry and capacity eviction can use it; the value alone does not establish a client action. McpOperationType additionally names RESOURCES_SUBSCRIBE and RESOURCES_UNSUBSCRIBE; update exhaustive switches. Session closure and URI delivery are implemented; host-specific recovery remains unverified.
  • MCP Tasks are opt-in and application-backed. McpTaskManager is the durable state and authorization authority; Soklet does not own a database, queue, worker runtime, lease, fencing, or retry system. McpInMemoryTaskManager is an explicit process-local development helper and is never the server default.

API usage

Immutable value construction

Public MCP value carriers are final immutable classes, not Java records. They have private constructors, named factories or builders, conventional get... accessors, explicit value equality, and deliberate diagnostic rendering. Scalar JSON leaves use the McpJsonString.fromValue(...), McpJsonBoolean.fromValue(...), and McpJsonNumber.fromValue(...) factories with their respective McpJsonString.getValue(), McpJsonBoolean.getValue(), and McpJsonNumber.getValue() accessors. McpInputRequest.fromDeclaration(...) pairs a declaration with parameters; declarations retain only their four method-specific factories; and prompt messages use fromUserContent(...) or fromAssistantContent(...) with getRole() and getContent().

The sealed admission, rate-limit, localization, subscription, and metrics-event roots own construction through their named static factories. Their nested variants remain public so application adapters, collectors, and tests can use typed pattern matching, but the variant constructors are private and payloads use conventional getters. The aggregate EndpointMethodKey, RequestOutcomeKey, RequestStreamTerminationKey, and SubscriptionTerminationKey types expose the exact EndpointMethodKey.fromDimensions(String, String), RequestOutcomeKey.fromDimensions(String, String, McpRequestOutcome), RequestStreamTerminationKey.fromDimensions(String, String, McpStreamTerminationReason), and SubscriptionTerminationKey.fromDimensions(String, McpStreamTerminationReason) factories, respectively, plus conventional dimension getters. McpTraceCorrelationFingerprint is different: it is a returned-only final value exposed by Soklet controls and diagnostics, with getValue() and no public creation path.

Server construction

The builder entrypoint uses a boxed port:

McpServer.Builder mcpServerBuilder =
  McpServer.withPort(Integer.valueOf(8082));

Apply the required policies and call build() as shown in local MCP server configuration or the production example. The resulting server always uses a dedicated listener.

The builder discovers its endpoint registry from generated classpath metadata and accepts requests anonymously by default. endpointRegistry(...) and admissionController(...) override those defaults; passing null to either setter restores its default. Tool rate limiting is optional. A configured limiter resolves in tool, endpoint, then server-fallback order. A tool with no resolved limiter has no tool rate quota; transport and execution bounds remain in effect.

For annotated endpoints, McpEndpointRegistry supports immutable withSkillRegistrations(...) and withSkillGroups(...) copies selected by the exact annotated class. Each replaces its complete list (empty clears), preserves the other list and generated handlers, and validates the result. See the Skills composition examples.

Server settingDefaultConstraint or consequence
Host<code>127.0.0.1</code>Configure remote binding deliberately; Soklet does not terminate TLS.
PortRequired<code>0</code> requests an operating-system-assigned port; otherwise 0–65535.
Maximum cursor bytes4,096Positive UTF-8 bound for incoming and outgoing application cursors.
Request timeout60 secondsPositive, finite duration.
Handler concurrency32Server-wide application-handler slots.
Handler queue capacity128Bounded admitted queue before capacity rejection.
Stream queue capacity128Per request-scoped stream item bound.
Keep-alive interval15 secondsMust be shorter than the write timeout.
Write timeout30 secondsPositive stream write bound.
Maximum subscriptions per partition32Positive per-admitted authorization/quota-partition bound.
Maximum subscription duration24 hoursPositive lifetime bound.
CORS authorizerReject all present originsRequests without <code>Origin</code> use the separate absent-Origin policy.
Absent-Origin policyMcpAbsentOriginPolicy.ALLOWMay be changed to require <code>Origin</code>.
Unknown mirrored headersMcpUnknownMirroredHeaderPolicy.IGNOREStrict rejection applies to requests, not notifications.

allowedHosts(Set<String>) accepts hostname-only values. Explicitly allowed names accept a valid public port or an omitted port; automatic loopback aliases still require the listener port. Configured mirrored-header-name diagnostics can expose only bounded, sanitized header names; header values are never logged.

Endpoint and handler construction

Client McpImplementation name/version strings may be blank and are preserved exactly. Endpoint server information requires nonblank name/version strings.

Endpoint paths are normalized, absolute, non-root paths with no query or fragment. Each registry must contain at least one endpoint, and normalized endpoint paths must be unique. Within an endpoint, tool names, prompt names, exact resource URIs, and resource-template strings are independently unique.

The principal application handler signatures are shown here as owner-qualified signature notation:

McpOperationResult McpToolHandler<A>.handle(
  McpRequestContext requestContext,
  McpToolArguments<A> toolArguments,
  McpInvocationFeatures invocationFeatures
) throws Exception;

R McpCompleteToolHandler<A, R>.handle(
  McpRequestContext requestContext,
  McpToolArguments<A> toolArguments,
  McpInvocationFeatures invocationFeatures
) throws Exception;

McpOperationResult McpPromptHandler.handle(
  McpRequestContext requestContext,
  McpPromptGetContext promptGetContext,
  McpInvocationFeatures invocationFeatures
) throws Exception;

McpOperationResult McpResourceReadHandler.handle(
  McpRequestContext requestContext,
  McpResourceReadContext resourceReadContext,
  McpInvocationFeatures invocationFeatures
) throws Exception;

McpResourcePage McpResourceListHandler.handle(
  McpRequestContext requestContext,
  McpResourceListContext resourceListContext,
  McpInvocationFeatures invocationFeatures
) throws Exception;

Handlers and extension points must be safe for concurrent invocation. McpInvocationFeatures performs exact-class lookup, not assignable-type lookup. A supplied McpHandlerContinuation is synchronous, thread-bound, and one-shot; it cannot be retained or have proceed() called more than once.

Tool registration stages

McpToolRegistration.withName(String, Set<McpProtocolVersion>) begins a staged DSL with an explicitly selected, nonempty set of exact protocol revisions:

Tool names are 1–128 characters from <code>A-Z</code>, <code>a-z</code>, <code>0-9</code>, underscore, hyphen, and dot. McpToolSchema exposes a derived, fixed, or application-authored input Profile 1 document for inspection. Applications may submit an authored object-root input document through inputSchema(...), but cannot construct or replace McpToolSchema directly or author an output schema.

Multi-round input and state

An operation must declare every client request it may initiate. The supported declarations are form and URL modes of <code>elicitation/create</code>, with the matching capability derived by McpInputRequestDeclaration. A returned McpInputRequiredResult must contain at least one keyed input request, request state, or both.

Framework-protected state carries application JSON and is authenticated, operation-bound, authorization-bound, expiring, and round-limited. Application-protected state is an opaque nonempty string that Soklet passes through while the application independently owns protection, expiry, and validation. A custom McpRequestStateProtector is an alternative provider for framework-protected state, not the owner of McpRequestStateMode.APPLICATION_PROTECTED values. Request contexts and input-required results expose state through separate typed optional accessors; Soklet-owned logs and diagnostics continue to redact it. Input parameters and resource-update values retain their data-minimizing public renderings.

Durable MCP Tasks

McpServer.Builder.taskManager(McpTaskManager) opts a server into MCP Tasks; a missing manager means the server does not advertise or accept Tasks. A task-capable invocation exposes McpTaskCreationContext, whose getTaskOrigin() value must be persisted atomically with the application's work description before the handler returns McpTaskCreatedResult. Soklet later uses that opaque, non-wire origin to recover the original operation and enforce its result contract; it is not an authorization grant.

McpTaskManager remains authoritative for task state, retention, authorization, input-response idempotency, and durable cancelation intent. Every protocol lookup or mutation is independently admitted, then the manager must atomically authorize it against the task's application-owned binding. Unknown and unauthorized IDs are deliberately indistinguishable. Polling through <code>tasks/get</code> is authoritative; an optional McpTaskEventPublisher broadcasts task-ID-only hints, after which Soklet performs a fresh authorized lookup before emitting a notification.

McpTaskManager.fromInMemoryDefaults() and McpInMemoryTaskManager.builder() provide a bounded process-local implementation for tests, simulation, development, and deliberately ephemeral single-process applications. It has no durable persistence, shared-node coordination, work queue, worker, leases, fencing, retry, or crash recovery, and the server never selects it implicitly. See MCP Tasks for the wire lifecycle and production ownership model.

Progress, subscriptions, and resources

Progress reporting is conditional on the request's progress token. Accepted progress values must increase; an equal value is coalesced, a decrease throws while active, and reporting after cancelation or completion has no effect. Reporting is synchronous and can block on the bounded stream queue.

Subscription publishers broadcast only coarse resource-list changes and resource-URI updates. Soklet, not the publisher, owns authorization filtering, requested-URI filtering, coalescing, per-stream queues, backpressure, and wire encoding. Publisher registration close is idempotent, although a delivery already selected or in flight may finish.

A custom resource-list handler is the sole authority for its page; Soklet does not merge static registrations into the returned page. A page may be empty and an empty next cursor remains present. A successful resource read output must contain at least one content value. Exact registrations may declare a fixed size; template registrations deliberately cannot.

Diagnostics, tracing, simulation, and metrics

McpServer.getDiagnostics() returns an immutable McpServerDiagnostics snapshot. Lifecycle, capacity, handler, queue, stream, and subscription values form one runtime snapshot; protection and trace values form a separate security-control snapshot. There is no global linearization point spanning both domains. The invariant <code>0 <= activeSubscriptions <= activeRequestStreams</code> holds.

Trace-correlation keys use a 1–64-byte ASCII HTTP-token ID and at least 32 secret bytes. Key material is copied and never exposed. Rotation replaces one active key; no public historical-key or historical-token facility exists. Configuration fingerprints are operational comparison values, not authentication or token-derivation inputs.

Simulation response and completion reads are repeatable; successful stream-item reads are destructive. Defaults are 128 pending SSE items and 10 MiB of cumulative captured bytes. Consuming an item releases an item slot but never refunds captured bytes. Completion throwables retain exact application identities and may contain secrets, so callers own disclosure decisions.

Subscription-maintenance counts are available through McpMetricsSnapshot.getSubscriptionMaintenance() and McpMetricsSnapshot.Builder.subscriptionMaintenance(Map<SubscriptionMaintenanceKey, Long>) plus the nested immutable SubscriptionMaintenanceKey: its static fromDimensions(String endpointPath, McpMetricsEvent.SubscriptionMaintenance.Work maintenanceWork, McpMetricsEvent.SubscriptionMaintenance.Outcome maintenanceOutcome) factory, getEndpointPath(), getWork(), getOutcome(), equals(Object), hashCode() and toString(). The map's getter is nonnull; the builder accepts a nullable map with nonnull keys and boxed nonnull Long counts. The key factory/getters return nonnull values, factory parameters are nonnull, and equality accepts a nullable Object. Events expose only dimensions meaningful to each transition, and the aggregate snapshot uses final fixed-dimension key classes for endpoint, bounded method, outcome, and termination reason. The public McpMetricsEvent.protocolError(code) factory checks non-nullity, not the runtime's current fixed-code allowlist; do not treat an arbitrary application-created event as proof a code can be emitted by Soklet. McpMetricsEvent.CancelationSignaled intentionally has no reason field; bounded reasons remain on the cooperative token and cancelation exception with no framework cause.

API types by area

Server, endpoint, and discovery

TypeStabilityPurpose
com.soklet.McpEndpoint4.0Immutable exact-path endpoint catalog: implementation metadata, tools, prompts, resources, list handler, cache policy, limiter override, and optional subscriptions.
com.soklet.McpEndpoint$Builder4.0Single-threaded endpoint builder. Server information is required; custom resource listing is sole authority; direct and named limiter forms are last-call-wins.
com.soklet.McpEndpointRegistry4.0Immutable ordered endpoint registry with generated-class, classpath-index, and programmatic factories plus endpoint/subscription/Skills copy operations.
com.soklet.McpImplementation4.0Immutable advertised server implementation identity and optional presentation metadata.
com.soklet.McpImplementation$Builder4.0Single-threaded implementation-metadata builder primed with required name and version.
com.soklet.McpProtocolVersion4.0Enum of exact MCP wire revisions; declarations explicitly select supported endpoint and operation revisions.
com.soklet.McpServer4.0Sealed dedicated-listener configuration and control interface whose lifecycle is owned by its one-shot Soklet. Custom transports are not an extension point.
com.soklet.McpServer$Builder4.0Complete server configuration surface for bind, capacity, timeouts, policy, interception, sanitization, limiting, subscriptions, state protection, trace configuration, diagnostics, and Host validation.

Annotation-driven authoring

TypeStabilityPurpose
com.soklet.annotation.McpHeader4.0Parameter annotation binding one registered mirrored request header by name.
com.soklet.annotation.McpResourceList4.0Marker for an application-owned custom <code>resources/list</code> handler.
com.soklet.annotation.McpPrompt4.0Prompt method declaration: required name plus optional presentation and multi-round state declarations.
com.soklet.annotation.McpPromptArgument4.0Prompt string-argument name, title, and description declaration.
com.soklet.annotation.McpResource4.0Exact or templated resource method declaration with identity, MIME, size, cache, and multi-round state fields.
com.soklet.annotation.McpResourceUriParameter4.0Parameter annotation selecting one URI-template variable; inferred name is allowed when its value is empty.
com.soklet.annotation.McpServerEndpoint4.0Endpoint class declaration with path, implementation identity, instructions, named tool limiter, and list-cache defaults.
com.soklet.annotation.McpTool4.0Tool method declaration with identity, named limiter, structured-content mirroring, and multi-round state fields.
com.soklet.annotation.McpToolArgument4.0Tool argument name, title, and description declaration.
com.soklet.annotation.McpToolProperty4.0Record-component annotation publishing a typed tool property's stable name, title, and description. Requiredness is inferred from the component type.

Admission control and transport policy

TypeStabilityPurpose
com.soklet.McpAbsentOriginPolicy4.0Enum choosing whether requests without <code>Origin</code> are allowed or rejected.
com.soklet.McpAdmissionContext4.0Immutable pre-admission projection of a request or notification, endpoint, operation type and exact method, optional ID, protocol, client, capability, and trace information.
com.soklet.McpAdmissionDecision4.0Sealed accepted-or-rejected decision returned by the admission controller.
com.soklet.McpAdmissionDecision$Accepted4.0Factory-owned final accepted decision; public for typed matching, with getIdentity().
com.soklet.McpAdmissionDecision$Rejected4.0Factory-owned final rejected decision; public for typed matching, with getRejection().
com.soklet.McpAdmissionIdentity4.0Immutable anonymous or authenticated identity with rate-limit partition, optional principal, application context, and authorization partition.
com.soklet.McpAdmissionIdentity$Builder4.0Mutable identity builder. Partition keys are limited to 256 UTF-8 bytes; principal identity requires an authorization partition.
com.soklet.McpAdmissionController4.0Concurrent authentication, authorization, and admission controller for requests and notifications; includes a deliberate accept-all singleton.
com.soklet.McpAdmissionRejection4.0Immutable rejection combining an HTTP 400–599 status, JSON-RPC error, and safe response headers. Notification bodies remain suppressed.
com.soklet.McpAdmissionRejection$Builder4.0Mutable rejection builder with validation for status and response headers.
com.soklet.McpUnknownMirroredHeaderPolicy4.0Enum choosing ignore or strict request rejection for unregistered <code>Mcp-Param-*</code> headers.
com.soklet.McpCatalogAccessPolicy4.0Caller-aware tool and prompt visibility policy, including direct prompt Completion access.
com.soklet.McpCatalogAccessPolicy$PromptAccessEvaluator4.0Concurrent evaluator for one prompt and admitted caller.
com.soklet.McpCatalogAccessPolicy$ToolAccessEvaluator4.0Concurrent evaluator for one tool and admitted caller.

Rate limiting

TypeStabilityPurpose
com.soklet.McpRateLimitContext4.0Immutable limiter input containing target, admitted identity, endpoint, request, operation type and exact method, and optional tool name.
com.soklet.McpRateLimitDecision4.0Sealed allowed-or-denied limiter result.
com.soklet.McpRateLimitDecision$Allowed4.0Factory-owned stateless final allowed decision, public for typed matching.
com.soklet.McpRateLimitDecision$Denied4.0Factory-owned final denial with getRetryAfter().
com.soklet.McpRateLimitTarget4.0Enum distinguishing request-wide and tool-call charges.
com.soklet.McpRateLimiter4.0Concurrent acquire SPI plus a JVM-local token-bucket factory with explicit quotas.
com.soklet.McpRateLimiterRegistry4.0Immutable name-to-limiter registry used by annotation and programmatic overrides.
com.soklet.McpRateLimiterRegistry$Builder4.0Mutable registry builder with validated unique names.
com.soklet.McpTokenBucketConfig4.0Immutable token-bucket capacity and refill configuration.
com.soklet.McpTokenBucketConfig$Builder4.0Positive-value builder requiring explicit capacity, refill quantity, and interval.

Request context, results, interception, and errors

TypeStabilityPurpose
com.soklet.McpClientCapabilities4.0Immutable normalized client-capability projection with capability queries.
com.soklet.McpClientCapability4.0Fixed capabilities for form and URL elicitation.
com.soklet.McpCompletePayload4.0Sealed payload family for complete prompt, resource, and tool outputs.
com.soklet.McpCompleteResult4.0Framework complete-operation result and factories for method-compatible payloads.
com.soklet.McpHandlerInterceptor4.0Concurrent application-handler interceptor SPI with a shared pass-through implementation.
com.soklet.McpHandlerContinuation4.0Non-thread-safe synchronous, thread-bound, one-shot downstream continuation.
com.soklet.McpInvocationFeatures4.0Immutable exact-class feature collection with find/require helpers; feature values retain their own concurrency contracts.
com.soklet.McpJsonRpcError4.0Immutable JSON-RPC error with Soklet's fixed public rate-limit and strict-header codes plus application-error construction.
com.soklet.McpJsonRpcException4.0Application-thrown exception carrying a client-visible JSON-RPC error; exception instances are not thread-safe values.
com.soklet.McpOperationType4.0High-level inbound-operation enum for application branching; OTHER preserves forward compatibility while contexts retain the exact JSON-RPC method string.
com.soklet.McpOperationResult4.0Sealed result root for complete, input-required, task-created, argument-completion, resource-page, and Skill-page results; each operation accepts only compatible families.
com.soklet.McpRequestContext4.0Immutable admitted-request context: physical request, endpoint/path data, ID, protocol, operation type and exact method, client/capabilities, metadata, input responses, mode-specific typed retry state, trace/baggage, and identity.
com.soklet.McpRequestId4.0Immutable JSON-RPC string-or-integer ID with bounded sanitized rendering.
com.soklet.McpCompleteResult$Builder4.0Mutable complete-result builder preserving payload and result metadata through selective copies.
com.soklet.McpToolResultSanitizer4.0Concurrent complete-tool-result policy SPI receiving request, original tool name and arguments, and payload plus result metadata; includes the unchanged-result singleton.

Tools and schemas

TypeStabilityPurpose
com.soklet.McpCompleteToolHandler4.0Concurrent functional handler returning one supported typed complete Java value.
com.soklet.McpToolArguments4.0Immutable converted arguments plus exact raw JSON-object arguments.
com.soklet.McpToolHandler4.0Concurrent advanced handler returning a recognized, method-compatible operation result.
com.soklet.McpToolOutput4.0Immutable tool content, optional structured JSON, and boxed isError() result flag.
com.soklet.McpToolOutput$Builder4.0Mutable tool-output builder for content, structured data, and error status.
com.soklet.McpToolRegistration4.0Immutable tool descriptor with schema, handler, presentation metadata, annotations, limiter selection, mirroring, multi-round declarations, state mode, and extension metadata.
com.soklet.McpToolRegistration$OperationBuilder4.0Advanced-result mutable builder. This is the tool path that exposes multi-round input and request-state configuration.
com.soklet.McpToolRegistration$CompleteBuilder4.0Typed complete-result builder; deliberately cannot declare or return <code>input_required</code>.
com.soklet.McpToolRegistration$CompleteHandlerStage4.0Staged typed-argument/typed-result step requiring a complete handler before optional metadata.
com.soklet.McpToolRegistration$ArgumentTypeStage4.0First staged step selecting typed, advanced typed, or raw JSON-object argument modes.
com.soklet.McpToolRegistration$OperationHandlerStage4.0Staged advanced-argument step requiring an McpToolHandler.
com.soklet.McpToolAnnotations4.0Immutable MCP tool-hint metadata for client presentation and behavior hints.
com.soklet.McpToolAnnotations$Builder4.0Mutable tool-annotations builder. Hints are descriptive and not an authorization boundary.
com.soklet.McpToolSchema4.0Inspect-only derived, fixed, or application-authored input Tool Schema Profile 1 document; authored object-root input registration is available through McpToolRegistration.ArgumentTypeStage.inputSchema(...), while output schemas remain derived.

Prompts

TypeStabilityPurpose
com.soklet.McpPromptArgumentDeclaration4.0Immutable prompt argument declaration with nonblank name and boxed required flag.
com.soklet.McpPromptArgumentDeclaration$Builder4.0Mutable prompt-argument title, description, and required-state builder.
com.soklet.McpPromptGetContext4.0Immutable validated prompt arguments with exact string lookup.
com.soklet.McpPromptHandler4.0Concurrent prompt handler returning a recognized complete or input-required result.
com.soklet.McpPromptMessage4.0Final immutable prompt message created through user/assistant factories and read through getRole()/getContent().
com.soklet.McpPromptOutput4.0Immutable prompt description and ordered message payload.
com.soklet.McpPromptOutput$Builder4.0Mutable prompt-output builder.
com.soklet.McpPromptRegistration4.0Immutable prompt descriptor with arguments, handler, presentation data, multi-round declarations, state mode, and metadata.
com.soklet.McpPromptRegistration$Builder4.0Mutable prompt-registration builder after handler selection.
com.soklet.McpPromptRegistration$HandlerStage4.0Staged prompt-registration step requiring a handler.

Argument completion

TypeStabilityPurpose
com.soklet.McpArgumentCompletionResult4.0Immutable terminal Completion result with 0–100 strings and independent optional total/hasMore fields.
com.soklet.McpArgumentCompletionResult$Builder4.0Single-threaded result builder with validated counts and application metadata.
com.soklet.McpCompletionContext4.0Partial argument name/value and immutable supplied context arguments.
com.soklet.McpCompletionContext$Prompt4.0Completion context exposing its selected prompt registration.
com.soklet.McpCompletionContext$Resource4.0Completion context exposing its selected resource-template registration.
com.soklet.McpCompletionHandler4.0Concurrent callback returning exactly McpArgumentCompletionResult, with admitted request and invocation features.
com.soklet.annotation.McpPromptCompletion4.0Companion completer for a prompt in the same annotated endpoint.
com.soklet.annotation.McpResourceCompletion4.0Companion completer for a literal resource template in the same endpoint.

Resources, listing, and caching

TypeStabilityPurpose
com.soklet.McpResourceAddressType4.0Enum distinguishing exact URI and URI-template registrations.
com.soklet.McpResourceContents4.0Sealed text-or-blob resource contents with URI, optional MIME type, and metadata.
com.soklet.McpResourceDescriptor4.0Immutable list/discovery descriptor for one exact resource.
com.soklet.McpResourceDescriptor$Builder4.0Mutable resource-descriptor presentation, MIME, size, icon, annotation, and metadata builder.
com.soklet.McpResourceReadHandler4.0Concurrent exact/template read handler returning a compatible complete or input-required result.
com.soklet.McpResourceLink4.0Resource-link content block with URI, presentation metadata, optional MIME/size, annotations, and extension metadata.
com.soklet.McpResourceLink$Builder4.0Mutable resource-link builder.
com.soklet.McpResourceListContext4.0Immutable opaque cursor plus registered exact-resource descriptor conveniences for a custom list handler.
com.soklet.McpResourceListHandler4.0Concurrent sole-authority custom listing handler returning one page directly.
com.soklet.McpResourceOutput4.0Successful read payload requiring at least one text or blob content; may override only cache TTL.
com.soklet.McpResourceOutput$Builder4.0Mutable resource-output contents and TTL-override builder.
com.soklet.McpResourcePage4.0Immutable possibly-empty list page with metadata, exact optional next cursor, and TTL override.
com.soklet.McpResourcePage$Builder4.0Mutable page builder; an empty string cursor remains a present protocol value.
com.soklet.McpResourceReadContext4.0Immutable resolved resource URI plus exact template-variable map.
com.soklet.McpResourceRegistration4.0Immutable exact/template read registration with cache policy, multi-round state, handler, and discovery metadata.
com.soklet.McpResourceRegistration$ExactBuilder4.0Mutable exact-resource builder; uniquely supports fixed sizeInBytes(Long).
com.soklet.McpResourceRegistration$ExactHandlerStage4.0Staged exact-resource step requiring a handler.
com.soklet.McpResourceRegistration$TemplateBuilder4.0Mutable RFC 6570 Level 1 template builder; deliberately has no fixed-size control.
com.soklet.McpResourceRegistration$TemplateHandlerStage4.0Staged template-resource step requiring a handler.
com.soklet.McpTextResourceContents4.0Immutable UTF-8 text resource contents.
com.soklet.McpTextResourceContents$Builder4.0Mutable text-contents MIME and metadata builder.
com.soklet.McpBlobResourceContents4.0Immutable binary resource contents with defensively copied bytes.
com.soklet.McpBlobResourceContents$Builder4.0Mutable blob-contents MIME and metadata builder.
com.soklet.McpCachePolicy4.0Immutable public/private cache scope plus nonnegative whole-millisecond TTL; default is private no-cache.
com.soklet.McpCacheScope4.0Enum distinguishing public and private MCP cache hints.

Skills

TypeStabilityPurpose
com.soklet.McpSkillAccessPolicy4.0Independent access and discovery evaluators for configured Skills; access also protects exact lookup and file reads.
com.soklet.McpSkillAccessPolicy$AccessEvaluator4.0Concurrent per-request Skill access decision.
com.soklet.McpSkillAccessPolicy$DiscoveryEvaluator4.0Concurrent listing-visibility decision after access authorization.
com.soklet.McpSkillBundle4.0Immutable application-supplied file snapshot with parsed frontmatter and generated integrity metadata.
com.soklet.McpSkillGroup4.0Explicit immutable set of locale variants; no content translation or inferred grouping.
com.soklet.McpSkillListContext4.0Bounded cursor and authorized discovery candidates for custom Skill pagination.
com.soklet.McpSkillListHandler4.0Concurrent custom Skill-page callback returning configured registration identities.
com.soklet.McpSkillPage4.0Immutable page of at most 32 Skill manifests, optional cursor, metadata and TTL override.
com.soklet.McpSkillPage$Builder4.0Mutable Skill-page builder with whole-list replacement.
com.soklet.McpSkillRegistration4.0Canonical root URI and immutable bundle with generated manifest and cache policy.
com.soklet.McpSkillRegistration$Builder4.0Mutable Skill-registration builder.
com.soklet.McpSkillRegistration$Resource4.0Returned immutable file description with canonical URI, raw byte size and digest.
com.soklet.McpSkillVariantSelectionContext4.0Group key, authorized discoverable candidates and request-language preferences available to the application selector.
com.soklet.McpSkillVariantSelector4.0Concurrent selector choosing at most one exact configured registration per explicit group.

Content and presentation metadata

TypeStabilityPurpose
com.soklet.McpAudioContent4.0Immutable base64-wire audio content with defensive byte copying and MIME type.
com.soklet.McpAudioContent$Builder4.0Mutable audio annotations and extension-metadata builder.
com.soklet.McpContentAnnotations4.0Immutable audience, finite priority in [0,1], and last-modified metadata.
com.soklet.McpContentAnnotations$Builder4.0Mutable content-annotation builder.
com.soklet.McpContentBlock4.0Sealed audio, embedded-resource, image, resource-link, or text content family.
com.soklet.McpEmbeddedResource4.0Content block embedding text or blob resource contents with annotations and metadata.
com.soklet.McpEmbeddedResource$Builder4.0Mutable embedded-resource annotation and metadata builder.
com.soklet.McpIcon4.0Immutable icon source, optional MIME type, sizes, and theme.
com.soklet.McpIcon$Builder4.0Mutable icon descriptor builder.
com.soklet.McpIconTheme4.0Light or dark icon-theme enum.
com.soklet.McpImageContent4.0Immutable base64-wire image content with defensive byte copying and MIME type.
com.soklet.McpImageContent$Builder4.0Mutable image annotations and extension-metadata builder.
com.soklet.McpTextContent4.0Immutable text content block with annotations and extension metadata.
com.soklet.McpTextContent$Builder4.0Mutable text-content builder.
com.soklet.McpRole4.0User or assistant role used by content annotations and prompt messages.

Apps metadata

TypeStabilityPurpose
com.soklet.McpAppResourceMetadata4.0Immutable Apps resource presentation metadata, content-security policy, and permissions.
com.soklet.McpAppResourceMetadata$Builder4.0Mutable Apps resource-metadata builder with validated domain and policy fields.
com.soklet.McpAppResourceMetadata$ContentSecurityPolicy4.0Immutable validated origin declarations for Apps content-security policy.
com.soklet.McpAppResourceMetadata$ContentSecurityPolicy$Builder4.0Mutable builder for validated Apps content-security-policy origin sets.
com.soklet.McpAppResourceMetadata$Permission4.0Closed Apps resource-permission vocabulary; not an authorization grant.
com.soklet.McpAppToolMetadata4.0Immutable optional UI-resource association and tool audience set.
com.soklet.McpAppToolMetadata$Builder4.0Mutable Apps tool-metadata builder preserving explicit empty visibility.
com.soklet.McpAppToolMetadata$Visibility4.0Closed model/App audience vocabulary; visibility does not authorize invocation.
com.soklet.annotation.McpAppTool4.0Companion annotation for an existing tool with the same resource URI and audience rules as programmatic metadata.

Immutable JSON values

TypeStabilityPurpose
com.soklet.McpJsonArray4.0Immutable ordered JSON array.
com.soklet.McpJsonArray$Builder4.0Mutable array builder with value and scalar conveniences.
com.soklet.McpJsonBoolean4.0Final immutable boxed JSON boolean using fromValue(Boolean)/getValue().
com.soklet.McpJsonNull4.0Singleton JSON null enum value.
com.soklet.McpJsonNumber4.0Final immutable exact decimal JSON number using fromValue(BigDecimal)/getValue().
com.soklet.McpJsonObject4.0Immutable insertion-ordered JSON object with exact find/get accessors.
com.soklet.McpJsonObject$Builder4.0Mutable member builder with JSON-value and scalar overloads; doubles must be finite.
com.soklet.McpJsonString4.0Final immutable JSON string using fromValue(String)/getValue().
com.soklet.McpJsonValue4.0Sealed root permitting only array, boolean, null, number, object, and string values.

Multi-round input and request state

TypeStabilityPurpose
com.soklet.McpInputRequest4.0Final immutable request created with fromDeclaration(McpInputRequestDeclaration, McpJsonObject); declaration, method, and params use conventional getters and params render redacted.
com.soklet.McpInputRequestDeclaration4.0Final immutable method/capability/requirement value restricted to four method-specific factories and conventional getters.
com.soklet.McpInputRequestType4.0Enum selecting form or URL elicitation while deriving the JSON-RPC method and base capability.
com.soklet.McpInputRequiredResult4.0Multi-round operation result containing unique keyed input requests, mode-specific typed retry state, or both, plus metadata.
com.soklet.McpInputRequiredResult$Builder4.0Mutable input-required builder. Repeated input keys fail; request-state setters replace one another.
com.soklet.McpInputRequirement4.0Enum distinguishing required versus capability-conditional client input.
com.soklet.McpInputResponses4.0Immutable retry responses with exact JSON and intrinsic typed lookup; also constructible as an application test fixture. Typed lookup converts only: the application owns response-key correlation, accept/decline/cancel branching, missing-key re-request policy, and accepted-content validation.
com.soklet.McpInputResponses$Builder4.0Mutable test-fixture builder whose repeated response keys are last-call-wins.
com.soklet.McpRequestStateMode4.0Enum selecting no state, framework-protected state, or application-protected state for an operation.
com.soklet.annotation.McpMayRequestInput4.0Runtime-retained nested annotation value declaring an elicitation mode and required/conditional semantics. It has no target sites of its own.

Progress

TypeStabilityPurpose
com.soklet.McpProgressReporter4.0Conditional invocation feature for synchronous monotonic progress delivery with queue backpressure.
com.soklet.McpProgressUpdate4.0Immutable finite progress value plus optional finite total and human-readable message.
com.soklet.McpProgressUpdate$Builder4.0Mutable total/message builder primed with required progress. Negative zero is normalized to JSON zero.

Request-state protection

TypeStabilityPurpose
com.soklet.McpProtectionKeyInUseException4.0Catch-only transient failure raised when a verification key still has sealing reservations; no public constructor.
com.soklet.McpProtectionConfig4.0Immutable exclusive protection-provider selection plus encoded/decoded size, lifetime, and round bounds.
com.soklet.McpProtectionConfig$Builder4.0Mutable limits builder created by exactly one keyring, custom-protector, or development-ephemeral factory.
com.soklet.McpProtectionKeyringManager4.0Thread-safe server-owned production keyring manager: inspect, stage, activate, rotate, and remove.
com.soklet.McpProtectionKey4.0Immutable 1–64-byte HTTP-token ID plus at least 32 defensively copied secret bytes; public rendering is redacted.
com.soklet.McpProtectionKeyring4.0Immutable initial production keyring containing one active key and optional verification-only keys.
com.soklet.McpProtectionKeyring$Builder4.0Mutable keyring builder primed with the active key; validates distinct IDs and key material.
com.soklet.McpProtectionKeyringFingerprint4.0Secret-free output fingerprint for a complete production keyring; application code receives rather than constructs it.
com.soklet.McpProtectionKeyringSnapshot4.0Secret-free output snapshot of active/verification IDs and configuration fingerprint; no public constructor.
com.soklet.McpProtectionMode4.0Enum for no framework keys, custom protector, production keyring, or development-ephemeral protection.
com.soklet.McpRequestStateProtectionContext4.0Endpoint/protocol/method and associated-data context passed to a custom protector; Soklet creates runtime values and applications can use fromComponents(String, McpProtocolVersion, String, byte[]) for tests.
com.soklet.McpRequestStateProtectionException4.0Protector failure with fixed invalid-state or protector-unavailable reason.
com.soklet.McpRequestStateProtectionException$Reason4.0Enum distinguishing client-invalid state from temporary protector unavailability.
com.soklet.McpRequestStateProtector4.0Concurrent application SPI for sealing and reopening framework-bound request-state bytes.

Resource subscriptions

TypeStabilityPurpose
com.soklet.McpSubscriptionConfig4.0Immutable endpoint-scoped event publisher and nonempty resource-notification family set; Soklet does not own publisher lifecycle.
com.soklet.McpSubscriptionConfig$Builder4.0Mutable config builder primed with an application publisher and requiring at least one notification type.
com.soklet.McpSubscriptionEvent4.0Sealed coarse resource-change event family; endpoint/client/authorization selection remains Soklet's responsibility.
com.soklet.McpSubscriptionEvent$ResourceUpdated4.0Factory-owned final URI-update variant with getResourceUri() and redacted rendering.
com.soklet.McpSubscriptionEvent$ResourcesListChanged4.0Factory-owned stateless final variant instructing subscribed clients to list resources again.
com.soklet.McpSubscriptionEventListener4.0Concurrent internal-delivery listener SPI implemented by Soklet stream subscriptions or application adapters.
com.soklet.McpSubscriptionEventPublisher4.0Application broadcast SPI with subscribe/publish plus resource-change convenience methods and the built-in fromInMemoryDefaults() factory. It does not own wire delivery.
com.soklet.McpSubscriptionEventRegistration4.0Idempotently closable listener registration; an already-selected delivery may finish after close.
com.soklet.McpSubscriptionNotificationType4.0Enum for resource-list-changed and resource-updated notification support.
com.soklet.McpSubscriptionAuthorization4.0Allowed/denied application decision for a subscription authorization lease.
com.soklet.McpSubscriptionAuthorization$Allowed4.0Allowed decision with finite validity and optional application context.
com.soklet.McpSubscriptionAuthorization$Allowed$Builder4.0Single-threaded allowed-decision builder.
com.soklet.McpSubscriptionAuthorization$Denied4.0Factory-owned denied authorization decision.
com.soklet.McpSubscriptionAuthorizationContext4.0Bounded authorization input preserving the initial admitted request and selected filters.
com.soklet.McpSubscriptionAuthorizer4.0Application SPI for initial subscription authorization and bounded renewal.
com.soklet.McpSubscriptionEvent$PromptsListChanged4.0Coarse prompt-catalog invalidation event.
com.soklet.McpSubscriptionEvent$ToolsListChanged4.0Coarse tool-catalog invalidation event.
com.soklet.McpSubscriptionReconciler4.0Server-local control that fences delivery and schedules fresh subscription authorization checks.

Durable Tasks

TypeStabilityPurpose
com.soklet.McpInMemoryTaskManagerProvisionalExplicit bounded, process-local manager for development, tests, simulation, and deliberately ephemeral applications. It is never selected implicitly and is not a production backend.
com.soklet.McpInMemoryTaskManager$BuilderProvisionalSingle-threaded builder for retained-task capacity, finite task lifetime, and advertised polling interval.
com.soklet.McpTaskProvisionalImmutable authoritative task snapshot carrying opaque origin, status, timestamps, optional retention and polling hints, exactly one status-compatible payload, and application metadata.
com.soklet.McpTask$BuilderProvisionalSingle-threaded task builder that enforces timestamp, duration, input-request, terminal-result, failure, and status/payload invariants.
com.soklet.McpTaskCreationContextProvisionalInvocation-scoped feature exposing the admitted request and framework-derived non-wire origin required for safe durable task creation. It is not durable worker state.
com.soklet.McpTaskCreatedResultProvisionalTyped handler result naming a task that is already durably readable and whose persisted origin must match the current invocation.
com.soklet.McpTaskEventListenerProvisionalConcurrent listener for coarse task-ID-only change hints; it carries no task state or authorization decision.
com.soklet.McpTaskEventPublisherProvisionalBroadcast publisher SPI for already-durable task changes, plus an explicit process-local implementation. Polling remains authoritative and Soklet does a fresh lookup before notification.
com.soklet.McpTaskManagerProvisionalConcurrent application authority for durable state, retention, per-request authorization, input updates, cancelation intent, and optional change publication. It does not run workers.
com.soklet.McpTaskNotFoundExceptionProvisionalFixed, non-disclosing checked signal used identically for an unknown task and an unauthorized task mutation.
com.soklet.McpTaskOriginProvisionalImmutable opaque framework state persisted with the task so later nodes can recover the original operation and enforce its deferred output contract. It is never rendered on the wire.
com.soklet.McpTaskRequestContextProvisionalImmutable independently admitted lookup or cancelation input containing the current request and requested task ID; the manager must still authorize it.
com.soklet.McpTaskStatusProvisionalFive-state task vocabulary: working, input required, completed, failed, and canceled, with the specification-required two-L spelling preserved only on the wire.
com.soklet.McpTaskUpdateContextProvisionalImmutable independently admitted task input-response update. The manager owns atomic authorization, correlation, deduplication, and idempotent acceptance.

2025 sessions and HTTP admission

TypeStabilityPurpose
com.soklet.McpSessionConfigProvisionalImmutable 2025 session ownership/bounds configuration plus an optional HTTP admission controller; explicitly enabled endpoint revisions only, with no modern session lifecycle.
com.soklet.McpSessionConfig$BuilderProvisionalRequired owner resolver plus positive count/byte/lifetime limits and explicit anonymous opt-in; null tuning values restore provisional defaults.
com.soklet.McpSessionOwnerKeyResolverProvisionalConcurrent local nonblocking callback deriving a stable opaque owner key from the freshly admitted identity; not a wire credential or quota-partition substitute.
com.soklet.McpSessionTransportAdmissionContextProvisionalOriginal HTTP Request, selected endpoint/revision, offered notification families, reauthorization flag, and queue-inclusive callback deadline; no invented RPC method/context.
com.soklet.McpSessionTransportAdmissionControllerProvisionalConcurrent fresh GET/DELETE authorization with bounded cancellation features; progress and task creation are unavailable.
com.soklet.McpSessionTransportAdmissionDecisionProvisionalClosed accepted/rejected domain; acceptance requires explicit expiry and a subset of the offered GET families. DELETE requires an empty family set.
com.soklet.McpSessionTransportAdmissionDecision$AcceptedProvisionalPrivate construction through the decision factory; fresh identity, explicit expiry and copied immutable family selection.
com.soklet.McpSessionTransportAdmissionDecision$RejectedProvisionalPrivate construction carrying the existing HTTP rejection status/headers; its JSON-RPC error is not rendered on GET/DELETE.

Localization

TypeStabilityPurpose
com.soklet.McpLocalizableText4.0Immutable framework-owned presentation field carrying a structured coordinate and canonical default text; rendering redacts both.
com.soklet.McpLocalizationCatalog4.0Deterministic extraction view of every eligible configured source field from the final endpoint registry.
com.soklet.McpLocalizationContext4.0Soklet-owned immutable request-local selected locale, optional revision, and bounded lookup callback, constructed through withLocale(Locale, McpLocalizationLookup).
com.soklet.McpLocalizationContext$Builder4.0Single-threaded context builder for the optional revision and required immutable-snapshot lookup callback.
com.soklet.McpLocalizationContextProvider4.0Concurrent application SPI that selects and builds one Soklet-owned localization context from bounded admitted-request inputs.
com.soklet.McpLocalizationFailurePolicy4.0Enum selecting whole-response canonical fallback or a fixed sanitized request failure.
com.soklet.McpLocalizationLookup4.0Concurrent request-local lookup over an already captured immutable catalog snapshot.
com.soklet.McpLocalizationRequest4.0Bounded provider input: admitted request context, language ranges, verified continuation locale, custom list cursor, and fallback locale.
com.soklet.McpLocalizationResult4.0Sealed data-only result family for localized text, intentional default text, or unexpected failure.
com.soklet.McpLocalizationResult$Failure4.0Factory-owned data-free final lookup-failure variant that triggers the configured whole-response policy.
com.soklet.McpLocalizationResult$Localized4.0Factory-owned final successful text variant with getText(), including provider-managed fallback.
com.soklet.McpLocalizationResult$UseDefaultText4.0Factory-owned data-free final selection of the configured canonical source text.
com.soklet.McpLocalizationRevision4.0Optional bounded visible-ASCII identity for one immutable application catalog snapshot.
com.soklet.McpLocalizer4.0Immutable server-wide fallback locale, provider, response-failure policy, and lookup-count bound.
com.soklet.McpLocalizer$Builder4.0Single-threaded policy builder with a 32,768 default and 1–100,000 supported response lookup bound.
com.soklet.McpTextCoordinate4.0Immutable endpoint/owner-type/subject/member identity with a versioned domain-separated opaque external key, exposed through getOwnerType().
com.soklet.McpTextOwnerType4.0Six-value owner category for server information, endpoint, tool, prompt, resource, and resource-template text.
com.soklet.McpLocalizationCatalogInvalidator4.0Server-local coarse invalidation control for installed localization snapshots.

Diagnostics

TypeStabilityPurpose
com.soklet.McpServerDiagnostics4.0Immutable 12-getter snapshot of lifecycle/bind/capacity/runtime counts plus protection and trace configuration. Runtime and security tuples have separate linearization points.
com.soklet.McpServerStatus4.0Seven-state enum distinguishing not-started, starting, running, shutting-down, proven-terminated, residual-activity, and termination-unknown states.

Trace-correlation control

TypeStabilityPurpose
com.soklet.McpTraceCorrelationKeyManager4.0Thread-safe server-owned trace-correlation key manager exposing enabled state, active key ID, fingerprint, and atomic active-key rotation; it retains no public history.
com.soklet.McpTraceCorrelationFingerprint4.0Returned-only final 43-character canonical unpadded Base64URL SHA-256 configuration fingerprint, read through getValue().
com.soklet.McpTraceCorrelationKey4.0Immutable trace-only key with constrained non-secret ID and at least 32 copied secret bytes; key material is never exposed.

Off-network simulation

TypeStabilityPurpose
com.soklet.McpSimulation4.0Thread-safe async handle with timed response/completion reads, destructive awaitStreamItem(Duration) reads, completion check, and idempotent disconnect through close().
com.soklet.McpSimulationBodyType4.0Enum distinguishing empty, bounded JSON, and SSE bodies.
com.soklet.McpSimulationCompletion4.0Immutable termination reason, optional duplicated terminal SSE JSON, and exact ordered throwables; throwable disclosure is caller-owned.
com.soklet.McpSimulationOptions4.0Immutable positive item and cumulative-byte capture bounds, with shared 128-item/10-MiB defaults.
com.soklet.McpSimulationOptions$Builder4.0Mutable simulation-bound builder. Consumed items do not refund the cumulative byte budget.
com.soklet.McpSimulationResponse4.0Immutable status, insertion-ordered/coalesced headers, body type, and defensive optional body bytes.
com.soklet.McpSimulationStreamItem4.0One exactly encoded SSE JSON-message or keep-alive-comment item with defensive frame bytes.
com.soklet.McpSimulationStreamItemType4.0Enum distinguishing JSON message frames from keep-alive comment frames.
com.soklet.Simulator4.0Shared Soklet testing host with default-options and explicit-options asynchronous MCP request entry points.

Semantic metric events

TypeStabilityPurpose
com.soklet.McpMetricsEvent4.0Factory-owning sealed root for 23 public final semantic transition variants and the bounded <code><unrecognized></code> method sentinel. No generic label bag is exposed.
com.soklet.McpMetricsEvent$CancelationSignaled4.0Endpoint/method event for accepted cooperative cancelation signaling. It intentionally has no reason field or framework cause; compatibility spelling uses one <code>l</code>.
com.soklet.McpMetricsEvent$ConnectionAccepted4.0Zero-dimension event for a TCP connection accepted within capacity.
com.soklet.McpMetricsEvent$ConnectionRejected4.0Zero-dimension event for connection-capacity rejection.
com.soklet.McpMetricsEvent$HandlerCapacityRejected4.0Zero-dimension event for bounded application-handler queue rejection.
com.soklet.McpMetricsEvent$HandlerDequeued4.0Zero-dimension event for application work leaving the bounded handler queue.
com.soklet.McpMetricsEvent$HandlerExecutionFinished4.0Zero-dimension event for release of a reserved handler slot after actual exit or failed submission.
com.soklet.McpMetricsEvent$HandlerExecutionStarted4.0Zero-dimension event for acquisition of an application-handler execution slot.
com.soklet.McpMetricsEvent$HandlerQueued4.0Zero-dimension event for entry into the bounded handler queue.
com.soklet.McpMetricsEvent$KeepAliveEmitted4.0Zero-dimension event when a keep-alive comment is accepted for delivery.
com.soklet.McpMetricsEvent$ProgressEmitted4.0Endpoint/method event when progress is accepted for delivery.
com.soklet.McpMetricsEvent$ProtocolError4.0Fixed JSON-RPC/MCP error-code event with getCode(). Its outer factory checks non-nullity; runtime production remains allowlisted.
com.soklet.McpMetricsEvent$RequestAccepted4.0Zero-dimension event for HTTP request acceptance into the bounded protocol processor.
com.soklet.McpMetricsEvent$RequestFinished4.0Endpoint/method/outcome/nonnegative-duration event for client-visible admitted-request completion.
com.soklet.McpMetricsEvent$RequestRejected4.0Zero-dimension event for rejection before admitted semantic handling. It is not the complement of processor acceptance.
com.soklet.McpMetricsEvent$RequestStarted4.0Endpoint/method event for admitted semantic request start.
com.soklet.McpMetricsEvent$RequestStreamClosed4.0Endpoint/method/reason/nonnegative-duration event for response-stream close.
com.soklet.McpMetricsEvent$RequestStreamOpened4.0Endpoint/method event for response-stream open.
com.soklet.McpMetricsEvent$ServerStarted4.0Zero-dimension event for one successfully started real listener generation. Simulation does not emit it.
com.soklet.McpMetricsEvent$ServerStopped4.0Shutdown-component-disposition event for one completed real-listener stop.
com.soklet.McpMetricsEvent$SubscriptionClosed4.0Endpoint/reason/nonnegative-duration event for resource-subscription termination.
com.soklet.McpMetricsEvent$SubscriptionOpened4.0Endpoint event for an active resource subscription.
com.soklet.McpMetricsEvent$TransportFailure4.0Fixed shared transport-failure-reason event for the dedicated MCP transport.
com.soklet.McpMetricsEvent$UnknownMirroredHeader4.0Endpoint/method occurrence count that deliberately omits the attacker-controlled header name.
com.soklet.McpMetricsEvent$SubscriptionMaintenance4.0Bounded subscription authorization/reconciliation work event.
com.soklet.McpMetricsEvent$SubscriptionMaintenance$Outcome4.0Fixed subscription-maintenance outcome vocabulary.
com.soklet.McpMetricsEvent$SubscriptionMaintenance$Work4.0Fixed subscription-maintenance work classification.

Aggregate semantic metrics

TypeStabilityPurpose
com.soklet.McpMetricsSnapshot4.0Immutable complete MCP metric aggregate: gauges, counters, fixed-dimension maps, and duration histograms.
com.soklet.McpMetricsSnapshot$Builder4.0Mutable aggregate builder validating nonnegative counts and complete fixed-dimension values.
com.soklet.McpMetricsSnapshot$EndpointMethodKey4.0Final fromDimensions(String, String) endpoint/method key with conventional getters for cancelation, progress, and unknown-header counters.
com.soklet.McpMetricsSnapshot$RequestOutcomeKey4.0Final fromDimensions(String, String, McpRequestOutcome) endpoint/method/outcome key with conventional getters for completed-request counts and durations.
com.soklet.McpMetricsSnapshot$RequestStreamTerminationKey4.0Final fromDimensions(String, String, McpStreamTerminationReason) endpoint/method/reason key with conventional getters for request-stream duration histograms.
com.soklet.McpMetricsSnapshot$SubscriptionMaintenanceKey4.0Immutable endpoint/work/outcome key for delivered subscription-maintenance counts, with fromDimensions(String endpointPath, Work maintenanceWork, Outcome maintenanceOutcome), conventional getters, value equality and redacted diagnostics.
com.soklet.McpMetricsSnapshot$SubscriptionTerminationKey4.0Final fromDimensions(String, McpStreamTerminationReason) endpoint/reason key with conventional getters for subscription duration histograms.

Terminal vocabularies

TypeStabilityPurpose
com.soklet.McpRequestOutcome4.0Ten client-visible admitted-request outcomes: complete, input required, rejected, application/protocol/internal error, canceled, deadline, disconnect, and write failure.
com.soklet.McpStreamTerminationReason4.0Sixteen bounded request-stream/subscription reasons, including explicit session expiry/closure alongside request, transport, server, and simulator causes. Host-specific DELETE recovery remains unverified.

Shared Soklet APIs

TypeStabilityPurpose
com.soklet.CorsAuthorizer4.0Shared Origin-policy SPI. MCP uses its transport-neutral preflight overload; that default rejects until explicitly overridden.
com.soklet.LifecycleObserver4.0Shared lifecycle SPI with MCP server start/stop/failure and admitted request start/finish callbacks. Finish is client-visible completion, not necessarily handler exit.
com.soklet.LogEventType4.0Shared log-event enum containing MCP configuration, mirrored-header, lifecycle-callback-failure, transport, and bounded MCP_TRACE_CORRELATION event kinds.
com.soklet.MetricsCollector4.0Shared collector SPI; receives immutable semantic MCP events. Implementations must be concurrent, prompt, and non-blocking.
com.soklet.MetricsCollector$Snapshot4.0Shared immutable metrics snapshot with a non-null MCP aggregate attachment.
com.soklet.MetricsCollector$Snapshot$Builder4.0Mutable shared-snapshot builder with the MCP aggregate setter.
com.soklet.SokletConfig4.0Application configuration that can own an independently configured McpServer.
com.soklet.SokletConfig$Builder4.0Mutable application-config builder; installs or removes the MCP server.

Referenced shared APIs

ShutdownComponentType.MCP identifies the MCP lifecycle component. SimulatorConfig.Builder.configureMcpServer(Consumer) customizes the MCP server used for simulation. MCP lifecycle callbacks carry shared ShutdownComponentResult and ShutdownComponentDisposition values.

MCP handlers and annotation injection also use established Soklet and JDK types:

When using these dependencies, a sensitive Throwable, mutable principal, or application-context object retains its own disclosure and thread-safety risks when carried through an otherwise immutable MCP value.

Construction and extension boundaries

KindApplication action
Builders and ordinary valuesConstruct through their documented static factory or builder. Builders are single-threaded; built values are normally immutable and thread-safe.
Handler, policy, limiter, interceptor, sanitizer, protector, publisher, listener, collector, and authorizer interfacesImplement as an application extension point and assume concurrent calls unless the interface explicitly narrows the contract.
McpServerConfigure Soklet's built-in sealed implementation; do not implement a custom server transport.
Sealed JSON/content/resource/decision/state/event rootsConstruct a permitted framework value; do not add an implementation.
McpOperationResultReturn only the framework result compatible with the invoked operation; do not invent a result implementation.
McpToolSchemaInspect the schema document; do not construct or replace the carrier itself. The advanced tool-registration DSL separately accepts a validated application-authored input schema through inputSchema(McpJsonObject).
Keyring snapshots and McpProtectionKeyInUseExceptionReceive or catch them; they are not application-constructed values.
McpTaskManagerImplement the application-specific durable state, authorization, and mutation authority. Use the explicit in-memory implementation only where process-local ephemeral state is acceptable.
McpTaskOriginPersist and return its opaque state without interpretation; protect it as sensitive framework data and never expose it on the wire.

For task-oriented explanations, continue with Endpoint Authoring, Tools and Schemas, Prompts and Resources, Input and Request State, Progress and Subscriptions, MCP Tasks, Security and Policy, Server Configuration, Observability and Testing, and Localization.

Transport streaming completion preparation

LifecycleObserver.willWriteResponseStream(StreamingResponseHandle) and MetricsCollector.willWriteResponseStream(StreamingResponseHandle) are default methods that declare the transport's guarantee of a later termination callback. See Custom HTTP streaming completion for callback order and decorator forwarding.

Previous
Compatibility