Skip to content

feat: Add task related things to schema - #671

Closed
He-Pin wants to merge 16 commits into
modelcontextprotocol:mainfrom
He-Pin:taskHink
Closed

feat: Add task related things to schema#671
He-Pin wants to merge 16 commits into
modelcontextprotocol:mainfrom
He-Pin:taskHink

Conversation

@He-Pin

@He-PinHe-Pin commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

Motivation and Context

ISSUE: modelcontextprotocol/modelcontextprotocol#1686
PR: modelcontextprotocol/modelcontextprotocol#1732

Issue in Java-sdk : #668

How Has This Been Tested?

Breaking Changes

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

@He-Pin
He-Pin marked this pull request as draft November 18, 2025 06:35
@He-PinHe-Pin changed the title WIP feat: Add taskHint and builder to schemafeat: Add task related things to schemaNov 18, 2025
@He-Pin
He-Pin marked this pull request as ready for review November 18, 2025 08:05
@He-Pin

Copy link
Copy Markdown
ContributorAuthor

I will try to implement this internal first, feel free to continue

@KehrlannKehrlann added this to the 0.16.0 milestone Nov 18, 2025
@KehrlannKehrlann self-assigned this Nov 18, 2025
@KehrlannKehrlann removed this from the 0.16.0 milestone Nov 18, 2025
@He-Pin

Copy link
Copy Markdown
ContributorAuthor

I would like to add modelcontextprotocol/modelcontextprotocol#1831 to this too

@KehrlannKehrlann added the waiting for user Waiting for user feedback or more details label Nov 18, 2025
@Kehrlann

Copy link
Copy Markdown
Contributor

Let's wait until the bizContext is resolved.

@He-Pin

Copy link
Copy Markdown
ContributorAuthor

I'm ok to just drop it if time is not OK, and at the same time, I'm implementing it first internal too.

@Kehrlann

Copy link
Copy Markdown
Contributor

Let's park this for now, then.

@He-Pin

Copy link
Copy Markdown
ContributorAuthor

@Kehrlann Just dropped.

@KehrlannKehrlann removed the waiting for user Waiting for user feedback or more details label Nov 18, 2025
@He-Pin
He-Pinforce-pushed the taskHink branch 8 times, most recently from 584e4a5 to 8544229CompareNovember 19, 2025 18:09
@JsonProperty("content") List<Content> content,
@JsonProperty("isError") Boolean isError,
@JsonProperty("structuredContent") Object structuredContent,
@JsonProperty("task") Task task,

@He-PinHe-PinNov 19, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

No | type in Java, so add the task here instead of GetTaskRequest | CallToolResult, an Either type will change much code, and Object loses type safety.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I was adding a CallToolAuxResult and I found the JSONRPCResponse has a JSONRPCError, so I will follow the same design. it should be JSONRPCResponse | JSONRPCError, but the current shape seems pratical.

Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
*/
Map<String, Object> meta();

sealed interface McpEvent extends McpMessage {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where are these in the spec? I don't find them.

@He-PinHe-PinNov 26, 2025

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

My current implementation at work is Flux<McpMessage> callToolStream(CallToolRequest request) to support streaming responses. We also have callTool(CallToolRequest request) built upon this implementation.

I specifically plan to support streaming responses in the future. However, because my implementation at work is far more complex than a memory-based implementation, it's not yet ready for open-source development.

modelcontextprotocol/modelcontextprotocol#1905

Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
Signed-off-by: He-Pin <hepin1989@gmail.com>
@Kehrlann

Copy link
Copy Markdown
Contributor

Closing in favor of #755 which adds the full task implementation.

Sign up for freeto 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.

3 participants

@He-Pin@Kehrlann@Randgalt