Commit graph go-sdk/examples/http
Author SHA1 Message Date
Nick Masi
0edc5971cd
Update README.md (#896)
correct the default address of the locally hosted server, according to
`main.go:21` the default is `:8000` not `:8080`

Co-authored-by: Maciej Kisiel <mkisiel@google.com>
2026-04-24 11:47:17 +02:00
Spring_MT
35dfcf21c9
examples: Fix SSE streaming issue by moving logging from HTTP to MCP middlewarre (#614)
In `examples/http`, previous HTTP-level logging middleware blocked SSE
streaming because `handler.ServeHTTP()` does not return until the
connection closes for GET requests (SSE streams).
This prevented response headers from being sent to the client.

Changes:
- Replace HTTP-level logging handler with MCP middleware pattern
- Implement logging at the MCP protocol layer using mcp.Middleware
- Add middleware to server using AddReceivingMiddleware()
- Simplify main.go by removing HTTP handler wrapping

This allows SSE streams to work properly while still providing detailed
logging for all MCP protocol-level method calls.

Fixes #632
2025-11-11 11:56:52 -05:00
Bo-Yi Wu
920e5a39ba
docs: improve documentation clarity and client integration steps (#567)
- Fix typo in "TroubleShooting" heading, changing it to
"Troubleshooting"
- Improve CLI usage instructions by formatting commands as code blocks
and marking them with "bash"
- Change "Start the Server" to a third-level heading for clarity
- Add additional code examples for real-world client testing and
interaction steps
- Clarify and condense instructions for adding the tool to a popular MCP
client

---------

Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: Robert Findley <rfindley@google.com>
2025-10-13 11:47:58 -04:00
Adriel Velazquez
7a89c31c7a
Correct go run commands to run the logging file (#566)
Readme update and clarification

Targeting only the main.go doesn't add the logging file and causes
errors when finding additional functions.

```
mcp-server-testing main*​ ☸ prod-3-d 33s 
❯ go run main.go server
# command-line-arguments
./main.go:127:24: undefined: LoggingHandler

mcp-server-testing main*​ ☸ prod-3-d 
❯ go run . server      
2025/10/09 11:33:13 MCP server listening on localhost:8000
2025/10/09 11:33:13 Available tool: cityTime (cities: nyc, sf, boston)
```
2025-10-11 10:21:16 -04:00
Jonathan Amsterdam
be0a00cd0a
examples/http: update to v0.3.0
Fix build breakage.

Fixes #383.
2025-09-01 09:24:30 -04:00
Adam Koszek
a617dcea31
mcp/examples: HTTP server example with a simple client built-in (#168)
I'm adding a practical example of an MCP with HTTP streaming: both
client and server. Those are useful for testing real-world applications.
2025-08-30 14:30:48 -04:00