Built Word Documents (.docx):
Spensara Overview (.docx)
Capability Assessment (.docx)
Brink POS Ingestion Analysis (.docx)
The Borg Ingestion Architecture (.docx)
Categories
Implementation Specs (157)
Detailed engineering and feature implementation specifications.
- specs/AnomalyDetection/TASK1.1.md
- specs/AnomalyDetection/TASK1.2.md
- specs/AnomalyDetection/TASK1.3.md
- specs/AnomalyDetection/TASK1.4.md
- specs/AnomalyDetection/TASK2.1.md
- specs/AnomalyDetection/TASK2.2.md
- specs/AnomalyDetection/TASK3.1.md
- specs/AnomalyDetection/TASK3.2.md
- specs/AnomalyDetection/TASK3.3.md
- specs/AnomalyDetection/TASK4.1.md
- specs/AnomalyDetection/TASK4.2.md
- specs/AnomalyDetection/TASK4.3.md
- specs/AnomalyDetection/TASK4.4.md
- specs/AnomalyDetection/TASK5.1.md
- specs/AnomalyDetection/TASK5.2.md
- specs/AnomalyDetection/TASK5.3.md
- specs/AnomalyDetection/TASK6.1.md
- specs/AnomalyDetection/TASK6.2.md
- specs/AnomalyDetection/TASK6.3.md
- specs/AnomalyDetection/TASKS.md
- specs/ApiServicePostgresTestStability/TASK.md
- specs/BackendDatabaseConsolidation/TASK.md
- specs/BackendDatabaseConsolidation/TASK1.1.md
- specs/BackendDatabaseConsolidation/TASK1.2.md
- specs/BackendDatabaseConsolidation/TASK1.3.md
- specs/BackendDatabaseConsolidation/TASK2.1.md
- specs/BackendDatabaseConsolidation/TASK2.2.md
- specs/BackendDatabaseConsolidation/TASK2.3.md
- specs/BackendDatabaseConsolidation/TASK3.1.md
- specs/BackendDatabaseConsolidation/TASK3.2.md
- specs/BackendDatabaseConsolidation/TASK4.1.md
- specs/BackendDatabaseConsolidation/TASK4.2.md
- specs/BackendDatabaseConsolidation/TASK4.3.md
- specs/BackendDatabaseConsolidation/TASK5.1.md
- specs/BackendDatabaseConsolidation/TASK5.2.md
- specs/BrinkLaborGetShiftsStaging/TASK.md
- specs/BrinkPosOrdersFirstEtlJob/TASK.md
- specs/BrinkPosOrdersFirstEtlJob/TASK0.md
- specs/BrinkPosOrdersFirstEtlJob/TASK1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK5.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.1.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.2.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.3.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.4.md
- specs/BrinkPosOrdersFirstEtlJob/TASK6.md
- specs/BrinkPosOrdersFirstEtlJob/TASK7.md
- specs/BrinkPosOrdersFirstEtlJob/TASK8.md
- specs/BrinkPosOrdersFirstEtlJob/TASK9.md
- specs/BrinkSettings2ToStaging/TASK.MD
- specs/CuratedToS3Stage/TASK.md
- specs/CuratedToS3Stage/TASK0.md
- specs/CuratedToS3Stage/TASK1.md
- specs/CuratedToS3Stage/TASK2.md
- specs/CuratedToS3Stage/TASK3.md
- specs/CuratedToS3Stage/TASK4.md
- specs/CustomerCredentialCustomHeaders/TASK.md
- specs/CustomerCredentialCustomHeaders/TASK1.1.md
- specs/CustomerCredentialCustomHeaders/TASK1.2.md
- specs/CustomerCredentialCustomHeaders/TASK2.1.md
- specs/CustomerCredentialCustomHeaders/TASK2.2.md
- specs/CustomerCredentialCustomHeaders/TASK3.1.md
- specs/CustomerCredentialTriggeredProvisioning/TASK.md
- specs/CustomerCredentialTriggeredProvisioning/TASK1.1.md
- specs/CustomerCredentialTriggeredProvisioning/TASK1.2.md
- specs/CustomerCredentialTriggeredProvisioning/TASK2.1.md
- specs/CustomerCredentialTriggeredProvisioning/TASK2.2.md
- specs/CustomerCredentialTriggeredProvisioning/TASK3.1.md
- specs/CustomerCredentialTriggeredProvisioning/TASK3.2.md
- specs/CustomerCredentialTriggeredProvisioning/TASK4.1.md
- specs/EtlSourceAdapterFramework/TASK.md
- specs/EtlSourceAdapterFramework/TASK0.md
- specs/EtlSourceAdapterFramework/TASK1.md
- specs/EtlSourceAdapterFramework/TASK2.md
- specs/EtlSourceAdapterFramework/TASK3.md
- specs/EtlSourceAdapterFramework/TASK4.md
- specs/EtlSourceAdapterFramework/TASK5.md
- specs/EtlSourceAdapterFramework/TASK6.md
- specs/KdsCdcDebeziumIntegration/TASK.md
- specs/KdsCdcDebeziumIntegration/TASK1.md
- specs/KdsCdcDebeziumIntegration/TASK2.md
- specs/KdsCdcDebeziumIntegration/TASK3.md
- specs/KdsCdcDebeziumIntegration/TASK4.md
- specs/KdsCdcDebeziumIntegration/TASK5.md
- specs/KdsCdcDurableRelationRouting/TASK.md
- specs/KdsCdcDurableRelationRouting/TASK1.md
- specs/KdsCdcDurableRelationRouting/TASK2.md
- specs/KdsCdcDurableRelationRouting/TASK3.md
- specs/KdsCdcDurableRelationRouting/TASK4.md
- specs/KdsCdcDurableRelationRouting/TASK5.md
- specs/KdsCdcIngestion/TASK.md
- specs/KdsCdcIngestion/TASK1.md
- specs/KdsCdcIngestion/TASK2.md
- specs/KdsCdcIngestion/TASK3.md
- specs/KdsCdcIngestion/TASK4.md
- specs/KdsCdcIngestion/TASK5.md
- specs/KdsCdcIngestion/TASK6.md
- specs/KdsCdcIngestion/TASK7.md
- specs/KdsCdcIngestion/TASK8.md
- specs/KdsCdcIngestion/TASK9.md
- specs/KdsCdcReplayExecution/TASK.md
- specs/KdsCdcReplayExecution/TASK1.md
- specs/KdsCdcReplayExecution/TASK2.md
- specs/KdsCdcReplayExecution/TASK3.md
- specs/KdsCdcReplayExecution/TASK4.md
- specs/KdsMonitorServingContractMigration/TASK.md
- specs/KdsMonitorServingContractMigration/TASK1.1.md
- specs/KdsMonitorServingContractMigration/TASK1.2.md
- specs/KdsMonitorServingContractMigration/TASK2.1.md
- specs/KdsMonitorServingContractMigration/TASK2.2.md
- specs/KdsMonitorServingContractMigration/TASK3.1.md
- specs/KdsMonitorServingContractMigration/TASK3.2.md
- specs/RedshiftFoundation/TASK.md
- specs/RedshiftFoundation/TASK1.1.md
- specs/RedshiftFoundation/TASK1.2.md
- specs/RedshiftFoundation/TASK1.3.md
- specs/RedshiftFoundation/TASK1.4.md
- specs/RedshiftFoundation/TASK2.1.md
- specs/RedshiftFoundation/TASK2.2.md
- specs/RedshiftFoundation/TASK3.1.md
- specs/RedshiftFoundation/TASK3.2.md
- specs/RedshiftFoundation/TASK3.3.md
- specs/RedshiftSyntheticDataFeed/TASK.md
- specs/RedshiftSyntheticDataFeed/TASK1.1.md
- specs/RedshiftSyntheticDataFeed/TASK1.2.md
- specs/RedshiftSyntheticDataFeed/TASK1.3.md
- specs/RedshiftSyntheticDataFeed/TASK2.1.md
- specs/RedshiftSyntheticDataFeed/TASK2.2.md
- specs/RedshiftSyntheticDataFeed/TASK3.1.md
- specs/RedshiftSyntheticDataFeed/TASK3.2.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK1.1.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK1.2.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK2.1.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK2.2.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK2.3.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK3.1.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK3.2.md
- specs/SingleStoreRedshiftRuntimeReadPath/TASK4.1.md
TASK 1.4: Configure MCP Client for MySQL Data Access
Summary
Set up the Model Context Protocol (MCP) client using the official MCP C# SDK to connect to the benborla/mcp-server-mysql server. The MCP tools will be retrieved and passed directly to the agent as AITool objects, following the Microsoft Agent Framework integration pattern.
Dependencies
- None (can be done in parallel with TASK 1.1-1.3)
Architecture
The Microsoft Agent Framework integrates with MCP via the official MCP C# SDK. The pattern is:
- Create an
McpClientviaMcpClientFactory.CreateAsync()with aStdioClientTransport - Call
mcpClient.ListToolsAsync()to get available tools - Cast tools to
AITooland pass them to the agent
No custom IMcpClient wrapper is needed - the SDK provides everything.
Files to Modify
1. backend/Directory.Packages.props
Add the MCP C# SDK package:
xml
<PackageVersion Include="ModelContextProtocol" Version="0.2.0-preview.1" />Note: Check for the latest version at https://www.nuget.org/packages/ModelContextProtocol
2. backend/Kds.Ai.AnomalyDetector/Kds.Ai.AnomalyDetector.csproj
Add package reference:
xml
<ItemGroup>
<PackageReference Include="ModelContextProtocol" />
</ItemGroup>Files to Create
3. backend/Kds.Ai.AnomalyDetector/Settings/McpMySqlSettings.cs
csharp
using System.ComponentModel.DataAnnotations;
namespace Kds.Ai.AnomalyDetector.Settings;
public sealed class McpMySqlSettings
{
/// <summary>
/// Command to run the MCP server (e.g., "npx")
/// </summary>
[Required]
public required string Command { get; init; }
/// <summary>
/// Arguments for the MCP server command (e.g., ["-y", "benborla-mcp-server-mysql"])
/// </summary>
[Required]
public required string[] Arguments { get; init; }
/// <summary>
/// Environment variables to pass to the MCP server process
/// (MySQL connection details: MYSQL_HOST, MYSQL_PORT, MYSQL_USER, MYSQL_PASS, MYSQL_DB)
/// </summary>
public Dictionary<string, string> EnvironmentVariables { get; init; } = new();
}4. backend/Kds.Ai.AnomalyDetector/Mcp/McpToolProvider.cs
Factory that creates an MCP client and retrieves tools:
csharp
using Kds.Ai.AnomalyDetector.Settings;
using Microsoft.Extensions.AI;
using ModelContextProtocol.Client;
namespace Kds.Ai.AnomalyDetector.Mcp;
/// <summary>
/// Manages the MCP client lifecycle and provides tools from the MySQL MCP server.
/// </summary>
public sealed class McpToolProvider(McpMySqlSettings settings) : IAsyncDisposable
{
private McpClient? _client;
/// <summary>
/// Creates the MCP client and connects to the MySQL MCP server.
/// </summary>
public async Task<McpClient> GetClientAsync(CancellationToken ct = default)
{
if (_client is not null)
{
return _client;
}
var transport = new StdioClientTransport(new StdioClientTransportOptions
{
Name = "mysql-mcp-server",
Command = settings.Command,
Arguments = settings.Arguments,
EnvironmentVariables = settings.EnvironmentVariables
});
_client = await McpClient.CreateAsync(transport, cancellationToken: ct);
return _client;
}
/// <summary>
/// Retrieves available tools from the MCP server as AITool objects
/// that can be passed directly to an agent.
/// </summary>
public async Task<IList<AITool>> GetToolsAsync(CancellationToken ct = default)
{
var client = await GetClientAsync(ct);
var tools = await client.ListToolsAsync(cancellationToken: ct);
return [.. tools.Cast<AITool>()];
}
public async ValueTask DisposeAsync()
{
if (_client is not null)
{
await _client.DisposeAsync();
_client = null;
}
}
}Note: In TASK 6.1,McpToolProviderwill be refactored tointernal sealedand anIMcpToolProviderinterface will be extracted for testability.
5. backend/Kds.Ai.AnomalyDetector/DependencyInjectionExtensions.cs
csharp
using Kds.Ai.AnomalyDetector.Mcp;
using Kds.Ai.AnomalyDetector.Settings;
using Kds.Ai.Core;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
namespace Kds.Ai.AnomalyDetector;
public static class DependencyInjectionExtensions
{
public static IHostApplicationBuilder AddAnomalyDetectorModule(this IHostApplicationBuilder builder)
{
builder.AddOptions<McpMySqlSettings>();
builder.Services.AddSingleton<McpToolProvider>(provider =>
{
var settings = provider.GetRequiredService<IOptions<McpMySqlSettings>>();
return new McpToolProvider(settings.Value);
});
return builder;
}
}Note: In TASK 6.1, this registration will change to AddSingleton<IMcpToolProvider, McpToolProvider> when the interface is extracted.
Configuration Example
In appsettings.json or environment configuration:
json
{
"McpMySqlSettings": {
"Command": "npx",
"Arguments": ["-y", "benborla-mcp-server-mysql"],
"EnvironmentVariables": {
"MYSQL_HOST": "localhost",
"MYSQL_PORT": "3306",
"MYSQL_USER": "root",
"MYSQL_PASS": "password",
"MYSQL_DB": "kdsdev"
}
}
}Usage Pattern (Preview)
When building the agent (in later tasks), the MCP tools will be passed directly:
csharp
var mcpToolProvider = serviceProvider.GetRequiredService<McpToolProvider>();
var mcpTools = await mcpToolProvider.GetToolsAsync(ct);
// Pass MCP tools to the agent - the agent can call mysql_query via function calling
AIAgent agent = chatClient.AsAIAgent(
instructions: systemPrompt,
tools: [.. mcpTools]);Acceptance Criteria
- [ ]
ModelContextProtocolpackage added toDirectory.Packages.props - [ ] Package reference added to
Kds.Ai.AnomalyDetector.csproj - [ ]
McpMySqlSettingssettings class created - [ ]
McpToolProvidercreated using official MCP C# SDK patterns - [ ] DI extensions created with provider registration
- [ ] Solution builds without errors
Notes
- The
benborla/mcp-server-mysqlserver exposes amysql_querytool that accepts SQL queries - MCP tools are automatically converted to
AIToolobjects compatible with Microsoft Agent Framework - The MCP client connects via stdio transport (launches server as subprocess)
McpToolProvidermanages the client lifecycle and should be disposed properly- No custom MCP client wrapper is needed - use the official SDK directly