You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

You can configure AI-powered code editing tools like Copilot and Windsurf to use SOAtest and Virtualize as a Model Context Protocol (MCP) server. Once configured, those tools can use SOAtest and Virtualize directly. This works with the SOAVirt WAR as well as the SOAtest desktop server and Virtualize desktop server. This feature requires a license that has "MCP Server" enabled.

MCP Tools Available in SOAtest and Virtualize

The following tools are available. You can also see a list of available tools in your MCP client.

Informational

  • getStatus: Gets basic API user and server status info.
  • getStatusHealth: Retrieves server health metrics (CPU, memory, disk, threads).

Scenarios

  • createScenario: Creates a new API test scenario.
  • describeScenario: Describes scenarios created via MCP.
  • listScenarios: Lists scenarios created via MCP.
  • modifyScenario: Modifies scenarios created via MCP.
  • removeScenario: Deletes scenarios created via MCP.

Tests

  • addTest: Adds a test to an API test scenario.
  • describeTest: Describes tests created via MCP.
  • modifyTest: Modifies tests created via MCP.
  • removeTest: Deletes tests created via MCP.
  • makeHTTPRequest: Makes an HTTP request and returns the received HTTP response.
  • runAIAssertor: Evaluates whether a document satisfies one or more natural-language assertions or requirements.

Data Sources

  • addDataSource: Adds a data source to a test scenario.
  • describeDataSource: Describes data sources created via MCP.
  • modifyDataSource: Modifies data sources created via MCP.
  • removeDataSource: Deletes data sources created via MCP.

Virtual Services

  • manageVirtualServices: Creates stateful or stateless virtual services and assets on the Parasoft Virtualize server as well as lists, updates, describes, and deletes virtual services created via MCP.

Instruction Files

SOAtest automatically creates an instruction file (copilot-instructions.md) for LLMs using the MCP tools in the workspace at /TestAssets/.github/. Users accessing a remote SOAtest MCP server can download the instruction file from http://soatest-server:9080/soavirt/api/v6/files/download?id=/TestAssets/.github/copilot-instructions.md

Do not edit this instruction file directly. You may add your own custom instructions by creating a complementary instruction file (for example, my.instructions.md) and saving it in the /TestAssets/.github/instructions folder. The steps for adding custom instructions vary by MCP client (for SOAtest desktop users, you can find this under Copilot > Edit Preferences > Custom Instructions). See the help file in Copilot for more information.

While Copilot will automatically discover the copilot-instructions.md file, you can configure other LLM tools to use it. For example, if you have a SOAtest workspace open on your local filesystem and you're using Codex, you can point Codex to the instructions file by customizing your fallback filenames with a configuration like this:

# ~/.codex/config.toml
project_doc_fallback_filenames = [".github/copilot-instructions.md"] 

See https://developers.openai.com/codex/guides/agents-md#customize-fallback-filenames for more information about customizing fallback filenames in Codex.

Stateful Skill

The MCP server can create stateful assets with Virtualize, but it requires the appropriate skill first. For details on the installation and configuration of this skill, as well as its capabilities, usage examples, and CI/CD integration workflow, see the README document at: https://github.com/parasoft/soavirt-ai-agent-skills.

Before creating a stateful asset, you will need to configure connection settings for a Data Repository Server under Parasoft > Preferences > Data Repository Servers for the MCP server to use. See Data Repository Servers for more information.

Example Prompts

The following table provides some example prompts that you might use with your AI-powered code editing tool, once you have configured it with the MCP server endpoint, to satisfy common use cases. Notice that you do not have to specify the tools you want to use by name; the AI will usually figure it out from your plain-language request. If it's struggling with this, it can be helpful to use words that point it toward the tool you expect it to use.


Use Case: You want to...Example Prompt(s)Notes
1Verify connection to the SOAtest MCP server"Get the SOAtest server information."
2Perform an HTTP GET on an endpoint and get the response"GET http://localhost:8080/parabank/services/bank/customers/12212/accounts with SOAtest"Using "SOAtest" in the prompt can help the LLM know to use this MCP server instead of another that might also be registered.
3Leverage AI to validate an assertion on the content of the response traffic"Assert that none of the accounts have a negative balance."

This is a follow-up prompt to use case 2.

Using keywords in the prompt can help the LLM know which tool you want it to use (in this case, using the word "assert" to point it to the AI Assertor).

4Create a virtual service

"Create a virtual service named myService from the files in myFolder."

Replace "myService" and "myFolder" with names appropriate to your request. You should have the folder open in your IDE workspace or provide an absolute path to the file folder.

5Update a virtual service

"Update the virtual service named myService from the files in myFolder2."

This is a follow-up prompt to use case 4.

Replace "myService" and "myFolder2" with names appropriate to your request. You should have the folder open in your IDE workspace or provide an absolute path to the file folder.

6Create a virtual service on a specific port"Create a virtual service named myService from the files in myFolder on port 5555."

Replace "myService", "myFolder", and "5555" with names and port number appropriate to your request. You should have the folder open in your IDE workspace or provide an absolute path to the file folder.

If there is already a HTTP message proxy listening to the specified port and forwarding to a path inside Virtualize, the new service will be deployed on that path and provide content for that proxy.

7Get information about a virtual service/test scenario/test

"Describe the myService virtual service."
"Describe the myScenario scenario."
"Describe the myTest test."

Replace "myService/myScenario/myTest" with the name appropriate to your request.

Only works on assets that MCP created that are in the VirtualAssets/generated_by_mcp/ or TestAssets/generated_by_mcp/ folder; do not move assets created by MCP if you want it to be able to work on them further.

8Create a virtual service from a service definition

"Create a virtual service called bankingApp for this service definition: http://localhost:8080/parabank/services/bank/openapi.yaml. Use data that is appropriate for a bank."

"Create a virtual service called demoApp for service definition c:\temp\demo-app-v1.json. Use data that is appropriate for a camping store."

Replace "bankingApp" or "demoApp" with a name appropriate to your request. Also replace the example URL or file path with the location of your service definition.

The virtualize-stateless-virtual-service-creation skill is needed for this. For desktop users, the skill is automatically available; other users must install the Virtualize MCP skills from GitHub.

9Create a virtual service from a service definition for specific resources

"Create a virtual service called bankingApp for this service definition:  http://localhost:8080/parabank/services/bank/openapi.yaml that is just for account operations."

"Create a virtual service called demoApp for service definition c:\temp\demo-app-v1.json that is just for processing orders."

This is a more targeted version of use case 8 that creates your virtual service with only selected resources from the service definition.

Replace "bankingApp" or "demoApp" with a name appropriate to your request. Also replace the example URL or file path with the location of your service definition.

10Populate a virtual service with realistic request and response data

"Download the request and response data from the bankingApp virtual service and improve it with more realistic values. Update the bankingApp virtual service with the modified request and response data."

This is a follow-up to use cases like 8 and 9.

Replace "bankingApp" with a name appropriate to your request.
Only works on virtual services created via MCP.

11Create stateful virtual services and/or assets

"Create a stateful virtual service called demoApp for service definition c:\temp\demo-app-v1.json."

"Create a stateful virtual service using the sample request and response traffic pairs in the shoppingCartTraffic folder."

"Create a stateful virtual service called shoppingCart. It should have resources for items, customers and carts. Items should have id, name and price. Customers should have id, name, email."

Be sure you have installed the stateful skill before using MCP to create stateful assets.

Replace details like "demoApp", "shoppingCartTraffic", and "shoppingCart" with names appropriate to your request.

Be sure to include the word "stateful" in your request; the LLM is likely to create stateless assets unless otherwise directed.

You MCP client might have trouble creating a stateful virtual service from more than a handful of request/response pairs. If you experience this, ask the client to create an API definition file from traffic files first and create a stateful service from that definition.

12Get a list of virtual services/test scenarios/tests created by MCP in order to know which ones MCP can do further work on

"Show me a list of virtual services you can work on."
"Show me a list of test scenarios you can work on."
"Show me a list of tests you can work on."

Only works on assets that MCP created that are in the VirtualAssets/generated_by_mcp/ or TestAssets/generated_by_mcp/ folder; do not move assets created by MCP if you want it to be able to work on them further.

13Create a new scenario that makes a sequence of API calls and saves the scenario.

"Create an API test scenario for my REST API at http://localhost:8080/parabank/services/bank/openapi.yaml and add a test to get accounts for customer 12212."

Replace the ParaBank openapi.yaml with your own service definition for OpenAPI, WSDL or GraphQL.

14Create a scenario with a data source

"Create a test scenario for the operations in http://localhost:8080/calculator.wsdl parameterized with 5 rows of data."

The data source that is created will have column names, rows and values so that subsequent HTTP requests can reference those columns.


  • No labels