Skip to content

Conversation

@zmeggyesi
Copy link

@zmeggyesi zmeggyesi commented Jul 2, 2025

Motivation and Context

As a follow-up of #99 this PR provides access to the instructions as a readable field so they can be returned to the client during initialization

How Has This Been Tested?

Breaking Changes

No.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

closes #364

@zmeggyesi zmeggyesi marked this pull request as ready for review July 2, 2025 09:45
@zmeggyesi zmeggyesi changed the title Draft: Instructions Instructions Jul 2, 2025
@zmeggyesi zmeggyesi marked this pull request as draft July 2, 2025 16:45
@zmeggyesi zmeggyesi marked this pull request as ready for review July 3, 2025 06:22
@zmeggyesi
Copy link
Author

Tests pass locally, and I cannot see anything wrong with the one that fails in CI

Copy link
Contributor

@tzolov tzolov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @zmeggyesi , thanks for the effort. However the instructions are already included in the InitializeResponse. You do not need a getter for this.
The public getter still might be useful for consistency and debugging.
I've left comments as you made some unnecessary changes.
Alos tests are missing

<dependency>
<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.11.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change back to 0.11.0-SNAPSHOT

<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.11.0-SNAPSHOT</version>
<version>0.12.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change back to 0.11.0-SNAPSHOT

<groupId>io.modelcontextprotocol.sdk</groupId>
<artifactId>mcp</artifactId>
<version>0.11.0-SNAPSHOT</version>
<version>0.12.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change back to 0.11.0-SNAPSHOT

</parent>
<artifactId>mcp</artifactId>
<packaging>jar</packaging>
<version>0.12.0-SNAPSHOT</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please revert this change back to 0.11.0-SNAPSHOT

import org.slf4j.LoggerFactory;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import reactor.util.annotation.Nullable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the reactor Nullable.

* Get the server instructions if available
* @return The preset instructions for communication with the server
*/
@Nullable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the reactor Nullable.

import io.modelcontextprotocol.spec.McpSchema;
import io.modelcontextprotocol.spec.McpSchema.LoggingMessageNotification;
import io.modelcontextprotocol.util.Assert;
import reactor.util.annotation.Nullable;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the reactor Nullable.

* Get the server instructions if available
* @return The preset instructions for communication with the server
*/
@Nullable
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the reactor Nullable.

@tzolov
Copy link
Contributor

tzolov commented Jul 11, 2025

Closing as nothing to do.

@tzolov tzolov closed this Jul 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Getter for server instructions

2 participants