Skip to content
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

Modify SSE config for server #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Modify SSE config for server #23

wants to merge 1 commit into from

Conversation

Mr3zee
Copy link
Collaborator

@Mr3zee Mr3zee commented Dec 18, 2024

Modify SSE config for server:

  • rename to Kotlin style guide
  • remove NPE
  • manage paths clearly

- rename to Kotlin style guide
- remove NPE
- manage paths clearly
/**
* Configures the Ktor Application to handle Model Context Protocol (MCP) over Server-Sent Events (SSE).
*/
public fun Application.MCP(block: () -> Server) {
public fun Routing.mcp(block: () -> Server) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please keep old extension for compatibility

val servers = ConcurrentMap<String, Server>()

install(SSE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please keep SSE to have configuration simple

@@ -10,45 +10,57 @@ import io.ktor.util.collections.*

private val logger = KotlinLogging.logger {}

public val Mcp: ApplicationPlugin<Unit> = createApplicationPlugin("Mcp") {
application.install(SSE)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could you tell me what is the purpose of the plugin?

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.

2 participants