SSE, Socket.IO and MCP

Server-sent events, Socket.IO and Model Context Protocol requests: connect, listen, emit and call.

SSE, Socket.IO and MCP Support

Besides REST, GraphQL, SOAP, gRPC and WebSocket, Requests can hold three more kinds of connection: server-sent events, Socket.IO and Model Context Protocol (MCP). They are saved in the workspace like any other request, support environment variables and vaults, and can be sent from the bifurc command.

Like gRPC and WebSocket, they are opened by the engine directly. They do not pass through the proxies, so mocks and proxy rules do not apply to them.


Server-sent events (SSE)

Open a text/event-stream connection and watch the events arrive in a searchable stream log.

  1. Open Requests and create an SSE request
  2. Enter the URL, and the method, headers and body if the endpoint needs them
  3. Connect
  4. Search the stream log for the event you are looking for
  5. Disconnect when you are done

From a terminal:

bifurc requests send --type sse --url https://example.com/events --wait 5

--wait is how many seconds to listen. The command opens the stream, prints the events that arrive in that time (or until the server ends it), and closes it.


Socket.IO

Connect to a Socket.IO v3 or v4 server.

  1. Open Requests and create a Socket.IO request
  2. Enter the server URL, and the namespace (for example /chat) if it is not the default
  3. Add an auth payload if the server expects one
  4. Name the events you want to listen to
  5. Connect, then emit events and read what comes back

Details:

  • Namespace and path. The namespace defaults to / and the path to /socket.io; both can be changed.
  • Auth payload. A JSON object sent in the handshake.
  • Listening. Only the events you choose to listen to are logged. With none chosen, every event is.
  • Emitting. The arguments of an event are a JSON array (one argument per element), any other JSON value, or plain text as a single argument.
  • Acknowledgements. An emit can ask the server to acknowledge it.

From a terminal:

bifurc requests send --type socketio --url https://example.com --namespace /chat \
  --listen message --event hello -d '["world"]' --ack

MCP

Connect to a Model Context Protocol server, see what it declares, and call it.

  1. Open Requests and create an MCP request
  2. Choose the transport:
    • stdio: the request is the command that starts the server, and environment variables for the program are set as headers
    • Streamable HTTP: the request is the server's endpoint URL, with any headers it needs
  3. Connect
  4. Browse the tools, prompts and resources the server declares
  5. Call a tool or a prompt with arguments, or read a resource, and inspect the answer

Argument values are read as the type the tool declares for them, so limit=10 is sent as a number when the tool asks for one.

From a terminal:

bifurc requests send --type mcp --transport stdio --url "npx some-mcp-server"
bifurc requests send --type mcp --url https://example.com/mcp --tool search --arg query=bifurc

Without --tool, --prompt or --resource, send connects and prints the tools, prompts and resources the server declares.


Good use cases

  • checking that a service's event stream sends what a front end expects
  • exercising Socket.IO namespaces, auth and acknowledgements without a throwaway client
  • trying an MCP server's tools before wiring it into an agent