Other clients
Any client that speaks MCP over HTTP can use Kernl. This page shows the raw requests, which is also a good way to test your token.
Send initialize
curl -i -X POST http://localhost:3086/mcp \
-H "Authorization: Bearer $(kernl token)" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'
$(kernl token) is the Linux form. For macOS, Windows and Docker see Where things are.
The Accept header must list both types. With only application/json you get 406 Not Acceptable.
The reply is 200 OK and carries an mcp-session-id header. The body is framed as Server-Sent Events:
event: message
data: {"result":{"protocolVersion":"2025-03-26", ... },"jsonrpc":"2.0","id":1}
Copy the session id from the header.
Reuse the session
Tell Kernl you are ready, then ask for the tool list. Both calls carry the session id.
curl -i -X POST http://localhost:3086/mcp \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: <session-id>" \
-d '{"jsonrpc":"2.0","method":"notifications/initialized"}'
This returns 202 Accepted. Now list the tools:
curl -X POST http://localhost:3086/mcp \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "mcp-session-id: <session-id>" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
The list is long, because Kernl has many tools.
Error replies
401withUnauthorized: see 401 Unauthorized.404withSession not found: see Session not found.400withMissing mcp-session-id header: see Missing mcp-session-id.