# CodexMcpClient Sample Sample console application demonstrating Svrnty.MCP.Client usage with CODEX MCP Server. ## Purpose Shows how to: - Connect to an MCP server (CODEX knowledge base) - Discover available tools - Call tools with arguments - Handle responses and errors ## Prerequisites - .NET 8.0 SDK - Running CODEX MCP Server (from Svrnty.MCP.Server module) ## Configuration Edit `appsettings.json` to point to your CODEX MCP Server: ```json { "Mcp": { "Servers": [ { "Name": "codex-server", "Transport": { "Type": "Stdio", "Command": "dotnet", "Args": ["run", "--project", "/path/to/CodexMcpServer/CodexMcpServer.csproj"] } } ] } } ``` ## Usage ```bash # List available tools from CODEX server dotnet run -- list-tools # Search CODEX knowledge base dotnet run -- search "architecture patterns" # Get a specific document dotnet run -- get-document # List all documents dotnet run -- list-documents # Filter by tag dotnet run -- search-by-tag "design-pattern" ``` ## Example Output ``` $ dotnet run -- search "clean architecture" Searching CODEX for: clean architecture Found 5 results: 1. Clean Architecture Guide (ID: abc-123) - Layers: Core, Infrastructure, API - Score: 0.95 2. Dependency Rules (ID: def-456) - Clean Architecture principles - Score: 0.87 ... ``` ## Files - `Program.cs` - Main CLI entry point - `Services/CodexSearchService.cs` - Search functionality - `Services/DocumentService.cs` - Document retrieval - `appsettings.json` - MCP client configuration