Skip to content

Commit 1ab4190

Browse files
authored
fixes (#24)
1 parent 2b5f8c9 commit 1ab4190

File tree

11 files changed

+65
-30
lines changed

11 files changed

+65
-30
lines changed

.github/workflows/fasttrack-build.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ jobs:
3737
- name: Build FastTrack.Common
3838
run: dotnet build src/Common/Common.csproj --configuration Release --no-restore
3939

40-
- name: Clean artifacts folder
41-
run: rm -rf ./artifacts
40+
- name: Clean packages folder
41+
run: rm -rf ./packages
4242
shell: bash
4343

4444
- name: Pack FastTrack.Common NuGet package
45-
run: dotnet pack src/Common/Common.csproj --configuration Release --no-build --output ./artifacts
45+
run: dotnet pack src/Common/Common.csproj --configuration Release --no-build --output ./packages
4646

4747
- name: Check if FastTrack.Common package was created
4848
id: check_common_nupkg
4949
run: |
50-
if ls ./artifacts/FastTrack.Common*.nupkg 1> /dev/null 2>&1; then
50+
if ls ./packages/FastTrack.Common*.nupkg 1> /dev/null 2>&1; then
5151
echo "FastTrack.Common NuGet package found."
5252
echo "found=true" >> $GITHUB_OUTPUT
5353
else
@@ -66,10 +66,10 @@ jobs:
6666

6767
- name: Pack FastTrack NuGet package
6868
if: steps.check_common_nupkg.outputs.found == 'true'
69-
run: dotnet pack src/FastTrack/FastTrack.csproj --configuration Release --no-build --output ./artifacts
69+
run: dotnet pack src/FastTrack/FastTrack.csproj --configuration Release --no-build --output ./packages
7070

7171
- name: Upload package artifact
7272
uses: actions/upload-artifact@v4.6.2
7373
with:
7474
name: FastTrack-nuget-package
75-
path: ./artifacts/*.nupkg
75+
path: ./packages/*.nupkg

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ Thumbs.db
3434
**/packages/*
3535
!**/packages/build/
3636
!**/packages/repositories.config
37-
NuGet.Config
3837

3938
# NPM Packages
4039
node_modules/

NuGet.config

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="LocalPackages" value="./packages" />
5+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
</configuration>

Readme.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,27 @@ flowchart TD
2222
- Generates static tool classes for each class annotated with `[McpServerToolNameAttribute]`.
2323
- Wraps methods annotated with `[McpServerToolTypeDescriptionAttribute]` into static methods, including descriptions.
2424
- Uses Roslyn symbol comparison for attribute detection (no hardcoded attribute names).
25-
- Supports multi-targeting (`net9.0` and `netstandard2.0`) for broad compatibility.
25+
- Supports `netstandard2.0` for broad compatibility.
2626
- Ensures generated code is consistent and reduces boilerplate.
2727

2828
## Usage
2929

30-
### Using FastTrack via NuGet
30+
### Using McpServerToolGenerator.FastTrack NuGet package
3131

3232
1. **Install the NuGet package:**
3333

34-
Add the FastTrack source generator to your project using the .NET CLI:
34+
Add the McpServerToolGenerator.FastTrack source generator to your project using the .NET CLI:
3535

3636
```sh
37-
dotnet add package FastTrack
37+
dotnet add package McpServerToolGenerator.FastTrack
3838
```
3939

4040
Or via the NuGet Package Manager in Visual Studio.
4141

4242
2. **Annotate your MCP server tool classes:**
4343

4444
```csharp
45-
using Common;
45+
using McpServerToolGenerator.FastTrack.Common;
4646

4747
[McpServerToolName("MyClass")]
4848
public class MyClass
@@ -73,15 +73,15 @@ flowchart TD
7373

7474
## Requirements
7575

76-
- .NET 9.0 or .NET Standard 2.0 (both supported via multitargeting)
76+
- .NET Standard 2.0
7777
- Microsoft.CodeAnalysis.CSharp (Roslyn) package
78-
- Reference to the `Common` project for attribute definitions
78+
- McpServerToolGenerator.FastTrack for McpServerTool source generation
79+
- McpServerToolGenerator.FastTrack.Common for attribute definitions
7980

8081
## Project Structure
8182

8283
- `FastTrackGenerator.cs` — The main source generator implementation.
8384
- `Common` project — Contains attributes such as `McpServerToolNameAttribute` and `McpServerToolTypeDescriptionAttribute`.
84-
- Multi-targeted project files for compatibility.
8585

8686
## Contributing
8787

samples/CalculatorConsole/CalculatorConsole.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,8 @@
1414
</ItemGroup>
1515

1616
<ItemGroup>
17-
<PackageReference Include="FastTrack" Version="1.0.0" />
18-
</ItemGroup>
19-
20-
<ItemGroup>
21-
<ProjectReference Include="..\..\src\Common\Common.csproj" />
17+
<PackageReference Include="McpServerToolGenerator.FastTrack" Version="0.1.0" />
18+
<PackageReference Include="McpServerToolGenerator.FastTrack.Common" Version="0.1.0" />
2219
</ItemGroup>
2320

2421
</Project>

samples/CalculatorConsole/CalculatorService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Common;
1+
using McpServerToolGenerator.FastTrack.Common;
22

33
[McpServerToolName("Calculator")]
44
public class CalculatorService

src/Common/Common.csproj

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<TargetFrameworks>netstandard2.0</TargetFrameworks>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
7-
<PackageId>FastTrack.Common</PackageId>
7+
<LangVersion>10.0</LangVersion>
8+
<PackageId>McpServerToolGenerator.FastTrack.Common</PackageId>
89
<Version>0.1.0</Version>
910
<Authors>Yadel Lopez</Authors>
1011
<Company>EBL Software LLC</Company>
@@ -17,8 +18,4 @@
1718
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
1819
</PropertyGroup>
1920

20-
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
21-
<LangVersion>10.0</LangVersion>
22-
</PropertyGroup>
23-
2421
</Project>

src/Common/McpServerToolNameAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Common
1+
namespace McpServerToolGenerator.FastTrack.Common
22
{
33
/// <summary>
44
/// Attribute to annotate a class with a McpServer tool name.

src/Common/McpServerToolTypeDescriptionAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
namespace Common
1+
namespace McpServerToolGenerator.FastTrack.Common
22
{
33
/// <summary>
44
/// Attribute to annotate methods with a descriptive string for Mcp Server tool types.

src/Common/Readme.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# McpServerToolGenerator.FastTrack.Common
2+
3+
This package provides common attributes and utilities for MCP Server Tool generators and consumers.
4+
5+
## Features
6+
- `McpServerToolNameAttribute`: Annotate classes with a tool name for MCP server integration.
7+
- `McpServerToolTypeDescriptionAttribute`: Annotate methods with descriptions for MCP server tools.
8+
9+
## Usage
10+
11+
Add a reference to this package in your MCP server tool or generator project:
12+
13+
```xml
14+
<PackageReference Include="McpServerToolGenerator.FastTrack.Common" Version="0.1.0" />
15+
```
16+
17+
Annotate your classes and methods:
18+
19+
```csharp
20+
using McpServerToolGenerator.FastTrack.Common;
21+
22+
[McpServerToolName("Calculator")]
23+
public class CalculatorService
24+
{
25+
[McpServerToolTypeDescription("Adds two integers together.")]
26+
public int Add(int a, int b) => a + b;
27+
}
28+
```
29+
30+
## License
31+
32+
MIT License

src/FastTrack/FastTrack.csproj

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
<PropertyGroup>
44
<TargetFrameworks>netstandard2.0</TargetFrameworks>
55
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
6-
<PackageId>FastTrack</PackageId>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<LangVersion>10.0</LangVersion>
9+
<PackageId>McpServerToolGenerator.FastTrack</PackageId>
710
<Version>0.1.0</Version>
811
<Authors>Yadel Lopez</Authors>
912
<Company>EBL Software LLC</Company>
@@ -25,7 +28,7 @@
2528
</ItemGroup>
2629

2730
<ItemGroup>
28-
<PackageReference Include="FastTrack.Common" Version="0.1.0" />
31+
<PackageReference Include="McpServerToolGenerator.FastTrack.Common" Version="0.1.0" />
2932
</ItemGroup>
3033

3134
</Project>

0 commit comments

Comments
 (0)