-
-
Notifications
You must be signed in to change notification settings - Fork 6
demo #433
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
demo #433
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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,48 @@ | ||
|
|
||
| { | ||
| "$schema": "https://aka.ms/codetour-schema", | ||
| "title": "RSCG_MCP2OpenAPI", | ||
| "steps": | ||
| [ | ||
| { | ||
| "file": "rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/MCPDemo.csproj", | ||
| "description": "First, we add Nuget [RSCG_MCP2OpenAPI](https://www.nuget.org/packages/RSCG_MCP2OpenAPI/) in csproj ", | ||
| "pattern": "RSCG_MCP2OpenAPI" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/MyTools.cs", | ||
| "description": "File MyTools.cs ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/Program.cs", | ||
| "description": "File Program.cs \r\n>> dotnet run --project rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/MCPDemo.csproj ", | ||
| "pattern": "this is the code" | ||
| } | ||
|
|
||
|
|
||
| ,{ | ||
| "file": "rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/obj/GX/RSCG_MCP2OpenAPI/RSCG_MCP2OpenAPI.MCP2OpenAPI/MyTools_ExportToFile.g.cs", | ||
| "description": "Generated File 3 from 3 : MyTools_ExportToFile.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/obj/GX/RSCG_MCP2OpenAPI/RSCG_MCP2OpenAPI.MCP2OpenAPI/Microsoft.CodeAnalysis.EmbeddedAttribute.cs", | ||
| "description": "Generated File 2 from 3 : Microsoft.CodeAnalysis.EmbeddedAttribute.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ,{ | ||
| "file": "rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/obj/GX/RSCG_MCP2OpenAPI/RSCG_MCP2OpenAPI.MCP2OpenAPI/MCP2OpenAPI.g.cs", | ||
| "description": "Generated File 1 from 3 : MCP2OpenAPI.g.cs ", | ||
| "line": 1 | ||
| } | ||
|
|
||
| ], | ||
|
|
||
| "ref": "main" | ||
|
|
||
| } |
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
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,69 @@ | ||
|
|
||
| <h1>RSCG nr 241 : RSCG_MCP2OpenAPI</h1> | ||
|
|
||
| <h2>Info</h2> | ||
| Nuget : <a href="https://www.nuget.org/packages/RSCG_MCP2OpenAPI/" target="_blank">https://www.nuget.org/packages/RSCG_MCP2OpenAPI/</a> | ||
|
|
||
| <p>You can find more details at : <a href="https://github.com/ignatandrei/RSCG_OpenApi2MCP" target="_blank"> https://github.com/ignatandrei/RSCG_OpenApi2MCP</a></p> | ||
|
|
||
| <p>Author :Ignat Andrei</p> | ||
|
|
||
| <p>Source: <a href="https://github.com/ignatandrei/RSCG_OpenApi2MCP" target="_blank">https://github.com/ignatandrei/RSCG_OpenApi2MCP</a> </p> | ||
|
|
||
| <h2>About</h2> | ||
|
|
||
| Generating OpenAPI based on MCP source code. | ||
|
|
||
| <h2> | ||
| How to use | ||
| </h2> | ||
| <h3> | ||
| Add reference to the <a href="https://www.nuget.org/packages/RSCG_MCP2OpenAPI/" target="_blank">RSCG_MCP2OpenAPI</a> in the csproj | ||
| </h3> | ||
| <img src="images/RSCG_MCP2OpenAPI/MCPDemo.csproj.png" width="580" height="580" /> | ||
|
|
||
| <h3>This was for me the <b>starting</b> code</h3> | ||
|
|
||
| <br /> | ||
| I have <b>coded</b> the file Program.cs | ||
| <br /> | ||
| <img src="images/RSCG_MCP2OpenAPI/csFiles/Program.cs.png" width="580" height="580" /> | ||
| <hr /> | ||
|
|
||
| <br /> | ||
| I have <b>coded</b> the file MyTools.cs | ||
| <br /> | ||
| <img src="images/RSCG_MCP2OpenAPI/csFiles/MyTools.cs.png" width="580" height="580" /> | ||
| <hr /> | ||
| <h3>And here are the <i>generated</i> files</h3> | ||
|
|
||
| <br /> | ||
| The file <i>generated</i> is MCP2OpenAPI.g.cs | ||
| <br /> | ||
| <img src="images/RSCG_MCP2OpenAPI/generated/MCP2OpenAPI.g.cs.png" width="580" height="580" /> | ||
|
|
||
| <br /> | ||
| The file <i>generated</i> is Microsoft.CodeAnalysis.EmbeddedAttribute.cs | ||
| <br /> | ||
| <img src="images/RSCG_MCP2OpenAPI/generated/Microsoft.CodeAnalysis.EmbeddedAttribute.cs.png" width="580" height="580" /> | ||
|
|
||
| <br /> | ||
| The file <i>generated</i> is MyTools_ExportToFile.g.cs | ||
| <br /> | ||
| <img src="images/RSCG_MCP2OpenAPI/generated/MyTools_ExportToFile.g.cs.png" width="580" height="580" /> | ||
|
|
||
| <p> | ||
| You can download the code and this page as pdf from | ||
| <a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2OpenAPI'> | ||
| https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2OpenAPI | ||
| </a> | ||
| </p> | ||
|
|
||
|
|
||
| <p> | ||
| You can see the whole list at | ||
| <a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'> | ||
| https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG | ||
| </a> | ||
| </p> | ||
|
|
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,24 @@ | ||
| { | ||
| "generator":{ | ||
| "name":"RSCG_MCP2OpenAPI", | ||
| "nuget":[ | ||
| "https://www.nuget.org/packages/RSCG_MCP2OpenAPI/" | ||
| ], | ||
| "link":"https://github.com/ignatandrei/RSCG_OpenApi2MCP", | ||
| "author":"Ignat Andrei", | ||
| "source":"https://github.com/ignatandrei/RSCG_OpenApi2MCP" | ||
| }, | ||
| "data":{ | ||
| "goodFor":["Generating OpenAPI based on MCP source code."], | ||
| "csprojDemo":"MCPDemo.csproj", | ||
| "csFiles":["Program.cs","MyTools.cs"], | ||
| "excludeDirectoryGenerated":[ | ||
| "Microsoft.AspNetCore.OpenApi.SourceGenerators", | ||
| "Microsoft.AspNetCore.App.SourceGenerators"], | ||
| "includeAdditionalFiles":[""] | ||
| }, | ||
| "links":{ | ||
| "blog":"", | ||
| "video":"" | ||
| } | ||
| } | ||
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 @@ | ||
| Generating Swagger/OpenAPI function from MCP tool. |
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 @@ | ||
| This is a place holder |
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,3 @@ | ||
| <Solution> | ||
| <Project Path="MCPDemo/MCPDemo.csproj" /> | ||
| </Solution> |
24 changes: 24 additions & 0 deletions
24
v2/rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/MCPDemo.csproj
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,24 @@ | ||
| <Project Sdk="Microsoft.NET.Sdk"> | ||
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net10.0</TargetFramework> | ||
| <ImplicitUsings>enable</ImplicitUsings> | ||
| <Nullable>enable</Nullable> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.0" /> | ||
|
|
||
| <PackageReference Include="Microsoft.Extensions.Hosting" Version="10.0.0" /> | ||
| <PackageReference Include="ModelContextProtocol" Version="0.5.0-preview.1" /> | ||
| <PackageReference Include="ModelContextProtocol.AspNetCore" Version="0.5.0-preview.1" /> | ||
| <PackageReference Include="RSCG_MCP2OpenAPI" Version="9.2025.1202.1952" /> | ||
| <PackageReference Include="OpenAPISwaggerUI" Version="9.2024.1215.2209" /> | ||
| <PackageReference Include="Serilog.AspNetCore" Version="10.0.0" /> | ||
|
|
||
| </ItemGroup> | ||
| <PropertyGroup> | ||
| <EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> | ||
| <CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\GX</CompilerGeneratedFilesOutputPath> | ||
| </PropertyGroup> | ||
| </Project> |
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,19 @@ | ||
| using ModelContextProtocol.Server; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.ComponentModel; | ||
| using System.Text; | ||
|
|
||
| namespace MCPDemo; | ||
| [MCP2OpenAPI.AddMCP2OpenApi()] | ||
| partial class MyTools | ||
| { | ||
| [McpServerTool] | ||
| [Description("Echo demo")] | ||
| public async Task<string> SendEcho([Description("echo")] string echoData) | ||
| { | ||
| await Task.Delay(10); | ||
| return echoData; | ||
| } | ||
|
|
||
| } |
Oops, something went wrong.
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.
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.
Replace empty string with an empty array for includeAdditionalFiles.
An empty string entry can be misinterpreted as a path; prefer no entries.
📝 Committable suggestion
🤖 Prompt for AI Agents