mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
TBX-16111 connect to loopback remote MCP servers through stdio proxy of "MCP Server" plugin
GitOrigin-RevId: 01d1973452d3f30569211541f07bf48ecb85a8ee
This commit is contained in:
committed by
intellij-monorepo-bot
parent
024dc5598b
commit
c6a914224c
@@ -12,6 +12,7 @@ import kotlinx.io.asSource
|
||||
import kotlinx.io.buffered
|
||||
|
||||
private const val IJ_MCP_PREFIX = "IJ_MCP_"
|
||||
const val IJ_MCP_HEADER_PREFIX: String = "${IJ_MCP_PREFIX}HEADER_"
|
||||
val IJ_MCP_SERVER_PORT: String = ::IJ_MCP_SERVER_PORT.name
|
||||
val IJ_MCP_SERVER_PROJECT_PATH: String = ::IJ_MCP_SERVER_PROJECT_PATH.name
|
||||
|
||||
@@ -33,7 +34,7 @@ suspend fun main() {
|
||||
|
||||
val envsToPass = System.getenv().filter { (key, _) -> key.startsWith(IJ_MCP_PREFIX) }
|
||||
val sseClientTransport = SseClientTransport(httpClient, "http://localhost:$port/sse") {
|
||||
envsToPass.forEach { (key, value) -> header(key, value)}
|
||||
envsToPass.forEach { (key, value) -> header(key.removePrefix(IJ_MCP_HEADER_PREFIX), value)}
|
||||
}
|
||||
|
||||
stdioServerTransport.onMessage {
|
||||
|
||||
Reference in New Issue
Block a user