mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 02:59:33 +07:00
[AIA] Migrate Claude code to use SSE by default and make it configurable in Registry
(cherry picked from commit 693760577b49848554c20fdac98c88a79875ba2e) GitOrigin-RevId: 65c969bf59c56fa19a82398d8f8e5e172df82e6a
This commit is contained in:
committed by
intellij-monorepo-bot
parent
aef15e7390
commit
051b3f3766
@@ -155,7 +155,7 @@ class McpServerSettingsConfigurable : SearchableConfigurable {
|
||||
indent {
|
||||
row {
|
||||
button(McpServerBundle.message("copy.mcp.server.sse.configuration"), {
|
||||
val json = createSseServerJsonEntry(McpServerService.getInstance().port)
|
||||
val json = createSseServerJsonEntry(McpServerService.getInstance().port, null)
|
||||
CopyPasteManager.getInstance().setContents(TextTransferable(McpClient.json.encodeToString(json) as CharSequence))
|
||||
showCopiedBallon(it)
|
||||
})
|
||||
|
||||
@@ -87,10 +87,13 @@ fun createStdioServerJsonEntry(cmd: GeneralCommandLine): JsonObject {
|
||||
* }
|
||||
* ```
|
||||
*/
|
||||
fun createSseServerJsonEntry(port: Int): JsonObject {
|
||||
fun createSseServerJsonEntry(port: Int, projectBasePath: String?): JsonObject {
|
||||
return buildJsonObject {
|
||||
put("type", "sse")
|
||||
put("url", "http://localhost:$port/sse")
|
||||
put("headers", buildJsonObject {
|
||||
put(IJ_MCP_SERVER_PROJECT_PATH, projectBasePath)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,8 +56,9 @@ class McpJsonGenerationTest {
|
||||
@Test
|
||||
fun test_createSseServerJsonEntry() {
|
||||
val port = 8080
|
||||
val projectPath = "/test/project/path"
|
||||
|
||||
val jsonConfig = createSseServerJsonEntry(port)
|
||||
val jsonConfig = createSseServerJsonEntry(port, projectBasePath = projectPath)
|
||||
|
||||
// Verify the JSON structure
|
||||
Assertions.assertEquals("sse", jsonConfig["type"]?.jsonPrimitive?.content)
|
||||
|
||||
Reference in New Issue
Block a user