Skip to content

Commit 5e11812

Browse files
authored
Merge pull request #432 from ignatandrei/RSCG_MCP2File
2 parents 0d9b509 + 8e14650 commit 5e11812

File tree

224 files changed

+2076
-61
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+2076
-61
lines changed

README.md

Lines changed: 43 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
# RSCG - 241 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
1+
# RSCG - 242 Examples of Roslyn Source Code Generators / 16 created by Microsoft /
22

3-
The RSCG_Examples repository is a comprehensive documentation system that automatically processes and showcases 241 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.
3+
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.
44

55
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
66

7-
## Latest Update : 2025-11-10 => 10 November 2025
7+
## Latest Update : 2025-11-11 => 11 November 2025
88

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

11-
If you want just those from Microsoft, please click ***[Microsoft](https://ignatandrei.github.io/RSCG_Examples/v2/docs/category/microsoft-examples)***
11+
If you want just those from Microsoft, please click ***[Microsoft](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Authors/Microsoft)***
1212

1313
If you want to see by category, please click ***[category](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples)***
1414
or click any category below
15-
[actor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#actor) -[ai](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#ai) -[aop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#aop) -[api](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) -[async](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#async) -[bitwise](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bitwise) -[blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) -[builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) -[clone](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#clone) -[codetostring](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#codetostring) -[commandline](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) -[console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) -[constructor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#constructor) -[database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) -[decorator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#decorator) -[dependencyinjection](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#dependencyinjection) -[disposer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#disposer) -[enhancementclass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) -[enhancementproject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) -[enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) -[equals](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#equals) -[filestocode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) -[functionalprogramming](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#functionalprogramming) -[hangfire](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#hangfire) -[interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) -[linq](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#linq) -[mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) -[mediator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mediator) -[mixin](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mixin) -[mvc](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvc) -[mvvm](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvvm) -[optimizer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#optimizer) -[primitiveobsession](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#primitiveobsession) -[rx](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#rx) -[serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) -[signalr](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#signalr) -[statemachine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#statemachine) -[templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) -[tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) -[validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) -[winapi](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) -
15+
[actor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#actor) -[ai](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#ai) -[aop](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#aop) -[api](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#api) -[async](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#async) -[bitwise](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#bitwise) -[blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) -[builder](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#builder) -[clone](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#clone) -[codetostring](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#codetostring) -[commandline](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#commandline) -[console](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#console) -[constructor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#constructor) -[database](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#database) -[decorator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#decorator) -[dependencyinjection](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#dependencyinjection) -[disposer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#disposer) -[enhancementclass](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementclass) -[enhancementproject](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enhancementproject) -[enum](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#enum) -[equals](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#equals) -[filestocode](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#filestocode) -[functionalprogramming](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#functionalprogramming) -[hangfire](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#hangfire) -[interface](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#interface) -[linq](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#linq) -[mapper](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mapper) -[mcp](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mcp) -[mediator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mediator) -[mixin](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mixin) -[mvc](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvc) -[mvvm](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#mvvm) -[optimizer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#optimizer) -[primitiveobsession](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#primitiveobsession) -[rx](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#rx) -[serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) -[signalr](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#signalr) -[statemachine](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#statemachine) -[templating](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#templating) -[tests](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#tests) -[validator](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#validator) -[winapi](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#winapi) -
1616

1717

1818
## If you have a Roslyn Source Code Generator, please create an issue.
@@ -24,8 +24,30 @@ If you want to be notified each time I add a new RSCG example , please click htt
2424

2525
## Content
2626

27-
Those are the 241 Roslyn Source Code Generators that I have tested you can see and download source code example.
27+
Those are the 242 Roslyn Source Code Generators that I have tested you can see and download source code example.
2828
( including 16 from Microsoft )
29+
### 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
30+
31+
Generated on : 2025-11-11 => 11 November 2025
32+
33+
<details>
34+
<summary>Expand</summary>
35+
36+
37+
38+
Author: Ignat Andrei
39+
40+
Generating MCP tool function that exports to file the result of another MCP tool.
41+
42+
Nuget: [https://www.nuget.org/packages/RSCG_MCP2File/](https://www.nuget.org/packages/RSCG_MCP2File/)
43+
44+
45+
Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2File](https://ignatandrei.github.io/RSCG_Examples/v2/docs/RSCG_MCP2File)
46+
47+
Source: [https://github.com/ignatandrei/RSCG_OpenApi2MCP](https://github.com/ignatandrei/RSCG_OpenApi2MCP)
48+
49+
</details>
50+
2951
### 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
3052

3153
Generated on : 2025-11-10 => 10 November 2025
@@ -1148,7 +1170,7 @@ Generated on : 2025-03-26 => 26 March 2025
11481170

11491171

11501172

1151-
Author: Andrei Ignat
1173+
Author: Ignat Andrei
11521174

11531175
Interface to null object - common
11541176

@@ -1346,7 +1368,7 @@ Generated on : 2025-01-18 => 18 January 2025
13461368

13471369

13481370

1349-
Author: Andrei Ignat
1371+
Author: Ignat Andrei
13501372

13511373
Interface to null object - common
13521374

@@ -1720,7 +1742,7 @@ Generated on : 2024-11-02 => 02 November 2024
17201742

17211743

17221744

1723-
Author: Andrei Ignat
1745+
Author: Ignat Andrei
17241746

17251747
Intercept method
17261748

@@ -1918,7 +1940,7 @@ Generated on : 2024-08-25 => 25 August 2024
19181940

19191941

19201942

1921-
Author: Andrei Ignat
1943+
Author: Ignat Andrei
19221944

19231945
Generates uniqe names for release
19241946

@@ -2203,7 +2225,7 @@ Generated on : 2024-06-29 => 29 June 2024
22032225

22042226

22052227

2206-
Author: Andrei Ignat
2228+
Author: Ignat Andrei
22072229

22082230
Implement IFormattable for a class
22092231

@@ -2738,7 +2760,7 @@ Generated on : 2024-02-29 => 29 February 2024
27382760

27392761

27402762

2741-
Author: Andrei Ignat
2763+
Author: Ignat Andrei
27422764

27432765
This package transforms any json into a class
27442766

@@ -2826,7 +2848,7 @@ Generated on : 2024-02-21 => 21 February 2024
28262848

28272849

28282850

2829-
Author: Andrei Ignat
2851+
Author: Ignat Andrei
28302852

28312853
This package wait for a time and put all global options into a cs file
28322854

@@ -3404,7 +3426,7 @@ Generated on : 2023-12-22 => 22 December 2023
34043426

34053427

34063428

3407-
Author: Andrei Ignat
3429+
Author: Ignat Andrei
34083430

34093431
Roslyn Utility Types - Pick, Omit
34103432

@@ -3470,7 +3492,7 @@ Generated on : 2023-11-29 => 29 November 2023
34703492

34713493

34723494

3473-
Author: Andrei Ignat
3495+
Author: Ignat Andrei
34743496

34753497
Package Description
34763498

@@ -3921,7 +3943,7 @@ Generated on : 2023-10-07 => 07 October 2023
39213943

39223944

39233945

3924-
Author: Andrei Ignat
3946+
Author: Ignat Andrei
39253947

39263948
Roslyn Templating for all
39273949

@@ -4075,7 +4097,7 @@ Generated on : 2023-09-30 => 30 September 2023
40754097

40764098

40774099

4078-
Author: Andrei Ignat
4100+
Author: Ignat Andrei
40794101

40804102
Roslyn Decorator for a class- intercept methods
40814103

@@ -4277,7 +4299,7 @@ Generated on : 2023-08-23 => 23 August 2023
42774299

42784300

42794301

4280-
Author: Andrei Ignat
4302+
Author: Ignat Andrei
42814303

42824304
Add Excel export to your WebAPI
42834305

@@ -4981,7 +5003,7 @@ Generated on : 2023-04-16 => 16 April 2023
49815003

49825004

49835005

4984-
Author: Andrei Ignat
5006+
Author: Ignat Andrei
49855007

49865008
Generate correct functions from [FromServices]
49875009

@@ -5321,7 +5343,7 @@ Generated on : 2023-04-16 => 16 April 2023
53215343

53225344

53235345

5324-
Author: Andrei Ignat
5346+
Author: Ignat Andrei
53255347

53265348
This package make you an interface and record from static properties / methods
53275349

@@ -5461,7 +5483,7 @@ Generated on : 2023-04-16 => 16 April 2023
54615483

54625484

54635485

5464-
Author: Andrei Ignat
5486+
Author: Ignat Andrei
54655487

54665488
This package make a time bomb from comment.
54675489

later.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Just later
22

3-
## Latest Update : 2025-11-10 => 10 November 2025
3+
## Latest Update : 2025-11-11 => 11 November 2025
44

55

66

v2/.tours/RSCG_MCP2File.tour

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
2+
{
3+
"$schema": "https://aka.ms/codetour-schema",
4+
"title": "RSCG_MCP2File",
5+
"steps":
6+
[
7+
{
8+
"file": "rscg_examples/RSCG_MCP2File/src/MCPDemo/MCPDemo/MCPDemo.csproj",
9+
"description": "First, we add Nuget [RSCG_MCP2File](https://www.nuget.org/packages/RSCG_MCP2File/) in csproj ",
10+
"pattern": "RSCG_MCP2File"
11+
}
12+
13+
,{
14+
"file": "rscg_examples/RSCG_MCP2File/src/MCPDemo/MCPDemo/MyTools.cs",
15+
"description": "File MyTools.cs ",
16+
"pattern": "this is the code"
17+
}
18+
19+
,{
20+
"file": "rscg_examples/RSCG_MCP2File/src/MCPDemo/MCPDemo/Program.cs",
21+
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/RSCG_MCP2File/src/MCPDemo/MCPDemo/MCPDemo.csproj ",
22+
"pattern": "this is the code"
23+
}
24+
25+
26+
,{
27+
"file": "rscg_examples/RSCG_MCP2File/src/MCPDemo/MCPDemo/obj/GX/RSCG_MCP2File/RSCG_MCP2File.MCP2File/MyTools_ExportToFile.g.cs",
28+
"description": "Generated File 3 from 3 : MyTools_ExportToFile.g.cs ",
29+
"line": 1
30+
}
31+
32+
,{
33+
"file": "rscg_examples/RSCG_MCP2File/src/MCPDemo/MCPDemo/obj/GX/RSCG_MCP2File/RSCG_MCP2File.MCP2File/Microsoft.CodeAnalysis.EmbeddedAttribute.cs",
34+
"description": "Generated File 2 from 3 : Microsoft.CodeAnalysis.EmbeddedAttribute.cs ",
35+
"line": 1
36+
}
37+
38+
,{
39+
"file": "rscg_examples/RSCG_MCP2File/src/MCPDemo/MCPDemo/obj/GX/RSCG_MCP2File/RSCG_MCP2File.MCP2File/MCPExportToFile.g.cs",
40+
"description": "Generated File 1 from 3 : MCPExportToFile.g.cs ",
41+
"line": 1
42+
}
43+
44+
],
45+
46+
"ref": "main"
47+
48+
}

v2/Generator/MultiGeneratorV2.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -696,8 +696,17 @@ await Task.WhenAll(_AllDescriptions
696696
if(!Directory.Exists(folder))
697697
Directory.CreateDirectory(folder);
698698
var nameFile = author.Key.Replace(" ","_").Replace(".","_").Replace(",","_");
699+
nameFile= nameFile.Replace("\\","_").Replace(":","_").Replace("/","_");
699700
var pathAuthor = Path.Combine(folder, nameFile + ".md");
700-
await File.WriteAllTextAsync(pathAuthor, content);
701+
try
702+
{
703+
await File.WriteAllTextAsync(pathAuthor, content);
704+
}
705+
catch(Exception ex)
706+
{
707+
Console.WriteLine($"cannot write author page for {author.Key} in {pathAuthor} because {ex.Message}");
708+
throw;
709+
}
701710
}
702711

703712
return true;

v2/Generator/all.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,4 @@ Nr,Key,Source,Category
240240
239,TUnit, https://github.com/thomhurst/TUnit,Tests
241241
240,XmlCommentGenerator, https://github.com/dotnet/dotnet/,API
242242
241,DecoratorGenerator, https://github.com/CodingFlow/decorator-generator,Decorator
243+
242,RSCG_MCP2File, https://github.com/ignatandrei/RSCG_OpenApi2MCP,MCP

v2/GeneratorData/Category.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public enum Category
4343
RX=38,
4444
Mixin=39,
4545
Validator=40,
46-
Decorator= 41
46+
Decorator= 41,
47+
MCP= 42
4748
}
4849

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,5 +1459,11 @@
14591459
"Category":41,
14601460
"dtStart": "2025-11-10T00:00:00",
14611461
"show": true
1462+
},
1463+
{
1464+
"ID":"RSCG_MCP2File",
1465+
"Category": 42,
1466+
"dtStart": "2025-11-11T00:00:00",
1467+
"show": true
14621468
}
14631469
]

v2/book/examples/InterceptorTemplate.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h2>Info</h2>
66

77
<p>You can find more details at : <a href="https://github.com/ignatandrei/RSCG_InterceptorTemplate" target="_blank"> https://github.com/ignatandrei/RSCG_InterceptorTemplate</a></p>
88

9-
<p>Author :Andrei Ignat</p>
9+
<p>Author :Ignat Andrei</p>
1010

1111
<p>Source: <a href="https://github.com/ignatandrei/RSCG_InterceptorTemplate" target="_blank">https://github.com/ignatandrei/RSCG_InterceptorTemplate</a> </p>
1212

v2/book/examples/RSCG_Decorator.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h2>Info</h2>
66

77
<p>You can find more details at : <a href="https://github.com/ignatandrei/RSCG_Decorator" target="_blank"> https://github.com/ignatandrei/RSCG_Decorator</a></p>
88

9-
<p>Author :Andrei Ignat</p>
9+
<p>Author :Ignat Andrei</p>
1010

1111
<p>Source: <a href="https://github.com/ignatandrei/RSCG_Decorator" target="_blank">https://github.com/ignatandrei/RSCG_Decorator</a> </p>
1212

v2/book/examples/RSCG_FunctionsWithDI.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h2>Info</h2>
66

77
<p>You can find more details at : <a href="https://github.com/ignatandrei/functionsdi" target="_blank"> https://github.com/ignatandrei/functionsdi</a></p>
88

9-
<p>Author :Andrei Ignat</p>
9+
<p>Author :Ignat Andrei</p>
1010

1111
<p>Source: <a href="https://github.com/ignatandrei/functionsdi" target="_blank">https://github.com/ignatandrei/functionsdi</a> </p>
1212

0 commit comments

Comments
 (0)