Replies: 1 comment
|
There are two separate issues here:
Run the memory example from the repository root: go run ./examples/server/memory -http :8888Then use a stateful streamable-HTTP session. The first request returns an curl -i http://localhost:8888/ \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
--data-raw '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"1.0"}}}'Complete the handshake (replace curl -i http://localhost:8888/ \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: <SESSION_ID>" \
-H "Mcp-Protocol-Version: 2025-06-18" \
--data-raw '{"jsonrpc":"2.0","method":"notifications/initialized","params":{}}'List tools and call one of the memory tools: curl http://localhost:8888/ \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: <SESSION_ID>" \
-H "Mcp-Protocol-Version: 2025-06-18" \
--data-raw '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'
curl http://localhost:8888/ \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Mcp-Session-Id: <SESSION_ID>" \
-H "Mcp-Protocol-Version: 2025-06-18" \
--data-raw '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"search_nodes","arguments":{"query":"Ada"}}}'The |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Pre-submission Checklist
Question Category
Your Question
I would like to request complete examples for using the example MCP servers, I tried to run the mcp server on my localhost and curl to it for testing before connecting it with agents, but it keeps error out, e.g., for the example hello MCP server, i keep getting the following error:
I did call:
and
curl -v -X POST http://localhost:8888 -H "Accept: application/json, text/event-stream" -d '{"jsonrpc":"2.0","method":"notifications/initialized"}'All reactions