|
1 | | -using ModelContextProtocol; |
2 | | -using ModelContextProtocol.Client; |
3 | | -using ModelContextProtocol.Protocol; |
4 | | -using ModelContextProtocol.Protocol.Types; |
5 | | -using ModelContextProtocol.Protocol.Transport; |
| 1 | +using ModelContextProtocol.Client; |
6 | 2 | using ModelContextProtocol.Configuration; |
| 3 | +using ModelContextProtocol.Protocol.Transport; |
7 | 4 | using NetContextClient.Models; |
8 | 5 | using System.CommandLine; |
9 | 6 | using System.Text.Json; |
10 | 7 |
|
| 8 | +/// <summary> |
| 9 | +/// Command-line interface for the .NET Context Client, which interacts with the MCP server |
| 10 | +/// to provide codebase analysis and management capabilities. |
| 11 | +/// |
| 12 | +/// Built using the official C# SDK for MCP (https://github.com/modelcontextprotocol/csharp-sdk), |
| 13 | +/// this client provides commands for: |
| 14 | +/// - File system operations and project discovery |
| 15 | +/// - Code search (both text-based and semantic) |
| 16 | +/// - Package analysis |
| 17 | +/// - Ignore pattern management |
| 18 | +/// </summary> |
11 | 19 | class Program |
12 | 20 | { |
| 21 | + /// <summary> |
| 22 | + /// Entry point for the command-line interface. Sets up the MCP client and defines |
| 23 | + /// the command structure using System.CommandLine. |
| 24 | + /// </summary> |
| 25 | + /// <param name="args">Command-line arguments passed to the program.</param> |
| 26 | + /// <returns> |
| 27 | + /// 0 for successful execution, non-zero for errors: |
| 28 | + /// - 1: General execution error |
| 29 | + /// - Other codes as defined by System.CommandLine |
| 30 | + /// </returns> |
| 31 | + /// <remarks> |
| 32 | + /// Available commands: |
| 33 | + /// - hello: Basic connectivity test |
| 34 | + /// - set-base-dir: Set working directory |
| 35 | + /// - get-base-dir: Show current working directory |
| 36 | + /// - list-projects: Show all .NET projects |
| 37 | + /// - list-files: List files in a project |
| 38 | + /// - open-file: View file contents |
| 39 | + /// - search-code: Text-based code search |
| 40 | + /// - semantic-search: AI-powered code search |
| 41 | + /// - analyze-packages: Analyze NuGet packages |
| 42 | + /// - Ignore pattern management commands: |
| 43 | + /// * add-ignore-patterns |
| 44 | + /// * remove-ignore-patterns |
| 45 | + /// * get-ignore-patterns |
| 46 | + /// * clear-ignore-patterns |
| 47 | + /// * get-state-file-location |
| 48 | + /// </remarks> |
13 | 49 | static async Task<int> Main(string[] args) |
14 | 50 | { |
15 | 51 | // Define client and server configuration |
|
0 commit comments