Skip to content
Merged

demo #433

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 30 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# RSCG - 242 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
# RSCG - 243 Examples of Roslyn Source Code Generators / 16 created by Microsoft /

The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 242 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 243 Roslyn Source Code Generator (RSCG) examples. The system transforms individual RSCG projects into structured documentation with code examples and cross-referenced content with a searchable website and code example exports.

This system serves as both a learning resource for .NET developers interested in source generators and an automated pipeline for maintaining up-to-date documentation about the RSCG ecosystem

## Latest Update : 2025-11-11 => 11 November 2025
## Latest Update : 2025-11-15 => 15 November 2025

If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***

Expand All @@ -24,11 +24,11 @@ If you want to be notified each time I add a new RSCG example , please click htt

## Content

Those are the 242 Roslyn Source Code Generators that I have tested you can see and download source code example.
Those are the 243 Roslyn Source Code Generators that I have tested you can see and download source code example.
( including 16 from Microsoft )
### 242. [RSCG_MCP2File](https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2File) , in the [MCP](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mcp) category
### 243. [RSCG_MCP2File](https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2File) , in the [MCP](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mcp) category

Generated on : 2025-11-11 => 11 November 2025
Generated on : 2025-11-15 => 15 November 2025

<details>
<summary>Expand</summary>
Expand All @@ -48,9 +48,9 @@ Source: [https://github.com/ignatandrei/RSCG_OpenApi2MCP](https://github.com/ign

</details>

### 241. [DecoratorGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator) , in the [Decorator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#decorator) category
### 242. [DecoratorGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/DecoratorGenerator) , in the [Decorator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#decorator) category

Generated on : 2025-11-10 => 10 November 2025
Generated on : 2025-11-13 => 13 November 2025

<details>
<summary>Expand</summary>
Expand All @@ -72,6 +72,28 @@ Source: [https://github.com/CodingFlow/decorator-generator](https://github.com/C

</details>

### 241. [RSCG_MCP2OpenAPI](https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2OpenAPI) , in the [MCP](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mcp) category

Generated on : 2025-11-11 => 11 November 2025

<details>
<summary>Expand</summary>



Author: Ignat Andrei

Generating Swagger/OpenAPI function from MCP tool.

Nuget: [https://www.nuget.org/packages/RSCG_MCP2OpenAPI/](https://www.nuget.org/packages/RSCG_MCP2OpenAPI/)


Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2OpenAPI](https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2OpenAPI)

Source: [https://github.com/ignatandrei/RSCG_OpenApi2MCP](https://github.com/ignatandrei/RSCG_OpenApi2MCP)

</details>

### 240. [XmlCommentGenerator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/XmlCommentGenerator) , in the [API](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) category

Generated on : 2025-11-09 => 09 November 2025
Expand Down
2 changes: 1 addition & 1 deletion later.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Just later

## Latest Update : 2025-11-11 => 11 November 2025
## Latest Update : 2025-11-15 => 15 November 2025



Expand Down
48 changes: 48 additions & 0 deletions v2/.tours/RSCG_MCP2OpenAPI.tour
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"

}
5 changes: 3 additions & 2 deletions v2/Generator/all.csv
Original file line number Diff line number Diff line change
Expand Up @@ -239,5 +239,6 @@ Nr,Key,Source,Category
238,TeCLI, https://github.com/tyevco/TeCLI,CommandLine
239,TUnit, https://github.com/thomhurst/TUnit,Tests
240,XmlCommentGenerator, https://github.com/dotnet/dotnet/,API
241,DecoratorGenerator, https://github.com/CodingFlow/decorator-generator,Decorator
242,RSCG_MCP2File, https://github.com/ignatandrei/RSCG_OpenApi2MCP,MCP
241,RSCG_MCP2OpenAPI, https://github.com/ignatandrei/RSCG_OpenApi2MCP,MCP
242,DecoratorGenerator, https://github.com/CodingFlow/decorator-generator,Decorator
243,RSCG_MCP2File, https://github.com/ignatandrei/RSCG_OpenApi2MCP,MCP
11 changes: 9 additions & 2 deletions v2/RSCGExamplesData/GeneratorDataRec.json
Original file line number Diff line number Diff line change
Expand Up @@ -1454,16 +1454,23 @@
"dtStart": "2025-11-09T00:00:00",
"show": true
},
{
"ID":"RSCG_MCP2OpenAPI",
"Category": 42,
"dtStart": "2025-11-11T00:00:00",
"show": true
},

{
"ID":"DecoratorGenerator",
"Category":41,
"dtStart": "2025-11-10T00:00:00",
"dtStart": "2025-11-13T00:00:00",
"show": true
},
{
"ID":"RSCG_MCP2File",
"Category": 42,
"dtStart": "2025-11-11T00:00:00",
"dtStart": "2025-11-15T00:00:00",
"show": true
}
]
2 changes: 1 addition & 1 deletion v2/book/examples/DecoratorGenerator.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<h1>RSCG nr 241 : DecoratorGenerator</h1>
<h1>RSCG nr 242 : DecoratorGenerator</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/DecoratorGenerator/" target="_blank">https://www.nuget.org/packages/DecoratorGenerator/</a>
Expand Down
2 changes: 1 addition & 1 deletion v2/book/examples/RSCG_MCP2File.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<h1>RSCG nr 242 : RSCG_MCP2File</h1>
<h1>RSCG nr 243 : RSCG_MCP2File</h1>

<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/RSCG_MCP2File/" target="_blank">https://www.nuget.org/packages/RSCG_MCP2File/</a>
Expand Down
69 changes: 69 additions & 0 deletions v2/book/examples/RSCG_MCP2OpenAPI.html
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>

8 changes: 6 additions & 2 deletions v2/book/list.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</head>
<body>
<h1>
This is the list of 242 RSCG with examples =>
This is the list of 243 RSCG with examples =>
</h1>

<table >
Expand Down Expand Up @@ -988,10 +988,14 @@ <h1>
</tr>
<tr>
<td>241</td>
<td><a href="examples/DecoratorGenerator.html">DecoratorGenerator</a></td>
<td><a href="examples/RSCG_MCP2OpenAPI.html">RSCG_MCP2OpenAPI</a></td>
</tr>
<tr>
<td>242</td>
<td><a href="examples/DecoratorGenerator.html">DecoratorGenerator</a></td>
</tr>
<tr>
<td>243</td>
<td><a href="examples/RSCG_MCP2File.html">RSCG_MCP2File</a></td>
</tr>
</table>
Expand Down
1 change: 1 addition & 0 deletions v2/book/pandocHTML.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ input-files:
- examples/TeCLI.html
- examples/TUnit.html
- examples/XmlCommentGenerator.html
- examples/RSCG_MCP2OpenAPI.html
- examples/DecoratorGenerator.html
- examples/RSCG_MCP2File.html

Expand Down
24 changes: 24 additions & 0 deletions v2/rscg_examples/RSCG_MCP2OpenAPI/description.json
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":[""]
},
Comment on lines +18 to +19
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Replace empty string with an empty array for includeAdditionalFiles.

An empty string entry can be misinterpreted as a path; prefer no entries.

-      "includeAdditionalFiles":[""]
+      "includeAdditionalFiles":[]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"includeAdditionalFiles":[""]
},
"includeAdditionalFiles":[]
},
🤖 Prompt for AI Agents
In v2/rscg_examples/RSCG_MCP2OpenAPI/description.json around lines 18 to 19,
replace the includeAdditionalFiles value which is currently an array containing
an empty string ([""]) with an empty array ([]) so there are no stray path
entries; update the JSON so includeAdditionalFiles has no entries instead of a
blank string element.

"links":{
"blog":"",
"video":""
}
}
1 change: 1 addition & 0 deletions v2/rscg_examples/RSCG_MCP2OpenAPI/nuget.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Generating Swagger/OpenAPI function from MCP tool.
1 change: 1 addition & 0 deletions v2/rscg_examples/RSCG_MCP2OpenAPI/readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This is a place holder
3 changes: 3 additions & 0 deletions v2/rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo.slnx
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 v2/rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/MCPDemo.csproj
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>
19 changes: 19 additions & 0 deletions v2/rscg_examples/RSCG_MCP2OpenAPI/src/MCPDemo/MyTools.cs
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;
}

}
Loading