File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- using Microsoft . Extensions . Hosting ;
1+ /// <summary>
2+ /// Entry point for the .NET Context Server, which implements a Model Context Protocol (MCP) server
3+ /// for providing codebase context to Large Language Models.
4+ ///
5+ /// This server is built using the official C# SDK for MCP (https://github.com/modelcontextprotocol/csharp-sdk)
6+ /// and provides tools for:
7+ /// - File system operations and project discovery
8+ /// - Code search (both text-based and semantic)
9+ /// - Package analysis
10+ /// - Ignore pattern management
11+ /// </summary>
12+ using Microsoft . Extensions . Hosting ;
213using ModelContextProtocol ;
314using System . Reflection ;
415
516// Build and run the MCP server
617var builder = Host . CreateEmptyApplicationBuilder ( settings : null ) ;
718builder . Services
8- . AddMcpServer ( options =>
19+ . AddMcpServer ( options =>
920 {
1021 options . ServerInfo = new ( ) { Name = "NetContextServer" , Version = "1.0" } ;
1122 } )
Original file line number Diff line number Diff line change @@ -11,20 +11,15 @@ namespace NetContextServer.Services;
1111/// Provides functionality for analyzing NuGet package references in .NET projects,
1212/// including version checking, usage analysis, and update recommendations.
1313/// </summary>
14- public class PackageAnalyzerService
14+ /// <remarks>
15+ /// Initializes a new instance of the PackageAnalyzerService class.
16+ /// </remarks>
17+ /// <param name="baseDirectory">The base directory for package analysis. If null, uses the current directory.</param>
18+ public class PackageAnalyzerService ( string ? baseDirectory = null )
1519{
1620 private static readonly SourceRepository NuGetRepository = Repository . Factory . GetCoreV3 ( "https://api.nuget.org/v3/index.json" ) ;
1721 private static readonly SourceCacheContext Cache = new ( ) ;
18- private readonly string _baseDirectory ;
19-
20- /// <summary>
21- /// Initializes a new instance of the PackageAnalyzerService class.
22- /// </summary>
23- /// <param name="baseDirectory">The base directory for package analysis. If null, uses the current directory.</param>
24- public PackageAnalyzerService ( string ? baseDirectory = null )
25- {
26- _baseDirectory = baseDirectory ?? Directory . GetCurrentDirectory ( ) ;
27- }
22+ private readonly string _baseDirectory = baseDirectory ?? Directory . GetCurrentDirectory ( ) ;
2823
2924 /// <summary>
3025 /// Gets all package references from a specified project file.
You can’t perform that action at this time.
0 commit comments