Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitcf02298

Browse files
committed
fix: Remove SSE references from tests and documentation
- Remove sseUrl field references from McpConfigTest.kt- Remove SSE-related test cases that are no longer applicable- Update example configuration to remove SSE examples- Update documentation to focus on HTTP transport only- All tests now pass successfullyThis ensures consistency between the configuration model and tests,focusing on the working HTTP transport foundation.
1 parentb83366e commitcf02298

File tree

3 files changed

+17
-110
lines changed

3 files changed

+17
-110
lines changed

‎core/src/test/kotlin/cc/unitmesh/devti/mcp/client/McpConfigTest.kt‎

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -52,34 +52,10 @@ class McpConfigTest {
5252
val server= config.mcpServers["http-server"]!!
5353
assertNull(server.command)
5454
assertEquals("http://localhost:8080/mcp", server.url)
55-
assertNull(server.sseUrl)
5655
assertEquals(emptyList(), server.args)
5756
}
5857

59-
@Test
60-
funshould_parse_config_with_sse_url_only() {
61-
val configJson="""
62-
{
63-
"mcpServers": {
64-
"sse-server": {
65-
"sseUrl": "http://localhost:8080/sse",
66-
"args": []
67-
}
68-
}
69-
}
70-
""".trimIndent()
7158

72-
val config=McpServer.tryParse(configJson)
73-
74-
assertNotNull(config)
75-
assertEquals(1, config.mcpServers.size)
76-
77-
val server= config.mcpServers["sse-server"]!!
78-
assertNull(server.command)
79-
assertNull(server.url)
80-
assertEquals("http://localhost:8080/sse", server.sseUrl)
81-
assertEquals(emptyList(), server.args)
82-
}
8359

8460
@Test
8561
funshould_parse_config_with_both_command_and_url() {
@@ -103,36 +79,10 @@ class McpConfigTest {
10379
val server= config.mcpServers["mixed-server"]!!
10480
assertEquals("npx", server.command)
10581
assertEquals("http://localhost:8080/mcp", server.url)
106-
assertNull(server.sseUrl)
10782
assertEquals(listOf("@modelcontextprotocol/server-stdio"), server.args)
10883
}
10984

110-
@Test
111-
funshould_parse_config_with_all_transport_types() {
112-
val configJson="""
113-
{
114-
"mcpServers": {
115-
"all-transports-server": {
116-
"command": "npx",
117-
"url": "http://localhost:8080/mcp",
118-
"sseUrl": "http://localhost:8080/sse",
119-
"args": ["@modelcontextprotocol/server-stdio"]
120-
}
121-
}
122-
}
123-
""".trimIndent()
124-
125-
val config=McpServer.tryParse(configJson)
126-
127-
assertNotNull(config)
128-
assertEquals(1, config.mcpServers.size)
12985

130-
val server= config.mcpServers["all-transports-server"]!!
131-
assertEquals("npx", server.command)
132-
assertEquals("http://localhost:8080/mcp", server.url)
133-
assertEquals("http://localhost:8080/sse", server.sseUrl)
134-
assertEquals(listOf("@modelcontextprotocol/server-stdio"), server.args)
135-
}
13686

13787
@Test
13888
funshould_parse_config_with_all_optional_fields() {

‎docs/mcp-streamable-http.md‎

Lines changed: 17 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
#MCP Transport Support
1+
#MCPHTTPTransport Support
22

3-
AutoDev now supports MCP (Model Context Protocol) servers viamultiple transport protocols, thanks to the upgrade to kotlin-sdk 0.6.0.
3+
AutoDev now supports MCP (Model Context Protocol) servers viaHTTP transport, thanks to the upgrade to kotlin-sdk 0.6.0.
44

55
##Configuration
66

7-
MCP servers can be configured in your`mcp_server.json` file usingany of these transport types:
7+
MCP servers can be configured in your`mcp_server.json` file usingeither of these transport types:
88

99
1.**Command-based (stdio)** - for local MCP servers
1010
2.**URL-based (HTTP)** - for remote MCP servers with HTTP transport
11-
3.**SSE URL-based (Server-Sent Events)** - for remote MCP servers with SSE transport
1211

1312
###Stdio Transport (Local Servers)
1413

@@ -39,22 +38,11 @@ MCP servers can be configured in your `mcp_server.json` file using any of these
3938
}
4039
```
4140

42-
###SSE Transport (Server-Sent Events)
4341

44-
```json
45-
{
46-
"mcpServers": {
47-
"sse-server": {
48-
"sseUrl":"http://localhost:8080/sse",
49-
"args": []
50-
}
51-
}
52-
}
53-
```
5442

5543
###Mixed Configuration
5644

57-
You can useall transport types in the same configuration:
45+
You can useboth transport types in the same configuration:
5846

5947
```json
6048
{
@@ -71,11 +59,6 @@ You can use all transport types in the same configuration:
7159
"args": [],
7260
"autoApprove": ["safe_tool"],
7361
"requiresConfirmation": ["dangerous_tool"]
74-
},
75-
"remote-sse-api": {
76-
"sseUrl":"https://api.example.com/mcp/sse?session=123",
77-
"args": [],
78-
"autoApprove": ["read_only_tool"]
7962
}
8063
}
8164
}
@@ -85,8 +68,8 @@ You can use all transport types in the same configuration:
8568

8669
###Required Fields
8770

88-
-**At least one**of`command`,`url`,or`sseUrl` must be specified
89-
-`args`: Array of arguments (can be empty for HTTP/SSE servers)
71+
-**Either**`command`or`url` must be specified
72+
-`args`: Array of arguments (can be empty for HTTP servers)
9073

9174
###Optional Fields
9275

@@ -97,29 +80,21 @@ You can use all transport types in the same configuration:
9780

9881
##Transport Selection Logic
9982

100-
AutoDev automatically selects the appropriate transport based on your configuration (in priority order):
83+
AutoDev automatically selects the appropriate transport based on your configuration:
10184

102-
1. If`sseUrl` is provided → Uses`SseClientTransport` (highest priority)
103-
2. If`url` is provided → Uses`StreamableHttpClientTransport`
104-
3. If`command` is provided → Uses`StdioClientTransport`
105-
4. If none are provided → Logs warning and skips the server
85+
1. If`url` is provided → Uses`StreamableHttpClientTransport`
86+
2. If`command` is provided → Uses`StdioClientTransport`
87+
3. If neither is provided → Logs warning and skips the server
10688

107-
**Note**: Ifmultiple transport options are specified,SSE hasthe highestpriority, followed by HTTP, then stdio.
89+
**Note**: Ifboth transport options are specified,HTTP has priority over stdio.
10890

109-
##Benefits ofRemote Transports
91+
##Benefits ofHTTP Transport
11092

111-
###HTTP Transport
11293
-**Remote Access**: Connect to MCP servers running on different machines
11394
-**Scalability**: Better for production deployments
11495
-**Firewall Friendly**: Uses standard HTTP protocols
11596
-**Load Balancing**: Can be used with load balancers and reverse proxies
11697

117-
###SSE Transport
118-
-**Real-time Communication**: Server-Sent Events provide efficient streaming
119-
-**Low Latency**: Optimized for real-time data streaming
120-
-**Browser Compatible**: Standard web technology
121-
-**Connection Persistence**: Maintains long-lived connections for better performance
122-
12398
##Migration from stdio-only
12499

125100
Existing configurations with`command` will continue to work unchanged. To migrate a server to remote transports:
@@ -144,31 +119,22 @@ Existing configurations with `command` will continue to work unchanged. To migra
144119
}
145120
```
146121

147-
**After (SSE):**
148-
```json
149-
{
150-
"my-server": {
151-
"sseUrl":"http://localhost:3000/sse",
152-
"args": []
153-
}
154-
}
155-
```
122+
156123

157124
##Troubleshooting
158125

159126
###Connection Issues
160127

161-
- Verify the HTTP/SSE server is running and accessible
128+
- Verify the HTTP server is running and accessible
162129
- Check firewall settings for HTTP connections
163-
- Ensure the MCP server supports the appropriate transport protocol (HTTP or SSE)
164-
- For SSE: Verify the server supports Server-Sent Events and the endpoint is correct
130+
- Ensure the MCP server supports the HTTP transport protocol
165131

166132
###Configuration Errors
167133

168134
- Validate JSON syntax in your configuration file
169-
- Ensureat least one of`command`,`url`,or`sseUrl` is specified for each server
135+
- Ensureeither`command`or`url` is specified for each server
170136
- Check server logs for detailed error messages
171137

172138
##Examples
173139

174-
See`example/mcp/streamable-http-example.mcp.json` for a complete configuration example withall transport types (stdio, HTTP,andSSE).
140+
See`example/mcp/streamable-http-example.mcp.json` for a complete configuration example withboth transport types (stdioandHTTP).

‎example/mcp/streamable-http-example.mcp.json‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
"url":"http://localhost:8080/mcp",
55
"args": []
66
},
7-
"remote-sse-server": {
8-
"sseUrl":"http://localhost:8080/sse",
9-
"args": []
10-
},
117
"stdio-server": {
128
"command":"npx",
139
"args": ["@modelcontextprotocol/server-stdio"]
@@ -25,11 +21,6 @@
2521
"disabled":false,
2622
"autoApprove": ["safe_tool"],
2723
"requiresConfirmation": ["dangerous_tool"]
28-
},
29-
"sse-with-query-params": {
30-
"sseUrl":"https://api.example.com/mcp/sse?session=123&token=abc",
31-
"args": [],
32-
"autoApprove": ["read_only_tool"]
3324
}
3425
}
3526
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp