xk6-infobip
k6 extension for Model Context Protocol (MCP) integration
claude mcp add --transport stdio infobip-xk6-infobip-mcp npx -y infobip-xk6-infobip-mcp
How to use
This MCP server extension provides a JavaScript API for interacting with MCP servers via k6. It enables performance testing by creating MCP clients, invoking tools on the server, and managing connections within your load tests. Use the NewClient function to establish a connection to your MCP endpoint, callTool to execute server-side tools with a structured set of arguments, and closeConnection when youโre finished to clean up resources. The extension is designed to work with any MCP-compliant server and is particularly aligned with Infobip MCP deployments, though it can be used against any MCP endpoint that follows the MCP protocol.
Within your test script, you initialize a client with endpoint, timeout, transport mode (SSE or HTTP), and optional headers for authentication or custom content types. You can then call a specific tool by name and supply the required parameter object. The client returns the tool response, which you can log or assert against in your test. Remember to close the connection after each virtual user iteration or as appropriate for your scenario to avoid resource leaks. The API exposes metrics for tool call duration, total calls, success and error rates, as well as standard HTTP metrics gathered by k6.
How to install
Prerequisites:
- Go installed on your machine (for building with xk6)
- A working Go toolchain and environment
- Access to the internet to fetch modules
Step-by-step installation:
- Install the xk6 tool to build a custom k6 binary with the MCP extension:
go install go.k6.io/xk6/cmd/xk6@latest
- Build a custom k6 binary with the xk6-infobip-mcp extension:
xk6 build --with github.com/infobip/xk6-infobip-mcp
- Verify the build and ensure the custom k6 binary is executable (the binary will be named k6 in your current directory unless you rename it).
./k6 version
- Prepare your test script (e.g., script.js) and run it with the custom binary:
./k6 run script.js
Notes:
- Ensure you have network access to the MCP endpoint you intend to test.
- If you need authentication, configure headers in the NewClient config as shown in the README example.
Additional notes
Tips and caveats:
- The extension is designed to work with MCP servers following the standard MCP protocol. If your server uses a non-standard endpoint path or requires a specific transport, configure isSSE and headers accordingly.
- Monitor MCP-specific metrics (mcp_call_duration, mcp_calls, mcp_success, mcp_errors) along with standard http metrics to diagnose performance bottlenecks.
- When using SSE transport (config.isSSE = true), be aware of long-lived connections and potential timeouts; adjust the timeout accordingly in the client configuration.
- If you encounter connection errors, verify endpoint URLs, TLS settings, and that the server permits the required HTTP methods and headers.
- Cache or reuse clients where appropriate to reduce connection overhead in high-VU scenarios, but ensure tests donโt carry over state across iterations unexpectedly.
Related MCP Servers
mcp-for-beginners
This open-source curriculum introduces the fundamentals of Model Context Protocol (MCP) through real-world, cross-language examples in .NET, Java, TypeScript, JavaScript, Rust and Python. Designed for developers, it focuses on practical techniques for building modular, scalable, and secure AI workflows from session setup to service orchestration.
mcp-language
mcp-language-server gives MCP enabled clients access semantic tools like get definition, references, rename, and diagnostics.
sandbox
A Model Context Protocol (MCP) server that enables LLMs to run ANY code safely in isolated Docker containers.
CanvasMCPClient
Canvas MCP Client is an open-source, self-hostable dashboard application built around an infinite, zoomable, and pannable canvas. It provides a unified interface for interacting with multiple MCP (Model Context Protocol) servers through a flexible, widget-based system.
litemcp
A minimal, lightweight client designed to simplify SDK adoption into MCP
MCPlex-AI-v1.0
๐ ๐ผ๐ฑ๐ฒ๐น ๐๐ผ๐ป๐๐ฒ๐ ๐ ๐ฃ๐ฟ๐ผ๐๐ผ๐ฐ๐ผ๐น (๐ ๐๐ฃ) ๐๐ฎ๐๐ฒ๐ฑ ๐๐๐ ๐๐ | ๐ง๐ผ๐ผ๐น ๐๐ป๐๐ฒ๐ด๐ฟ๐ฎ๐๐ถ๐ผ๐ป | ๐๐ฒ๐บ๐ถ๐ป๐ถ ๐ฎ.๐ฌ