-
Notifications
You must be signed in to change notification settings - Fork 602
Improve Scenario Generation Using MCP Server #448
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cielonet
wants to merge
4
commits into
OpenPipe:main
Choose a base branch
from
cielonet:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This uses local vllm server. Update accordingly.
Author
python3 generate_from_http_mcp.py
======================================================================
🚀 MCP Scenario Generator
======================================================================
📍 Server: http://mcp-code-coverage:8000/mcp
🤖 LLM: gpt-oss
🎯 Scenarios: 10
🔍 Connecting to MCP server at http://mcp-code-coverage:8000/mcp...
✓ Connected successfully
✓ Found 4 tools and 1 resources
======================================================================
📋 Discovered Capabilities
======================================================================
🔧 Tools (4):
1. submit_testcase
Submit a test case for coverage analysis.
Args...
2. get_function_coverage
Get detailed line-by-line coverage for a specific funct...
3. get_file_coverage
Get coverage report for a specific source file.
...
4. get_coverage_summary
Get overall coverage summary across all files.
...
📚 Resources (1):
1. get_coverage_summary
Real-time coverage summary updated after each test case...
======================================================================
🎯 Generating Scenarios
======================================================================
[18:21:18] OK Using model: gpt-oss
[18:21:18] INFO Available: 4 tool(s), 1 resource(s).
[18:21:18] STEP Preparing prompt for scenario generation
[18:21:18] STEP Calling model: gpt-oss
[18:21:25] OK Model responded in 7.66s.
[18:21:25] INFO Raw content length: 3452 chars.
[18:21:25] STEP Parsing model output
[18:21:25] STEP Connecting to MCP server for JSON formatting
[18:21:25] OK Using MCP tool: format_scenario
[18:21:25] INFO Formatted 5/10 scenarios
[18:21:25] INFO Formatted 10/10 scenarios
[18:21:26] OK Formatted 10 scenarios via MCP server.
[18:21:26] INFO Difficulty distribution:
1/5: 1 █
2/5: 1 █
3/5: 3 ███
4/5: 3 ███
5/5: 2 ██
1. Submit a single HTML test case that intentionally omits the `<title>` tag and use `submit_testcase` to trigger coverage… (difficulty 1/5)
2. Run a JavaScript test case (`test_type="js"`) designed to exercise a rarely used branch in the `calculateDiscount` funct… (difficulty 2/5)
3. Submit a PNG rendering test (`test_type="png"`) that draws a complex UI component. After submission, use `get_file_cover… (difficulty 3/5)
4. Evaluate overall health of the codebase by invoking `get_coverage_summary`. Parse the returned statistics to produce a c… (difficulty 3/5)
5. Create a raw data test (`test_type="raw"`) that feeds malformed JSON to the `parseConfig` function. After running the te… (difficulty 4/5)
[18:21:26] OK Generated 10 scenarios in 7.73s total.
======================================================================
💾 Saving Scenarios
======================================================================
✓ Saved to: scenarios.json
✓ File size: 4,290 bytes
======================================================================
📊 Summary
======================================================================
📈 Statistics:
Total scenarios: 10
Average difficulty: 3.4/5
Average task length: 306 characters
📊 Difficulty Distribution:
1/5: 1 ( 10.0%) ██████████
2/5: 1 ( 10.0%) ██████████
3/5: 3 ( 30.0%) ██████████████████████████████
4/5: 3 ( 30.0%) ██████████████████████████████
5/5: 2 ( 20.0%) ████████████████████
✅ Complete!
root@art:/workspace/code-coverage-agent# cat scenarios.json
{
"metadata": {
"generated_at": "2025-11-01T18:21:26.002254",
"mcp_server_url": "http://mcp-code-coverage:8000/mcp",
"llm_model": "gpt-oss",
"num_tools": 4,
"num_resources": 1,
"tool_names": [
"submit_testcase",
"get_function_coverage",
"get_file_coverage",
"get_coverage_summary"
],
"resource_names": [
"get_coverage_summary"
],
"summary": {
"total_scenarios": 10,
"difficulty_distribution": {
"1": 1,
"2": 1,
"3": 3,
"4": 3,
"5": 2
},
"avg_difficulty": 3.4,
"avg_task_length": 305.5
}
},
"scenarios": [
{
"task": "Submit a single HTML test case that intentionally omits the `<title>` tag and use `submit_testcase` to trigger coverage of the HTML validator. After execution, retrieve the real\u2011time summary from `coverage://summary` to confirm that the tidy warning count increased.",
"difficulty": 1
},
{
"task": "Run a JavaScript test case (`test_type=\"js\"`) designed to exercise a rarely used branch in the `calculateDiscount` function. Then call `get_function_coverage` for `calculateDiscount` to verify that the new branch was hit and see its line\u2011by\u2011line coverage diff.",
"difficulty": 2
},
|
cielonet
commented
Nov 1, 2025
Author
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a true MCP stdio server... could make better... but works
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request improves the scenario/test case generation process by using a local mcp (stdio) format server to generate the response needed for scenarios.
Included in the examples directory are two modified files that use local llm's with local mcp servers.