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);
@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:
McpServeris 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, andDouble. 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.
McpOperationResultis sealed to its six framework-owned result families; each MCP method accepts only compatible results. McpOperationTypeis 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 asOTHERuntil 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 boundedLogEventType.MCP_TRACE_CORRELATIONrecord 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, andSESSION_CLOSEDenum values require downstream exhaustive switches/mappings to be updated.CLIENT_CANCELEDis 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.McpOperationTypeadditionally namesRESOURCES_SUBSCRIBEandRESOURCES_UNSUBSCRIBE; update exhaustive switches. Session closure and URI delivery are implemented; host-specific recovery remains unverified. - MCP Tasks are opt-in and application-backed.
McpTaskManageris the durable state and authorization authority; Soklet does not own a database, queue, worker runtime, lease, fencing, or retry system.McpInMemoryTaskManageris 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));
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 setting | Default | Constraint or consequence |
|---|---|---|
| Host | <code>127.0.0.1</code> | Configure remote binding deliberately; Soklet does not terminate TLS. |
| Port | Required | <code>0</code> requests an operating-system-assigned port; otherwise 0–65535. |
| Maximum cursor bytes | 4,096 | Positive UTF-8 bound for incoming and outgoing application cursors. |
| Request timeout | 60 seconds | Positive, finite duration. |
| Handler concurrency | 32 | Server-wide application-handler slots. |
| Handler queue capacity | 128 | Bounded admitted queue before capacity rejection. |
| Stream queue capacity | 128 | Per request-scoped stream item bound. |
| Keep-alive interval | 15 seconds | Must be shorter than the write timeout. |
| Write timeout | 30 seconds | Positive stream write bound. |
| Maximum subscriptions per partition | 32 | Positive per-admitted authorization/quota-partition bound. |
| Maximum subscription duration | 24 hours | Positive lifetime bound. |
| CORS authorizer | Reject all present origins | Requests without <code>Origin</code> use the separate absent-Origin policy. |
| Absent-Origin policy | McpAbsentOriginPolicy.ALLOW | May be changed to require <code>Origin</code>. |
| Unknown mirrored headers | McpUnknownMirroredHeaderPolicy.IGNORE | Strict 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;
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:
argumentAndOutputTypes(Class, Class),argumentAndOutputTypes(Class, TypeReference),argumentAndOutputTypes(TypeReference, Class), andargumentAndOutputTypes(TypeReference, TypeReference)select typed arguments and typed complete results.argumentType(Class)andargumentType(TypeReference)select typed arguments with an advancedMcpToolHandlerresult.jsonObjectArguments()selects an immutableMcpJsonObjectargument and a fixed object input schema.inputSchema(McpJsonObject)selects validated immutable JSON-object arguments under an application-authored Profile 1 object-root input schema.CompleteBuilderconfigures a typed complete result and deliberately has no equivalents ofOperationBuilder.inputRequestDeclarations(List)orOperationBuilder.requestStateMode(McpRequestStateMode).OperationBuilderconfigures the advanced result path and may return a compatibleMcpCompleteResultorMcpInputRequiredResult.
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
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpEndpoint | 4.0 | Immutable exact-path endpoint catalog: implementation metadata, tools, prompts, resources, list handler, cache policy, limiter override, and optional subscriptions. |
com.soklet.McpEndpoint$Builder | 4.0 | Single-threaded endpoint builder. Server information is required; custom resource listing is sole authority; direct and named limiter forms are last-call-wins. |
com.soklet.McpEndpointRegistry | 4.0 | Immutable ordered endpoint registry with generated-class, classpath-index, and programmatic factories plus endpoint/subscription/Skills copy operations. |
com.soklet.McpImplementation | 4.0 | Immutable advertised server implementation identity and optional presentation metadata. |
com.soklet.McpImplementation$Builder | 4.0 | Single-threaded implementation-metadata builder primed with required name and version. |
com.soklet.McpProtocolVersion | 4.0 | Enum of exact MCP wire revisions; declarations explicitly select supported endpoint and operation revisions. |
com.soklet.McpServer | 4.0 | Sealed 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$Builder | 4.0 | Complete server configuration surface for bind, capacity, timeouts, policy, interception, sanitization, limiting, subscriptions, state protection, trace configuration, diagnostics, and Host validation. |
Annotation-driven authoring
| Type | Stability | Purpose |
|---|---|---|
com.soklet.annotation.McpHeader | 4.0 | Parameter annotation binding one registered mirrored request header by name. |
com.soklet.annotation.McpResourceList | 4.0 | Marker for an application-owned custom <code>resources/list</code> handler. |
com.soklet.annotation.McpPrompt | 4.0 | Prompt method declaration: required name plus optional presentation and multi-round state declarations. |
com.soklet.annotation.McpPromptArgument | 4.0 | Prompt string-argument name, title, and description declaration. |
com.soklet.annotation.McpResource | 4.0 | Exact or templated resource method declaration with identity, MIME, size, cache, and multi-round state fields. |
com.soklet.annotation.McpResourceUriParameter | 4.0 | Parameter annotation selecting one URI-template variable; inferred name is allowed when its value is empty. |
com.soklet.annotation.McpServerEndpoint | 4.0 | Endpoint class declaration with path, implementation identity, instructions, named tool limiter, and list-cache defaults. |
com.soklet.annotation.McpTool | 4.0 | Tool method declaration with identity, named limiter, structured-content mirroring, and multi-round state fields. |
com.soklet.annotation.McpToolArgument | 4.0 | Tool argument name, title, and description declaration. |
com.soklet.annotation.McpToolProperty | 4.0 | Record-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
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpAbsentOriginPolicy | 4.0 | Enum choosing whether requests without <code>Origin</code> are allowed or rejected. |
com.soklet.McpAdmissionContext | 4.0 | Immutable pre-admission projection of a request or notification, endpoint, operation type and exact method, optional ID, protocol, client, capability, and trace information. |
com.soklet.McpAdmissionDecision | 4.0 | Sealed accepted-or-rejected decision returned by the admission controller. |
com.soklet.McpAdmissionDecision$Accepted | 4.0 | Factory-owned final accepted decision; public for typed matching, with getIdentity(). |
com.soklet.McpAdmissionDecision$Rejected | 4.0 | Factory-owned final rejected decision; public for typed matching, with getRejection(). |
com.soklet.McpAdmissionIdentity | 4.0 | Immutable anonymous or authenticated identity with rate-limit partition, optional principal, application context, and authorization partition. |
com.soklet.McpAdmissionIdentity$Builder | 4.0 | Mutable identity builder. Partition keys are limited to 256 UTF-8 bytes; principal identity requires an authorization partition. |
com.soklet.McpAdmissionController | 4.0 | Concurrent authentication, authorization, and admission controller for requests and notifications; includes a deliberate accept-all singleton. |
com.soklet.McpAdmissionRejection | 4.0 | Immutable rejection combining an HTTP 400–599 status, JSON-RPC error, and safe response headers. Notification bodies remain suppressed. |
com.soklet.McpAdmissionRejection$Builder | 4.0 | Mutable rejection builder with validation for status and response headers. |
com.soklet.McpUnknownMirroredHeaderPolicy | 4.0 | Enum choosing ignore or strict request rejection for unregistered <code>Mcp-Param-*</code> headers. |
com.soklet.McpCatalogAccessPolicy | 4.0 | Caller-aware tool and prompt visibility policy, including direct prompt Completion access. |
com.soklet.McpCatalogAccessPolicy$PromptAccessEvaluator | 4.0 | Concurrent evaluator for one prompt and admitted caller. |
com.soklet.McpCatalogAccessPolicy$ToolAccessEvaluator | 4.0 | Concurrent evaluator for one tool and admitted caller. |
Rate limiting
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpRateLimitContext | 4.0 | Immutable limiter input containing target, admitted identity, endpoint, request, operation type and exact method, and optional tool name. |
com.soklet.McpRateLimitDecision | 4.0 | Sealed allowed-or-denied limiter result. |
com.soklet.McpRateLimitDecision$Allowed | 4.0 | Factory-owned stateless final allowed decision, public for typed matching. |
com.soklet.McpRateLimitDecision$Denied | 4.0 | Factory-owned final denial with getRetryAfter(). |
com.soklet.McpRateLimitTarget | 4.0 | Enum distinguishing request-wide and tool-call charges. |
com.soklet.McpRateLimiter | 4.0 | Concurrent acquire SPI plus a JVM-local token-bucket factory with explicit quotas. |
com.soklet.McpRateLimiterRegistry | 4.0 | Immutable name-to-limiter registry used by annotation and programmatic overrides. |
com.soklet.McpRateLimiterRegistry$Builder | 4.0 | Mutable registry builder with validated unique names. |
com.soklet.McpTokenBucketConfig | 4.0 | Immutable token-bucket capacity and refill configuration. |
com.soklet.McpTokenBucketConfig$Builder | 4.0 | Positive-value builder requiring explicit capacity, refill quantity, and interval. |
Request context, results, interception, and errors
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpClientCapabilities | 4.0 | Immutable normalized client-capability projection with capability queries. |
com.soklet.McpClientCapability | 4.0 | Fixed capabilities for form and URL elicitation. |
com.soklet.McpCompletePayload | 4.0 | Sealed payload family for complete prompt, resource, and tool outputs. |
com.soklet.McpCompleteResult | 4.0 | Framework complete-operation result and factories for method-compatible payloads. |
com.soklet.McpHandlerInterceptor | 4.0 | Concurrent application-handler interceptor SPI with a shared pass-through implementation. |
com.soklet.McpHandlerContinuation | 4.0 | Non-thread-safe synchronous, thread-bound, one-shot downstream continuation. |
com.soklet.McpInvocationFeatures | 4.0 | Immutable exact-class feature collection with find/require helpers; feature values retain their own concurrency contracts. |
com.soklet.McpJsonRpcError | 4.0 | Immutable JSON-RPC error with Soklet's fixed public rate-limit and strict-header codes plus application-error construction. |
com.soklet.McpJsonRpcException | 4.0 | Application-thrown exception carrying a client-visible JSON-RPC error; exception instances are not thread-safe values. |
com.soklet.McpOperationType | 4.0 | High-level inbound-operation enum for application branching; OTHER preserves forward compatibility while contexts retain the exact JSON-RPC method string. |
com.soklet.McpOperationResult | 4.0 | Sealed result root for complete, input-required, task-created, argument-completion, resource-page, and Skill-page results; each operation accepts only compatible families. |
com.soklet.McpRequestContext | 4.0 | Immutable 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.McpRequestId | 4.0 | Immutable JSON-RPC string-or-integer ID with bounded sanitized rendering. |
com.soklet.McpCompleteResult$Builder | 4.0 | Mutable complete-result builder preserving payload and result metadata through selective copies. |
com.soklet.McpToolResultSanitizer | 4.0 | Concurrent 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
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpCompleteToolHandler | 4.0 | Concurrent functional handler returning one supported typed complete Java value. |
com.soklet.McpToolArguments | 4.0 | Immutable converted arguments plus exact raw JSON-object arguments. |
com.soklet.McpToolHandler | 4.0 | Concurrent advanced handler returning a recognized, method-compatible operation result. |
com.soklet.McpToolOutput | 4.0 | Immutable tool content, optional structured JSON, and boxed isError() result flag. |
com.soklet.McpToolOutput$Builder | 4.0 | Mutable tool-output builder for content, structured data, and error status. |
com.soklet.McpToolRegistration | 4.0 | Immutable tool descriptor with schema, handler, presentation metadata, annotations, limiter selection, mirroring, multi-round declarations, state mode, and extension metadata. |
com.soklet.McpToolRegistration$OperationBuilder | 4.0 | Advanced-result mutable builder. This is the tool path that exposes multi-round input and request-state configuration. |
com.soklet.McpToolRegistration$CompleteBuilder | 4.0 | Typed complete-result builder; deliberately cannot declare or return <code>input_required</code>. |
com.soklet.McpToolRegistration$CompleteHandlerStage | 4.0 | Staged typed-argument/typed-result step requiring a complete handler before optional metadata. |
com.soklet.McpToolRegistration$ArgumentTypeStage | 4.0 | First staged step selecting typed, advanced typed, or raw JSON-object argument modes. |
com.soklet.McpToolRegistration$OperationHandlerStage | 4.0 | Staged advanced-argument step requiring an McpToolHandler. |
com.soklet.McpToolAnnotations | 4.0 | Immutable MCP tool-hint metadata for client presentation and behavior hints. |
com.soklet.McpToolAnnotations$Builder | 4.0 | Mutable tool-annotations builder. Hints are descriptive and not an authorization boundary. |
com.soklet.McpToolSchema | 4.0 | Inspect-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
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpPromptArgumentDeclaration | 4.0 | Immutable prompt argument declaration with nonblank name and boxed required flag. |
com.soklet.McpPromptArgumentDeclaration$Builder | 4.0 | Mutable prompt-argument title, description, and required-state builder. |
com.soklet.McpPromptGetContext | 4.0 | Immutable validated prompt arguments with exact string lookup. |
com.soklet.McpPromptHandler | 4.0 | Concurrent prompt handler returning a recognized complete or input-required result. |
com.soklet.McpPromptMessage | 4.0 | Final immutable prompt message created through user/assistant factories and read through getRole()/getContent(). |
com.soklet.McpPromptOutput | 4.0 | Immutable prompt description and ordered message payload. |
com.soklet.McpPromptOutput$Builder | 4.0 | Mutable prompt-output builder. |
com.soklet.McpPromptRegistration | 4.0 | Immutable prompt descriptor with arguments, handler, presentation data, multi-round declarations, state mode, and metadata. |
com.soklet.McpPromptRegistration$Builder | 4.0 | Mutable prompt-registration builder after handler selection. |
com.soklet.McpPromptRegistration$HandlerStage | 4.0 | Staged prompt-registration step requiring a handler. |
Argument completion
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpArgumentCompletionResult | 4.0 | Immutable terminal Completion result with 0–100 strings and independent optional total/hasMore fields. |
com.soklet.McpArgumentCompletionResult$Builder | 4.0 | Single-threaded result builder with validated counts and application metadata. |
com.soklet.McpCompletionContext | 4.0 | Partial argument name/value and immutable supplied context arguments. |
com.soklet.McpCompletionContext$Prompt | 4.0 | Completion context exposing its selected prompt registration. |
com.soklet.McpCompletionContext$Resource | 4.0 | Completion context exposing its selected resource-template registration. |
com.soklet.McpCompletionHandler | 4.0 | Concurrent callback returning exactly McpArgumentCompletionResult, with admitted request and invocation features. |
com.soklet.annotation.McpPromptCompletion | 4.0 | Companion completer for a prompt in the same annotated endpoint. |
com.soklet.annotation.McpResourceCompletion | 4.0 | Companion completer for a literal resource template in the same endpoint. |
Resources, listing, and caching
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpResourceAddressType | 4.0 | Enum distinguishing exact URI and URI-template registrations. |
com.soklet.McpResourceContents | 4.0 | Sealed text-or-blob resource contents with URI, optional MIME type, and metadata. |
com.soklet.McpResourceDescriptor | 4.0 | Immutable list/discovery descriptor for one exact resource. |
com.soklet.McpResourceDescriptor$Builder | 4.0 | Mutable resource-descriptor presentation, MIME, size, icon, annotation, and metadata builder. |
com.soklet.McpResourceReadHandler | 4.0 | Concurrent exact/template read handler returning a compatible complete or input-required result. |
com.soklet.McpResourceLink | 4.0 | Resource-link content block with URI, presentation metadata, optional MIME/size, annotations, and extension metadata. |
com.soklet.McpResourceLink$Builder | 4.0 | Mutable resource-link builder. |
com.soklet.McpResourceListContext | 4.0 | Immutable opaque cursor plus registered exact-resource descriptor conveniences for a custom list handler. |
com.soklet.McpResourceListHandler | 4.0 | Concurrent sole-authority custom listing handler returning one page directly. |
com.soklet.McpResourceOutput | 4.0 | Successful read payload requiring at least one text or blob content; may override only cache TTL. |
com.soklet.McpResourceOutput$Builder | 4.0 | Mutable resource-output contents and TTL-override builder. |
com.soklet.McpResourcePage | 4.0 | Immutable possibly-empty list page with metadata, exact optional next cursor, and TTL override. |
com.soklet.McpResourcePage$Builder | 4.0 | Mutable page builder; an empty string cursor remains a present protocol value. |
com.soklet.McpResourceReadContext | 4.0 | Immutable resolved resource URI plus exact template-variable map. |
com.soklet.McpResourceRegistration | 4.0 | Immutable exact/template read registration with cache policy, multi-round state, handler, and discovery metadata. |
com.soklet.McpResourceRegistration$ExactBuilder | 4.0 | Mutable exact-resource builder; uniquely supports fixed sizeInBytes(Long). |
com.soklet.McpResourceRegistration$ExactHandlerStage | 4.0 | Staged exact-resource step requiring a handler. |
com.soklet.McpResourceRegistration$TemplateBuilder | 4.0 | Mutable RFC 6570 Level 1 template builder; deliberately has no fixed-size control. |
com.soklet.McpResourceRegistration$TemplateHandlerStage | 4.0 | Staged template-resource step requiring a handler. |
com.soklet.McpTextResourceContents | 4.0 | Immutable UTF-8 text resource contents. |
com.soklet.McpTextResourceContents$Builder | 4.0 | Mutable text-contents MIME and metadata builder. |
com.soklet.McpBlobResourceContents | 4.0 | Immutable binary resource contents with defensively copied bytes. |
com.soklet.McpBlobResourceContents$Builder | 4.0 | Mutable blob-contents MIME and metadata builder. |
com.soklet.McpCachePolicy | 4.0 | Immutable public/private cache scope plus nonnegative whole-millisecond TTL; default is private no-cache. |
com.soklet.McpCacheScope | 4.0 | Enum distinguishing public and private MCP cache hints. |
Skills
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpSkillAccessPolicy | 4.0 | Independent access and discovery evaluators for configured Skills; access also protects exact lookup and file reads. |
com.soklet.McpSkillAccessPolicy$AccessEvaluator | 4.0 | Concurrent per-request Skill access decision. |
com.soklet.McpSkillAccessPolicy$DiscoveryEvaluator | 4.0 | Concurrent listing-visibility decision after access authorization. |
com.soklet.McpSkillBundle | 4.0 | Immutable application-supplied file snapshot with parsed frontmatter and generated integrity metadata. |
com.soklet.McpSkillGroup | 4.0 | Explicit immutable set of locale variants; no content translation or inferred grouping. |
com.soklet.McpSkillListContext | 4.0 | Bounded cursor and authorized discovery candidates for custom Skill pagination. |
com.soklet.McpSkillListHandler | 4.0 | Concurrent custom Skill-page callback returning configured registration identities. |
com.soklet.McpSkillPage | 4.0 | Immutable page of at most 32 Skill manifests, optional cursor, metadata and TTL override. |
com.soklet.McpSkillPage$Builder | 4.0 | Mutable Skill-page builder with whole-list replacement. |
com.soklet.McpSkillRegistration | 4.0 | Canonical root URI and immutable bundle with generated manifest and cache policy. |
com.soklet.McpSkillRegistration$Builder | 4.0 | Mutable Skill-registration builder. |
com.soklet.McpSkillRegistration$Resource | 4.0 | Returned immutable file description with canonical URI, raw byte size and digest. |
com.soklet.McpSkillVariantSelectionContext | 4.0 | Group key, authorized discoverable candidates and request-language preferences available to the application selector. |
com.soklet.McpSkillVariantSelector | 4.0 | Concurrent selector choosing at most one exact configured registration per explicit group. |
Content and presentation metadata
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpAudioContent | 4.0 | Immutable base64-wire audio content with defensive byte copying and MIME type. |
com.soklet.McpAudioContent$Builder | 4.0 | Mutable audio annotations and extension-metadata builder. |
com.soklet.McpContentAnnotations | 4.0 | Immutable audience, finite priority in [0,1], and last-modified metadata. |
com.soklet.McpContentAnnotations$Builder | 4.0 | Mutable content-annotation builder. |
com.soklet.McpContentBlock | 4.0 | Sealed audio, embedded-resource, image, resource-link, or text content family. |
com.soklet.McpEmbeddedResource | 4.0 | Content block embedding text or blob resource contents with annotations and metadata. |
com.soklet.McpEmbeddedResource$Builder | 4.0 | Mutable embedded-resource annotation and metadata builder. |
com.soklet.McpIcon | 4.0 | Immutable icon source, optional MIME type, sizes, and theme. |
com.soklet.McpIcon$Builder | 4.0 | Mutable icon descriptor builder. |
com.soklet.McpIconTheme | 4.0 | Light or dark icon-theme enum. |
com.soklet.McpImageContent | 4.0 | Immutable base64-wire image content with defensive byte copying and MIME type. |
com.soklet.McpImageContent$Builder | 4.0 | Mutable image annotations and extension-metadata builder. |
com.soklet.McpTextContent | 4.0 | Immutable text content block with annotations and extension metadata. |
com.soklet.McpTextContent$Builder | 4.0 | Mutable text-content builder. |
com.soklet.McpRole | 4.0 | User or assistant role used by content annotations and prompt messages. |
Apps metadata
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpAppResourceMetadata | 4.0 | Immutable Apps resource presentation metadata, content-security policy, and permissions. |
com.soklet.McpAppResourceMetadata$Builder | 4.0 | Mutable Apps resource-metadata builder with validated domain and policy fields. |
com.soklet.McpAppResourceMetadata$ContentSecurityPolicy | 4.0 | Immutable validated origin declarations for Apps content-security policy. |
com.soklet.McpAppResourceMetadata$ContentSecurityPolicy$Builder | 4.0 | Mutable builder for validated Apps content-security-policy origin sets. |
com.soklet.McpAppResourceMetadata$Permission | 4.0 | Closed Apps resource-permission vocabulary; not an authorization grant. |
com.soklet.McpAppToolMetadata | 4.0 | Immutable optional UI-resource association and tool audience set. |
com.soklet.McpAppToolMetadata$Builder | 4.0 | Mutable Apps tool-metadata builder preserving explicit empty visibility. |
com.soklet.McpAppToolMetadata$Visibility | 4.0 | Closed model/App audience vocabulary; visibility does not authorize invocation. |
com.soklet.annotation.McpAppTool | 4.0 | Companion annotation for an existing tool with the same resource URI and audience rules as programmatic metadata. |
Immutable JSON values
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpJsonArray | 4.0 | Immutable ordered JSON array. |
com.soklet.McpJsonArray$Builder | 4.0 | Mutable array builder with value and scalar conveniences. |
com.soklet.McpJsonBoolean | 4.0 | Final immutable boxed JSON boolean using fromValue(Boolean)/getValue(). |
com.soklet.McpJsonNull | 4.0 | Singleton JSON null enum value. |
com.soklet.McpJsonNumber | 4.0 | Final immutable exact decimal JSON number using fromValue(BigDecimal)/getValue(). |
com.soklet.McpJsonObject | 4.0 | Immutable insertion-ordered JSON object with exact find/get accessors. |
com.soklet.McpJsonObject$Builder | 4.0 | Mutable member builder with JSON-value and scalar overloads; doubles must be finite. |
com.soklet.McpJsonString | 4.0 | Final immutable JSON string using fromValue(String)/getValue(). |
com.soklet.McpJsonValue | 4.0 | Sealed root permitting only array, boolean, null, number, object, and string values. |
Multi-round input and request state
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpInputRequest | 4.0 | Final immutable request created with fromDeclaration(McpInputRequestDeclaration, McpJsonObject); declaration, method, and params use conventional getters and params render redacted. |
com.soklet.McpInputRequestDeclaration | 4.0 | Final immutable method/capability/requirement value restricted to four method-specific factories and conventional getters. |
com.soklet.McpInputRequestType | 4.0 | Enum selecting form or URL elicitation while deriving the JSON-RPC method and base capability. |
com.soklet.McpInputRequiredResult | 4.0 | Multi-round operation result containing unique keyed input requests, mode-specific typed retry state, or both, plus metadata. |
com.soklet.McpInputRequiredResult$Builder | 4.0 | Mutable input-required builder. Repeated input keys fail; request-state setters replace one another. |
com.soklet.McpInputRequirement | 4.0 | Enum distinguishing required versus capability-conditional client input. |
com.soklet.McpInputResponses | 4.0 | Immutable 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$Builder | 4.0 | Mutable test-fixture builder whose repeated response keys are last-call-wins. |
com.soklet.McpRequestStateMode | 4.0 | Enum selecting no state, framework-protected state, or application-protected state for an operation. |
com.soklet.annotation.McpMayRequestInput | 4.0 | Runtime-retained nested annotation value declaring an elicitation mode and required/conditional semantics. It has no target sites of its own. |
Progress
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpProgressReporter | 4.0 | Conditional invocation feature for synchronous monotonic progress delivery with queue backpressure. |
com.soklet.McpProgressUpdate | 4.0 | Immutable finite progress value plus optional finite total and human-readable message. |
com.soklet.McpProgressUpdate$Builder | 4.0 | Mutable total/message builder primed with required progress. Negative zero is normalized to JSON zero. |
Request-state protection
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpProtectionKeyInUseException | 4.0 | Catch-only transient failure raised when a verification key still has sealing reservations; no public constructor. |
com.soklet.McpProtectionConfig | 4.0 | Immutable exclusive protection-provider selection plus encoded/decoded size, lifetime, and round bounds. |
com.soklet.McpProtectionConfig$Builder | 4.0 | Mutable limits builder created by exactly one keyring, custom-protector, or development-ephemeral factory. |
com.soklet.McpProtectionKeyringManager | 4.0 | Thread-safe server-owned production keyring manager: inspect, stage, activate, rotate, and remove. |
com.soklet.McpProtectionKey | 4.0 | Immutable 1–64-byte HTTP-token ID plus at least 32 defensively copied secret bytes; public rendering is redacted. |
com.soklet.McpProtectionKeyring | 4.0 | Immutable initial production keyring containing one active key and optional verification-only keys. |
com.soklet.McpProtectionKeyring$Builder | 4.0 | Mutable keyring builder primed with the active key; validates distinct IDs and key material. |
com.soklet.McpProtectionKeyringFingerprint | 4.0 | Secret-free output fingerprint for a complete production keyring; application code receives rather than constructs it. |
com.soklet.McpProtectionKeyringSnapshot | 4.0 | Secret-free output snapshot of active/verification IDs and configuration fingerprint; no public constructor. |
com.soklet.McpProtectionMode | 4.0 | Enum for no framework keys, custom protector, production keyring, or development-ephemeral protection. |
com.soklet.McpRequestStateProtectionContext | 4.0 | Endpoint/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.McpRequestStateProtectionException | 4.0 | Protector failure with fixed invalid-state or protector-unavailable reason. |
com.soklet.McpRequestStateProtectionException$Reason | 4.0 | Enum distinguishing client-invalid state from temporary protector unavailability. |
com.soklet.McpRequestStateProtector | 4.0 | Concurrent application SPI for sealing and reopening framework-bound request-state bytes. |
Resource subscriptions
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpSubscriptionConfig | 4.0 | Immutable endpoint-scoped event publisher and nonempty resource-notification family set; Soklet does not own publisher lifecycle. |
com.soklet.McpSubscriptionConfig$Builder | 4.0 | Mutable config builder primed with an application publisher and requiring at least one notification type. |
com.soklet.McpSubscriptionEvent | 4.0 | Sealed coarse resource-change event family; endpoint/client/authorization selection remains Soklet's responsibility. |
com.soklet.McpSubscriptionEvent$ResourceUpdated | 4.0 | Factory-owned final URI-update variant with getResourceUri() and redacted rendering. |
com.soklet.McpSubscriptionEvent$ResourcesListChanged | 4.0 | Factory-owned stateless final variant instructing subscribed clients to list resources again. |
com.soklet.McpSubscriptionEventListener | 4.0 | Concurrent internal-delivery listener SPI implemented by Soklet stream subscriptions or application adapters. |
com.soklet.McpSubscriptionEventPublisher | 4.0 | Application broadcast SPI with subscribe/publish plus resource-change convenience methods and the built-in fromInMemoryDefaults() factory. It does not own wire delivery. |
com.soklet.McpSubscriptionEventRegistration | 4.0 | Idempotently closable listener registration; an already-selected delivery may finish after close. |
com.soklet.McpSubscriptionNotificationType | 4.0 | Enum for resource-list-changed and resource-updated notification support. |
com.soklet.McpSubscriptionAuthorization | 4.0 | Allowed/denied application decision for a subscription authorization lease. |
com.soklet.McpSubscriptionAuthorization$Allowed | 4.0 | Allowed decision with finite validity and optional application context. |
com.soklet.McpSubscriptionAuthorization$Allowed$Builder | 4.0 | Single-threaded allowed-decision builder. |
com.soklet.McpSubscriptionAuthorization$Denied | 4.0 | Factory-owned denied authorization decision. |
com.soklet.McpSubscriptionAuthorizationContext | 4.0 | Bounded authorization input preserving the initial admitted request and selected filters. |
com.soklet.McpSubscriptionAuthorizer | 4.0 | Application SPI for initial subscription authorization and bounded renewal. |
com.soklet.McpSubscriptionEvent$PromptsListChanged | 4.0 | Coarse prompt-catalog invalidation event. |
com.soklet.McpSubscriptionEvent$ToolsListChanged | 4.0 | Coarse tool-catalog invalidation event. |
com.soklet.McpSubscriptionReconciler | 4.0 | Server-local control that fences delivery and schedules fresh subscription authorization checks. |
Durable Tasks
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpInMemoryTaskManager | Provisional | Explicit 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$Builder | Provisional | Single-threaded builder for retained-task capacity, finite task lifetime, and advertised polling interval. |
com.soklet.McpTask | Provisional | Immutable authoritative task snapshot carrying opaque origin, status, timestamps, optional retention and polling hints, exactly one status-compatible payload, and application metadata. |
com.soklet.McpTask$Builder | Provisional | Single-threaded task builder that enforces timestamp, duration, input-request, terminal-result, failure, and status/payload invariants. |
com.soklet.McpTaskCreationContext | Provisional | Invocation-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.McpTaskCreatedResult | Provisional | Typed handler result naming a task that is already durably readable and whose persisted origin must match the current invocation. |
com.soklet.McpTaskEventListener | Provisional | Concurrent listener for coarse task-ID-only change hints; it carries no task state or authorization decision. |
com.soklet.McpTaskEventPublisher | Provisional | Broadcast 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.McpTaskManager | Provisional | Concurrent application authority for durable state, retention, per-request authorization, input updates, cancelation intent, and optional change publication. It does not run workers. |
com.soklet.McpTaskNotFoundException | Provisional | Fixed, non-disclosing checked signal used identically for an unknown task and an unauthorized task mutation. |
com.soklet.McpTaskOrigin | Provisional | Immutable 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.McpTaskRequestContext | Provisional | Immutable independently admitted lookup or cancelation input containing the current request and requested task ID; the manager must still authorize it. |
com.soklet.McpTaskStatus | Provisional | Five-state task vocabulary: working, input required, completed, failed, and canceled, with the specification-required two-L spelling preserved only on the wire. |
com.soklet.McpTaskUpdateContext | Provisional | Immutable independently admitted task input-response update. The manager owns atomic authorization, correlation, deduplication, and idempotent acceptance. |
2025 sessions and HTTP admission
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpSessionConfig | Provisional | Immutable 2025 session ownership/bounds configuration plus an optional HTTP admission controller; explicitly enabled endpoint revisions only, with no modern session lifecycle. |
com.soklet.McpSessionConfig$Builder | Provisional | Required owner resolver plus positive count/byte/lifetime limits and explicit anonymous opt-in; null tuning values restore provisional defaults. |
com.soklet.McpSessionOwnerKeyResolver | Provisional | Concurrent local nonblocking callback deriving a stable opaque owner key from the freshly admitted identity; not a wire credential or quota-partition substitute. |
com.soklet.McpSessionTransportAdmissionContext | Provisional | Original HTTP Request, selected endpoint/revision, offered notification families, reauthorization flag, and queue-inclusive callback deadline; no invented RPC method/context. |
com.soklet.McpSessionTransportAdmissionController | Provisional | Concurrent fresh GET/DELETE authorization with bounded cancellation features; progress and task creation are unavailable. |
com.soklet.McpSessionTransportAdmissionDecision | Provisional | Closed accepted/rejected domain; acceptance requires explicit expiry and a subset of the offered GET families. DELETE requires an empty family set. |
com.soklet.McpSessionTransportAdmissionDecision$Accepted | Provisional | Private construction through the decision factory; fresh identity, explicit expiry and copied immutable family selection. |
com.soklet.McpSessionTransportAdmissionDecision$Rejected | Provisional | Private construction carrying the existing HTTP rejection status/headers; its JSON-RPC error is not rendered on GET/DELETE. |
Localization
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpLocalizableText | 4.0 | Immutable framework-owned presentation field carrying a structured coordinate and canonical default text; rendering redacts both. |
com.soklet.McpLocalizationCatalog | 4.0 | Deterministic extraction view of every eligible configured source field from the final endpoint registry. |
com.soklet.McpLocalizationContext | 4.0 | Soklet-owned immutable request-local selected locale, optional revision, and bounded lookup callback, constructed through withLocale(Locale, McpLocalizationLookup). |
com.soklet.McpLocalizationContext$Builder | 4.0 | Single-threaded context builder for the optional revision and required immutable-snapshot lookup callback. |
com.soklet.McpLocalizationContextProvider | 4.0 | Concurrent application SPI that selects and builds one Soklet-owned localization context from bounded admitted-request inputs. |
com.soklet.McpLocalizationFailurePolicy | 4.0 | Enum selecting whole-response canonical fallback or a fixed sanitized request failure. |
com.soklet.McpLocalizationLookup | 4.0 | Concurrent request-local lookup over an already captured immutable catalog snapshot. |
com.soklet.McpLocalizationRequest | 4.0 | Bounded provider input: admitted request context, language ranges, verified continuation locale, custom list cursor, and fallback locale. |
com.soklet.McpLocalizationResult | 4.0 | Sealed data-only result family for localized text, intentional default text, or unexpected failure. |
com.soklet.McpLocalizationResult$Failure | 4.0 | Factory-owned data-free final lookup-failure variant that triggers the configured whole-response policy. |
com.soklet.McpLocalizationResult$Localized | 4.0 | Factory-owned final successful text variant with getText(), including provider-managed fallback. |
com.soklet.McpLocalizationResult$UseDefaultText | 4.0 | Factory-owned data-free final selection of the configured canonical source text. |
com.soklet.McpLocalizationRevision | 4.0 | Optional bounded visible-ASCII identity for one immutable application catalog snapshot. |
com.soklet.McpLocalizer | 4.0 | Immutable server-wide fallback locale, provider, response-failure policy, and lookup-count bound. |
com.soklet.McpLocalizer$Builder | 4.0 | Single-threaded policy builder with a 32,768 default and 1–100,000 supported response lookup bound. |
com.soklet.McpTextCoordinate | 4.0 | Immutable endpoint/owner-type/subject/member identity with a versioned domain-separated opaque external key, exposed through getOwnerType(). |
com.soklet.McpTextOwnerType | 4.0 | Six-value owner category for server information, endpoint, tool, prompt, resource, and resource-template text. |
com.soklet.McpLocalizationCatalogInvalidator | 4.0 | Server-local coarse invalidation control for installed localization snapshots. |
Diagnostics
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpServerDiagnostics | 4.0 | Immutable 12-getter snapshot of lifecycle/bind/capacity/runtime counts plus protection and trace configuration. Runtime and security tuples have separate linearization points. |
com.soklet.McpServerStatus | 4.0 | Seven-state enum distinguishing not-started, starting, running, shutting-down, proven-terminated, residual-activity, and termination-unknown states. |
Trace-correlation control
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpTraceCorrelationKeyManager | 4.0 | Thread-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.McpTraceCorrelationFingerprint | 4.0 | Returned-only final 43-character canonical unpadded Base64URL SHA-256 configuration fingerprint, read through getValue(). |
com.soklet.McpTraceCorrelationKey | 4.0 | Immutable trace-only key with constrained non-secret ID and at least 32 copied secret bytes; key material is never exposed. |
Off-network simulation
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpSimulation | 4.0 | Thread-safe async handle with timed response/completion reads, destructive awaitStreamItem(Duration) reads, completion check, and idempotent disconnect through close(). |
com.soklet.McpSimulationBodyType | 4.0 | Enum distinguishing empty, bounded JSON, and SSE bodies. |
com.soklet.McpSimulationCompletion | 4.0 | Immutable termination reason, optional duplicated terminal SSE JSON, and exact ordered throwables; throwable disclosure is caller-owned. |
com.soklet.McpSimulationOptions | 4.0 | Immutable positive item and cumulative-byte capture bounds, with shared 128-item/10-MiB defaults. |
com.soklet.McpSimulationOptions$Builder | 4.0 | Mutable simulation-bound builder. Consumed items do not refund the cumulative byte budget. |
com.soklet.McpSimulationResponse | 4.0 | Immutable status, insertion-ordered/coalesced headers, body type, and defensive optional body bytes. |
com.soklet.McpSimulationStreamItem | 4.0 | One exactly encoded SSE JSON-message or keep-alive-comment item with defensive frame bytes. |
com.soklet.McpSimulationStreamItemType | 4.0 | Enum distinguishing JSON message frames from keep-alive comment frames. |
com.soklet.Simulator | 4.0 | Shared Soklet testing host with default-options and explicit-options asynchronous MCP request entry points. |
Semantic metric events
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpMetricsEvent | 4.0 | Factory-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$CancelationSignaled | 4.0 | Endpoint/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$ConnectionAccepted | 4.0 | Zero-dimension event for a TCP connection accepted within capacity. |
com.soklet.McpMetricsEvent$ConnectionRejected | 4.0 | Zero-dimension event for connection-capacity rejection. |
com.soklet.McpMetricsEvent$HandlerCapacityRejected | 4.0 | Zero-dimension event for bounded application-handler queue rejection. |
com.soklet.McpMetricsEvent$HandlerDequeued | 4.0 | Zero-dimension event for application work leaving the bounded handler queue. |
com.soklet.McpMetricsEvent$HandlerExecutionFinished | 4.0 | Zero-dimension event for release of a reserved handler slot after actual exit or failed submission. |
com.soklet.McpMetricsEvent$HandlerExecutionStarted | 4.0 | Zero-dimension event for acquisition of an application-handler execution slot. |
com.soklet.McpMetricsEvent$HandlerQueued | 4.0 | Zero-dimension event for entry into the bounded handler queue. |
com.soklet.McpMetricsEvent$KeepAliveEmitted | 4.0 | Zero-dimension event when a keep-alive comment is accepted for delivery. |
com.soklet.McpMetricsEvent$ProgressEmitted | 4.0 | Endpoint/method event when progress is accepted for delivery. |
com.soklet.McpMetricsEvent$ProtocolError | 4.0 | Fixed JSON-RPC/MCP error-code event with getCode(). Its outer factory checks non-nullity; runtime production remains allowlisted. |
com.soklet.McpMetricsEvent$RequestAccepted | 4.0 | Zero-dimension event for HTTP request acceptance into the bounded protocol processor. |
com.soklet.McpMetricsEvent$RequestFinished | 4.0 | Endpoint/method/outcome/nonnegative-duration event for client-visible admitted-request completion. |
com.soklet.McpMetricsEvent$RequestRejected | 4.0 | Zero-dimension event for rejection before admitted semantic handling. It is not the complement of processor acceptance. |
com.soklet.McpMetricsEvent$RequestStarted | 4.0 | Endpoint/method event for admitted semantic request start. |
com.soklet.McpMetricsEvent$RequestStreamClosed | 4.0 | Endpoint/method/reason/nonnegative-duration event for response-stream close. |
com.soklet.McpMetricsEvent$RequestStreamOpened | 4.0 | Endpoint/method event for response-stream open. |
com.soklet.McpMetricsEvent$ServerStarted | 4.0 | Zero-dimension event for one successfully started real listener generation. Simulation does not emit it. |
com.soklet.McpMetricsEvent$ServerStopped | 4.0 | Shutdown-component-disposition event for one completed real-listener stop. |
com.soklet.McpMetricsEvent$SubscriptionClosed | 4.0 | Endpoint/reason/nonnegative-duration event for resource-subscription termination. |
com.soklet.McpMetricsEvent$SubscriptionOpened | 4.0 | Endpoint event for an active resource subscription. |
com.soklet.McpMetricsEvent$TransportFailure | 4.0 | Fixed shared transport-failure-reason event for the dedicated MCP transport. |
com.soklet.McpMetricsEvent$UnknownMirroredHeader | 4.0 | Endpoint/method occurrence count that deliberately omits the attacker-controlled header name. |
com.soklet.McpMetricsEvent$SubscriptionMaintenance | 4.0 | Bounded subscription authorization/reconciliation work event. |
com.soklet.McpMetricsEvent$SubscriptionMaintenance$Outcome | 4.0 | Fixed subscription-maintenance outcome vocabulary. |
com.soklet.McpMetricsEvent$SubscriptionMaintenance$Work | 4.0 | Fixed subscription-maintenance work classification. |
Aggregate semantic metrics
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpMetricsSnapshot | 4.0 | Immutable complete MCP metric aggregate: gauges, counters, fixed-dimension maps, and duration histograms. |
com.soklet.McpMetricsSnapshot$Builder | 4.0 | Mutable aggregate builder validating nonnegative counts and complete fixed-dimension values. |
com.soklet.McpMetricsSnapshot$EndpointMethodKey | 4.0 | Final fromDimensions(String, String) endpoint/method key with conventional getters for cancelation, progress, and unknown-header counters. |
com.soklet.McpMetricsSnapshot$RequestOutcomeKey | 4.0 | Final fromDimensions(String, String, McpRequestOutcome) endpoint/method/outcome key with conventional getters for completed-request counts and durations. |
com.soklet.McpMetricsSnapshot$RequestStreamTerminationKey | 4.0 | Final fromDimensions(String, String, McpStreamTerminationReason) endpoint/method/reason key with conventional getters for request-stream duration histograms. |
com.soklet.McpMetricsSnapshot$SubscriptionMaintenanceKey | 4.0 | Immutable 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$SubscriptionTerminationKey | 4.0 | Final fromDimensions(String, McpStreamTerminationReason) endpoint/reason key with conventional getters for subscription duration histograms. |
Terminal vocabularies
| Type | Stability | Purpose |
|---|---|---|
com.soklet.McpRequestOutcome | 4.0 | Ten client-visible admitted-request outcomes: complete, input required, rejected, application/protocol/internal error, canceled, deadline, disconnect, and write failure. |
com.soklet.McpStreamTerminationReason | 4.0 | Sixteen 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
| Type | Stability | Purpose |
|---|---|---|
com.soklet.CorsAuthorizer | 4.0 | Shared Origin-policy SPI. MCP uses its transport-neutral preflight overload; that default rejects until explicitly overridden. |
com.soklet.LifecycleObserver | 4.0 | Shared 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.LogEventType | 4.0 | Shared log-event enum containing MCP configuration, mirrored-header, lifecycle-callback-failure, transport, and bounded MCP_TRACE_CORRELATION event kinds. |
com.soklet.MetricsCollector | 4.0 | Shared collector SPI; receives immutable semantic MCP events. Implementations must be concurrent, prompt, and non-blocking. |
com.soklet.MetricsCollector$Snapshot | 4.0 | Shared immutable metrics snapshot with a non-null MCP aggregate attachment. |
com.soklet.MetricsCollector$Snapshot$Builder | 4.0 | Mutable shared-snapshot builder with the MCP aggregate setter. |
com.soklet.SokletConfig | 4.0 | Application configuration that can own an independently configured McpServer. |
com.soklet.SokletConfig$Builder | 4.0 | Mutable 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:
RequestandHttpMethodrepresent the underlying HTTP request and construct simulator input.CancelationTokenis the cooperative signal available through invocation features or annotated handler injection.TraceContextrepresents validated MCP distributed trace propagation.InstanceProvidercontrols annotated endpoint-instance acquisition.TypeReference<T>preserves nested generic argument/result types and typed input-response lookups.BearerAuthenticationChallengebuilds validated RFC 6750 Bearer challenges and exposes their header value;BearerAuthenticationErrorsupplies the standard error values. MCP admission can attach the challenge asWWW-Authenticate; see OAuth.Cors,CorsPreflight,CorsResponse, andCorsPreflightResponseare shared Origin-policy values used byCorsAuthorizer.MetricsCollector.HistogramSnapshotandMetricsCollector.TransportFailureReasonrepresent histogram data and bounded transport-failure categories in metric aggregates and events.- JDK types such as
URI,Duration,Instant,Optional, collections,ExecutorService, andThrowableretain their ordinary contracts.
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
| Kind | Application action |
|---|---|
| Builders and ordinary values | Construct 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 interfaces | Implement as an application extension point and assume concurrent calls unless the interface explicitly narrows the contract. |
McpServer | Configure Soklet's built-in sealed implementation; do not implement a custom server transport. |
| Sealed JSON/content/resource/decision/state/event roots | Construct a permitted framework value; do not add an implementation. |
McpOperationResult | Return only the framework result compatible with the invoked operation; do not invent a result implementation. |
McpToolSchema | Inspect 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 McpProtectionKeyInUseException | Receive or catch them; they are not application-constructed values. |
McpTaskManager | Implement the application-specific durable state, authorization, and mutation authority. Use the explicit in-memory implementation only where process-local ephemeral state is acceptable. |
McpTaskOrigin | Persist and return its opaque state without interpretation; protect it as sensitive framework data and never expose it on the wire. |
Related guides
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.

