Introduction
The MCP listener handles Model Context Protocol (MCP) client initialization requests automatically and enables a virtual asset to receive and respond to MCP messages sent over either HTTP with Server-Sent Events (SSE) or Streamable HTTP.
Requirements
- The MCP client must support at least protocol version 2024-11-05 for legacy requests or at least 2025-03-26 for streamable HTTP requests, and communicate using one of the following transport mechanisms based on the Transport Type configuration:
- Stateful/Stateless: Streamable HTTP transport (at least 2025-03-26)
- SSE: HTTP with Server-Sent Events (SSE) transport (at least 2024-11-05)
- This tool requires SOAtest/Virtualize 2024.1 or later, which needs to be configured to run with Java 17 or higher.
Installation
This tool can be installed from the UI or the command line.
UI Installation
- Go to Parasoft > Preferences and click System Properties.
- Click Add JARs and choose the com.parasoft.virtualize.listener.mcp-<version>.jar file.
- Click Apply.
- Restart SOAtest/Virtualize.
Command Line Installation
Add the com.parasoft.virtualize.listener.mcp-<version>.jar file to the system.properties.classpath property in your settings properties file. For example:
system.properties.classpath=<PATH_TO_JAR>/com.parasoft.virtualize.listener.mcp-<version>.jar
Usage
Once the MCP listener is installed, MCP Listener will be available in the Transports > Custom tab of the Virtual Asset configuration panel. Open this panel by double-clicking a virtual asset’s Virtualize Server node.
If multiple custom listeners are available, you can select the one you want to use from the Select Implementation menu.
Configuration
The following configuration options are available:
Connection Settings
| Port | Specify the port for the listener. Value must be between 1 and 65535. If empty, the listener will not start. |
|---|---|
| Endpoint | Specify the endpoint path for the MCP server. The default is /mcp. |
| Transport Type | Specify the transport mechanism for client-server communication. The following tranport types are available:
The default is stateful. |
| Worker Threads | Specify the number of worker threads used to process messages.
The default is |
| Heartbeat Interval | Specify a duration in seconds between sending ping requests to MCP clients which require a client response. Heartbeat interval is used to prevent connections from timing out. Set to
The default is |
Logging Settings
Log Level | Specify how much information you want logged to the console and the Event Monitoring view. The following levels are available:
The default is |
|---|
Configuring the Message Responders
While the MCP listener will return any response configured in the matching responder, it is recommended to format the response according to the JSON-RPC 2.0 specification for standard MCP communication.
Note that if the id field is provided in the response, it will be ignored and the id from the original request will be used instead. Additionally, if the jsonrpc field is not present in the response, it will be automatically added with the value 2.0.
Change Log
1.2.1
- Upgraded MCP SDK to version 0.17.2.
1.2
- Added support for Streamable HTTP transport.
1.1
- Updated the heartbeat mechanism and added the ability to disable heartbeat.
1.0
- Initial release.
Third-Party Content
This extension includes items that have been sourced from third parties as outlined below.
- jackson-annotations (Apache License 2.0 with this notice)
- jackson-core (Apache License 2.0 with this notice)
- jackson-databind (Apache License 2.0 with this notice)
- Java MCP
JavaSDK (MIT License) - Java MCP SDK Core (MIT License)
- Java MCP SDK JSON Support (MIT License)
- Java MCP SDK JSON Jackson (MIT License)
- SLF4J (MIT License)
- jackson-dataformat-yaml (Apache License 2.0 with this notice)
- SnakeYAML (Apache License 2.0)
- JsonSchemaValidator (Apache License 2.0 with this notice)
- Internet Time Utility (Apache License 2.0)
- Reactor Core (Apache License 2.0)
- Reactive Streams (MIT No Attribution)
Additional license details are available in this extension’s licenses folder.
