Skip to content

Commit 0c06667

Browse files
authored
feat: add streamableHttp transport method support (#20)
Previously, this tool only supported SSE as the transport method for the remote servers it installed via supergateway. This resulted in errors for newer servers using streamable HTTP. This PR addresses this issue by allowing installation of both SSE and HTTP servers. There is no way to perfectly detect whether an MCP server uses streamable HTTP or SSE, but we can make a really good guess (the guesses were all perfect in my testing). We still ask the user for confirmation anyway though, just in case it makes a mistake. Claude Code requires the transport method to be specified and has no mechanism for detecting it AFAIK, so this is already an improvement. If the method cannot be guessed, the user is prompted.
2 parents 3fae822 + ebb2773 commit 0c06667

File tree

4 files changed

+704
-3
lines changed

4 files changed

+704
-3
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,50 @@ npx install-mcp https://api.example.com/mcp --client claude \
5353
--header "X-API-Key: secret-key"
5454
```
5555

56+
### Transport Methods for Remote Servers
57+
58+
When installing remote servers (URLs), the CLI needs to know which transport method the server uses. There are two transport methods:
59+
60+
- **Streamable HTTP** (modern, recommended)
61+
- **SSE** (legacy)
62+
63+
The CLI handles this in several ways:
64+
65+
#### Automatic Detection
66+
67+
By default, the CLI will automatically detect the transport method:
68+
69+
```bash
70+
npx install-mcp https://api.example.com/mcp --client claude
71+
# Output: Detecting transport type... this may take a few seconds.
72+
# Output: We've detected that this server uses the streamable HTTP transport method. Is this correct? (Y/n)
73+
```
74+
75+
If the detection succeeds, it will ask you to confirm. If you answer "no", it will use the other transport method.
76+
77+
#### Manual Specification
78+
79+
You can skip detection by specifying the transport method directly:
80+
81+
```bash
82+
# For streamable HTTP servers
83+
npx install-mcp https://api.example.com/mcp --client claude --transport http
84+
85+
# For legacy SSE servers
86+
npx install-mcp https://api.example.com/mcp --client claude --transport sse
87+
```
88+
89+
#### Fallback to Manual Questions
90+
91+
If auto-detection fails, the CLI will ask you directly:
92+
93+
```
94+
Could not auto-detect transport type, please answer the following questions:
95+
Does this server support the streamable HTTP transport method? (Y/n)
96+
```
97+
98+
Note: This only applies to URL-based installations. Package names and custom commands don't require transport selection.
99+
56100
where `<client>` is one of the following:
57101

58102
- `claude`

0 commit comments

Comments
 (0)