Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions mcp-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
<version>${jackson-annotations.version}</version>
</dependency>

<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>${jspecify.version}</version>
</dependency>

<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.reactivestreams.Publisher;
import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
import reactor.util.annotation.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Customize {@link HttpRequest.Builder} before executing the request, in either SSE or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import java.net.URI;
import java.net.http.HttpRequest;

import reactor.util.annotation.Nullable;
import org.jspecify.annotations.Nullable;

import io.modelcontextprotocol.client.McpClient.SyncSpec;
import io.modelcontextprotocol.common.McpTransportContext;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

import io.modelcontextprotocol.modern.McpHttp;
import io.modelcontextprotocol.util.Assert;
import reactor.util.annotation.Nullable;
import org.jspecify.annotations.Nullable;

/**
* The {@code Mcp-Param-{Name}} headers of a {@code tools/call} request, which a client
Expand Down Expand Up @@ -90,8 +90,7 @@ public boolean isMalformed(String name) {
* @param name the {@code {Name}} part of {@code Mcp-Param-{Name}}, in any case
* @return the decoded value, or {@code null} if the header is absent or malformed
*/
@Nullable
public String value(String name) {
@Nullable public String value(String name) {
return this.values.get(normalize(name));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import io.modelcontextprotocol.modern.McpHttp.Headers;
import io.modelcontextprotocol.modern.server.McpParamHeaders;
import io.modelcontextprotocol.server.transport.HeaderAccessor;
import reactor.util.annotation.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Strict decoder for MCP header values such as {@code Mcp-Name} and
Expand Down Expand Up @@ -50,8 +50,7 @@ private McpHeaderDecoder() {
* @param raw the header value as received
* @return the decoded value, or {@code null} if the value is malformed
*/
@Nullable
public static String decodeValue(String raw) {
@Nullable public static String decodeValue(String raw) {
if (raw.length() >= Headers.BASE64_VALUE_PREFIX.length() + Headers.BASE64_VALUE_SUFFIX.length()
&& raw.startsWith(Headers.BASE64_VALUE_PREFIX) && raw.endsWith(Headers.BASE64_VALUE_SUFFIX)) {
String encoded = raw.substring(Headers.BASE64_VALUE_PREFIX.length(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import org.reactivestreams.Publisher;
import reactor.core.Disposable;
import reactor.core.publisher.Mono;
import reactor.util.annotation.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Represents a closed MCP session, which may not be reused.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package io.modelcontextprotocol.spec;

import reactor.util.annotation.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Exception thrown when trying to use an {@link McpTransportSession} that has been
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import java.util.Collection;

import reactor.util.annotation.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Assertion utility class that assists in validating arguments.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import java.util.Collection;
import java.util.Map;

import reactor.util.annotation.Nullable;
import org.jspecify.annotations.Nullable;

/**
* Miscellaneous utility methods.
Expand Down
6 changes: 6 additions & 0 deletions mcp-test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@
<version>${slf4j-api.version}</version>
</dependency>

<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>${jspecify.version}</version>
</dependency>

<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-core</artifactId>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<toxiproxy.version>2.0.5</toxiproxy.version>

<slf4j-api.version>2.0.20</slf4j-api.version>
<jspecify.version>1.0.0</jspecify.version>
<logback.version>1.6.6</logback.version>
<jackson-annotations.version>2.22</jackson-annotations.version>
<jackson2.version>2.22.4</jackson2.version>
Expand Down
Loading