-
Notifications
You must be signed in to change notification settings - Fork 476
feat(spi): adds implementation-neutral SPI module #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Aliaksie
wants to merge
6
commits into
modelcontextprotocol:main
Choose a base branch
from
Aliaksie:feat/mcp-spi
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,748
−1,848
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
6770f9e
feat: adds mcp-spi
Aliaksie 4efe91e
feat: adds mcp-schema-jackson
Aliaksie 326b2ae
feat: extracts McpClient/McpServer abstraction into mcp-spi
Aliaksie 054ba3a
feat: adds McpLogger and mcp-logging-slf4j
Aliaksie 3ebc3cb
fix
Aliaksie 897022f
fix
Aliaksie File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>io.modelcontextprotocol.sdk</groupId> | ||
<artifactId>mcp-parent</artifactId> | ||
<version>0.11.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>mcp-logging-slf4j</artifactId> | ||
<packaging>jar</packaging> | ||
<name>Java SDK MCP SLF4J</name> | ||
<description>Java SDK Logging SLF4J of the Model Context Protocol</description> | ||
<url>https://github.com/modelcontextprotocol/java-sdk</url> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.modelcontextprotocol.sdk</groupId> | ||
<artifactId>mcp-spi</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-api</artifactId> | ||
<version>${slf4j-api.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<!-- This module does not use mockito --> | ||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-surefire-plugin</artifactId> | ||
<configuration> | ||
<argLine>${surefireArgLine}</argLine> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
46 changes: 46 additions & 0 deletions
46
mcp-logging-slf4j/src/main/java/io/modelcontextprotocol/logger/Slf4jMcpLogger.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright 2025-2025 the original author or authors. | ||
*/ | ||
|
||
package io.modelcontextprotocol.logger; | ||
|
||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* @author Aliaksei Darafeyeu | ||
*/ | ||
public class Slf4jMcpLogger implements McpLogger { | ||
|
||
private final Logger delegate; | ||
|
||
public Slf4jMcpLogger(Class<?> clazz) { | ||
this.delegate = LoggerFactory.getLogger(clazz); | ||
} | ||
|
||
@Override | ||
public void debug(final String message) { | ||
delegate.debug(message); | ||
} | ||
|
||
@Override | ||
public void info(final String message) { | ||
delegate.info(message); | ||
} | ||
|
||
@Override | ||
public void warn(final String message) { | ||
delegate.warn(message); | ||
} | ||
|
||
@Override | ||
public void warn(final String message, final Throwable t) { | ||
delegate.warn(message, t); | ||
} | ||
|
||
@Override | ||
public void error(final String message, final Throwable t) { | ||
delegate.error(message, t); | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Java MCP SDK | ||
|
||
Java SDK implementation of the Model Context Protocol, enabling seamless integration with language models and AI tools. | ||
Java SDK Reactor implementation of the Model Context Protocol, enabling seamless integration with language models and AI tools. | ||
For comprehensive guides and API documentation, visit the [MCP Java SDK Reference Documentation](https://modelcontextprotocol.io/sdk/java/mcp-overview). | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A nit typo!