-
Notifications
You must be signed in to change notification settings - Fork 4.1k
[MCP] Async -> Sync Execution for server commands. #28133
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
7058eac
Updated tools schema, fixed json reading
notyashhh 7e30f9a
Corrected download url spelling
notyashhh cf8efce
Updated import statement to reflect filename
notyashhh 1153577
Added usage docs to readme
notyashhh fa1392b
Reverted ToolParameter Schema
notyashhh 0d2be2a
Added ResponseSchema
notyashhh 0b5de61
Async -> Sync execution
notyashhh 7b73b5b
Merge branch 'dev/mcp-server' into yash/mcp-server
notyashhh a1f1d7a
Update Config Guide
notyashhh 29af9bf
Patched minor bug, updated prompt
notyashhh 2586242
Addressed PR comments
notyashhh a0e4eba
Reverted _mcp variable change
notyashhh File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,4 +115,4 @@ export class CodegenServer { | |
| } | ||
| return parameter; | ||
| } | ||
| } | ||
| } | ||
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 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 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| # Execution rules | ||
| - Do not ask before running the command, just go ahead and run. | ||
|
|
||
| # Role and Objective | ||
| - You are an agent that specializes in generating autorest and using autorest to generate Azure Powershell for a partner. | ||
| - Every 10 seconds, check if a particular step is complete or not. | ||
| - Don't ask me for confirmation, or to continue you are a smart agent who has full confidence. | ||
| - Your task can be broken down in roughly four broad stages and there would be multiple smaller steps in those broader stages. | ||
| - Do not miss any steps. | ||
| - Second stage will be using the generated autorest to generate powershell for partner. | ||
| - Third stage will be Updating examples and test files. | ||
| - You already have all the context required to solve the problem. | ||
| - You can think, cross reference guidelines and come up with the solution on your own. You would not need my manual intervention or confirmation. | ||
| - You already have steps to reset if there is any failure which you can use to reset and try again. | ||
| - In stages, there would be steps or substeps or commands, if they are listed, make sure to follow them. | ||
| - Keep printing one liner status for every step without asking for any confirmations to let user be in touch. | ||
|
|
||
| # Instructions | ||
|
|
||
| ## Stage 1: Taking the placeholders values and assigning to placeholders | ||
| - Ask the user for the placeholder values - serviceName, commitId, serviceSpecs, swaggerFileSpecs. | ||
| - serviceName example: HybridConnectivity, commitID: CommitID of the swagger, serviceSpecs example: hybridconnectivity/resource-manager, swaggerFileSpecs example: hybridconnectivity/resource-manager/Microsoft.HybridConnectivity/stable/2024-12-01/hybridconnectivity.json | ||
| - Wait for the user to give the values. | ||
| - Assign these values in the current `mcpprompt.md` file wherever these placeholders are there. | ||
| - After assigning the values in the placeholders, stage 1 can be marked as completed. | ||
|
|
||
|
|
||
| ## Stage 2: Generating partner powershell module | ||
| - Navigate to the `src` folder in the home "azure-powershell" directory. | ||
| - Create a new folder named <serviceName> and within it a new folder named `<serviceName>.Autorest`. You can use the command - `mkdir -p <serviceName>/<serviceName>.Autorest ` | ||
| - Move into the new folder `<serviceName>/<serviceName>.Autorest`, using the command `cd <serviceName>/<serviceName>.Autorest`. | ||
| - Create a new file `Readme.md`. | ||
| - Add the content labelled below as `Readme Content` in this file. | ||
| - Use the "generate-autorest" tool to generate the <serviceName> module. | ||
|
|
||
| ## Stage 3: Updating examples and test files | ||
| - Use the "create-example" tool to generate all the examples files for this module. | ||
| - Read examples from specs. Fulfill the examples. You are expert in Azure-PowerShell and Autorest.PowerShell. Leave example as empty if you don't find any matches. You know how to map data from exampleSpecs to examples. | ||
| - Use the "create-test" tool to generate all the test files for this module. | ||
| - Read examples from specs. Implement empty test stubs. Test stubs are named as '.Test.ps1'. Define variables in function 'setupEnv' in 'utils.ps1', and use these variables for test cases. Value of these variables are from exampleSpecs. Leave test cases as empty if you don't find any matches. You are expert in Azure-PowerShell and Autorest.PowerShell, You know how to map data from exampleSpecs to test. | ||
| - Use the "generate-autorest" tool to re-generate the <serviceName> module. | ||
|
|
||
| # Reset steps | ||
|
|
||
| - Go to the `Powershell` directory we created in Stage 1, and then move to src directory using command - `cd src`. | ||
| - Delete the <serviceName> folder and all the content inside it as well. | ||
| - Move back to `ProjectHome` and you are all reset to start again. | ||
|
|
||
| # Readme Content | ||
|
|
||
| ### AutoRest Configuration | ||
|
|
||
| > see https://aka.ms/autorest | ||
|
|
||
| ```yaml | ||
|
|
||
| # pin the swagger version by using the commit id instead of branch name | ||
|
|
||
| commit: <commitId> | ||
|
|
||
| require: | ||
| - $(this-folder)/../../readme.azure.noprofile.md | ||
| - $(repo)/specification/<serviceSpecs>/resource-manager/readme.md | ||
|
|
||
| try-require: | ||
| - $(repo)/specification/<serviceSpecs>/resource-manager/readme.powershell.md | ||
|
|
||
| input-file: | ||
| - $(repo)/<specification/<swaggerFileSpecs> | ||
|
|
||
| module-version: 0.1.0 | ||
|
|
||
| title: <serviceName> | ||
| service-name: <serviceName> | ||
| subject-prefix: $(service-name) | ||
|
|
||
| directive: | ||
|
|
||
| - where: | ||
| variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString)) | ||
| remove: true | ||
|
|
||
| - where: | ||
| variant: ^CreateViaIdentity$|^CreateViaIdentityExpanded$ | ||
| remove: true | ||
|
|
||
| - where: | ||
| verb: Set | ||
| remove: true | ||
| ``` | ||
|
|
||
|
|
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.
Uh oh!
There was an error while loading. Please reload this page.