Skip to content

Commit 3666180

Browse files
authored
Merge pull request #71 from yigitkonur/master
fix transport flag documentation in readme
2 parents 83b8ae0 + fe32a2a commit 3666180

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

README.md

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ mcp tools npx -y @modelcontextprotocol/server-filesystem ~
148148

149149
#### HTTP SSE Transport
150150

151-
Uses HTTP and Server-Sent Events (SSE) to communicate with an MCP server via JSON-RPC 2.0. This is useful for connecting to remote servers that implement the legacy MCP protocol.
151+
Uses HTTP and Server-Sent Events (SSE) to communicate with an MCP server via JSON-RPC 2.0. This is useful for connecting to remote servers that implement the legacy MCP protocol. Transport is automatically detected when the URL ends with `/sse`.
152152

153153
```bash
154-
mcp tools --transport=sse http://localhost:3001/sse
154+
mcp tools http://localhost:3001/sse
155155

156156
# Example: Use the everything sample server
157157
# docker run -p 3001:3001 --rm -it tzolov/mcp-everything-server:v1
@@ -161,18 +161,18 @@ _Note:_ HTTP SSE currently supports only MCP protocol version 2024-11-05.
161161

162162
#### Streamable HTTP Transport (Recommended)
163163

164-
Uses streamable HTTP to communicate with an MCP server via JSON-RPC 2.0. This is the modern, recommended approach for connecting to remote servers that implement the MCP protocol. It supports both streaming responses and simple request/response patterns.
164+
Uses streamable HTTP to communicate with an MCP server via JSON-RPC 2.0. This is the modern, recommended approach for connecting to remote servers that implement the MCP protocol. It supports both streaming responses and simple request/response patterns. This is the default transport for HTTP/HTTPS URLs.
165165

166166
```bash
167-
# Default transport for HTTP URLs (explicit flag not needed)
167+
# Default transport for HTTP URLs
168168
mcp tools http://localhost:3000
169169

170-
# Explicitly specify streamable HTTP transport
171-
mcp tools --transport=http http://localhost:3000
170+
# Streamable HTTP transport (auto-detected from URL)
171+
mcp tools http://localhost:3000
172172

173173
# Examples with remote servers
174174
mcp tools https://api.example.com/mcp
175-
mcp tools --transport=http https://ne.tools
175+
mcp tools https://ne.tools
176176
```
177177

178178
_Benefits of Streamable HTTP:_
@@ -395,12 +395,11 @@ mcp new tool:calculate --sdk=ts
395395
# Create a project with a specific transport type
396396
mcp new tool:calculate --transport=stdio
397397
mcp new tool:calculate --transport=sse
398-
mcp new tool:calculate --transport=http
399398
```
400399

401400
The scaffolding creates a complete project structure with:
402401

403-
- Server setup with chosen transport (stdio, SSE, or streamable HTTP)
402+
- Server setup with chosen transport (stdio or SSE)
404403
- TypeScript configuration with modern ES modules
405404
- Component implementations with proper MCP interfaces
406405
- Automatic wiring of imports and initialization
@@ -792,28 +791,28 @@ mcp guard --deny tools:write_*,delete_*,create_*,move_* npx -y @modelcontextprot
792791
Create and run a local streamable HTTP server:
793792

794793
```bash
795-
# Create a new MCP server with streamable HTTP transport
796-
mkdir my-http-server && cd my-http-server
797-
mcp new tool:example_tool --transport=http
794+
# Create a new MCP server with SSE transport (streamable HTTP not available in scaffolding)
795+
mkdir my-sse-server && cd my-sse-server
796+
mcp new tool:example_tool --transport=sse
798797

799798
# Install dependencies and build
800799
npm install && npm run build
801800

802-
# Start the server (will run on http://localhost:3000)
801+
# Start the server (will run SSE transport)
803802
npm start
804803
```
805804

806805
In a separate terminal, connect to your local server:
807806

808807
```bash
809-
# Connect to local streamable HTTP server
810-
mcp tools http://localhost:3000
808+
# Connect to local SSE server (adjust URL based on your server's SSE endpoint)
809+
mcp tools http://localhost:3000/sse
811810

812811
# Call a tool on the local server
813-
mcp call example_tool --params '{"input": "test"}' http://localhost:3000
812+
mcp call example_tool --params '{"input": "test"}' http://localhost:3000/sse
814813

815814
# Use with different output formats
816-
mcp tools --format pretty http://localhost:3000
815+
mcp tools --format pretty http://localhost:3000/sse
817816
```
818817

819818
Connect to remote streamable HTTP servers:
@@ -822,11 +821,11 @@ Connect to remote streamable HTTP servers:
822821
# Connect to a remote MCP server
823822
mcp tools https://api.example.com/mcp
824823

825-
# Use SSE transport for legacy servers
826-
mcp tools --transport=sse http://legacy-server.com/sse
824+
# Use SSE transport for legacy servers (auto-detected from /sse path)
825+
mcp tools http://legacy-server.com/sse
827826

828827
# Example with authentication headers (when supported)
829-
mcp tools --transport=http https://authenticated-mcp-server.com
828+
mcp tools https://authenticated-mcp-server.com
830829
```
831830

832831
### Script Integration

0 commit comments

Comments
 (0)