Skip to content

Conversation

@jskjw157
Copy link
Contributor

@jskjw157 jskjw157 commented Jan 20, 2026

Summary

Add integration tests for Prompts, Resources, and Tools over Streamable HTTP transport as outlined in #183.

Changes

  • Infrastructure: Enable STREAMABLE_HTTP transport in test base
  • Prompts: Add functional integration tests
  • Resources: Add functional integration tests
  • Tools: Add functional integration tests

Related to #332

@jskjw157 jskjw157 force-pushed the test/streamable-http-integration branch from e71221c to 56cd2d7 Compare January 20, 2026 09:31
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Thanks, @jskjw157!
Could we take a look at the test scenarios and see, if we can move any use cases that aren’t specific to the protocol to the base class?
Also, could we tidy up those long TODO comments?
Let’s give another go, this time with a focus on making the tests easier to maintain.

@kpavlov kpavlov added the tests label Jan 20, 2026
@jskjw157
Copy link
Contributor Author

Fixed in 97f1fa9

Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Please rebase onto main and squash the commits so we maintain a clear commit history.

@kpavlov kpavlov force-pushed the test/streamable-http-integration branch from 97f1fa9 to 921bed3 Compare January 22, 2026 07:19
@jskjw157 jskjw157 force-pushed the test/streamable-http-integration branch 2 times, most recently from c2a5d9f to 8e9557c Compare January 22, 2026 13:46
@jskjw157
Copy link
Contributor Author

jskjw157 commented Jan 22, 2026

Done! Rebased onto main and squashed the commits.

Are there any other issues or features you'd recommend I work on next?

@kpavlov kpavlov force-pushed the test/streamable-http-integration branch from 8e9557c to e253b80 Compare January 26, 2026 06:47
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Thanks, @jskjw157!

While this PR does add some useful integration tests for the Streamable HTTP protocol, the security tests could use a bit more thought.

To start, I’d suggest moving the security tests to a separate PR and keeping this one focused on adding Streamable HTTP transport support to the existing tests (we can remove the ‘Security tests’ tag).

The access control system isn’t quite ready to go on the server yet, but we’re running some tests to check it out a bit early. Also, the list resource tests should make sure that resources are only shown to users who have the right to see them. Maybe we could replace MockAuthorizationWrapper with something more like a production-code solution, such as a chain of generic (resource+principal)-aware predicates. You might want to have a look at Spring Security, where you can find examples of how these ideas are put into action.

TL;DR - Let's remove security tests from this PR and keep it focused on adding Streamable HTTP protocol tests.

private var stdioClientOutput: Sink? = null

// StreamableHTTP-specific fields
private var streamableHttpServerTransport: StreamableHttpServerTransport? = null
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a heads-up: this should probably be in the streamable test subclass, but since we already have transport-specific fields here, let’s tackle it separately.

Comment on lines 136 to 141
fun testListPromptsDenied() {
runBlocking {
val result = client.listPrompts()
assertNotNull(result, "List prompts should succeed")
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This test does not redundant

@kpavlov kpavlov force-pushed the test/streamable-http-integration branch from e253b80 to d1b3f67 Compare February 4, 2026 09:26
@jskjw157 jskjw157 force-pushed the test/streamable-http-integration branch 2 times, most recently from 5ac3cba to 5d71104 Compare February 4, 2026 12:07
@jskjw157
Copy link
Contributor Author

jskjw157 commented Feb 4, 2026

Thanks, @kpavlov!

I've updated the PR to address the review feedback:

  • Moved the security tests (and MockAuthorizationWrapper) out of this PR to keep it focused on Streamable HTTP transport integration tests only. I'll follow up with a separate PR for security once we align on the auth model.
  • Squashed the PR down to a single commit.
  • Cleaned up Streamable HTTP test utilities (header naming + removed stale TODO/comment blocks) and kept production code changes out of this PR.

There are still a couple of notes around transport-specific fields in KotlinTestBase that I'm leaving for a follow-up refactor, as suggested.

@jskjw157
Copy link
Contributor Author

jskjw157 commented Feb 4, 2026

Follow-up: there are a couple of inline notes about transport-specific fields living in KotlinTestBase (line ~65). Ack — agreed they should live in the streamable-http subclass; I'll handle that in a dedicated follow-up PR to keep this one focused.

console.error('Error:', error);
process.exit(1);
// Don't hard-exit; allow finally{} to run so the client always closes cleanly.
process.exitCode = 1;
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏻

@kpavlov kpavlov force-pushed the test/streamable-http-integration branch from 5d71104 to 600285a Compare February 4, 2026 15:04
@kpavlov kpavlov force-pushed the test/streamable-http-integration branch from 600285a to 3c65404 Compare February 5, 2026 11:24
…ing in MockMcp

- remove unised StreamableHttpTestUtils
- fix session id header is [MCP-Session-Id"](https://modelcontextprotocol.io/specification/2025-11-25/basic/transports)
@kpavlov kpavlov changed the title test(integration): Add Streamable HTTP transport integration tests [WIP]test(integration): Add Streamable HTTP transport integration tests Feb 5, 2026
Copy link
Contributor

@kpavlov kpavlov left a comment

Choose a reason for hiding this comment

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

Let’s merge this and focus more on testing in the follow-up PRs.

@kpavlov kpavlov merged commit def0e92 into modelcontextprotocol:main Feb 5, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants