Research conducted on modern AI coding assistants (Cursor, GitHub Copilot, Cline,
Aider, Windsurf, Replit Agent) to understand architecture patterns, context management,
code editing workflows, and tool use protocols.
Key Decision: Pivoted from building full CLI (40-50h) to validation-driven MCP-first
approach (10-15h). Build 5 core CODEX MCP tools that work with ANY coding assistant,
validate adoption over 2-4 weeks, then decide on full CLI if demand proven.
Files:
- research/ai-systems/modern-coding-assistants-architecture.md (comprehensive research)
- research/ai-systems/codex-coding-assistant-implementation-plan.md (original CLI plan, preserved)
- research/ai-systems/codex-mcp-tools-implementation-plan.md (approved MCP-first plan)
- ideas/registry.json (updated with approved MCP tools proposal)
Architech Validation: APPROVED with pivot to MCP-first approach
Human Decision: Approved (pragmatic validation-driven development)
Next: Begin Phase 1 implementation (10-15 hours, 5 core MCP tools)
🤖 Generated with CODEX Research System
Co-Authored-By: The Archivist <archivist@codex.svrnty.io>
Co-Authored-By: The Architech <architech@codex.svrnty.io>
Co-Authored-By: Mathias Beaulieu-Duncan <mat@svrnty.io>
148 lines
3.5 KiB
C#
148 lines
3.5 KiB
C#
using OpenHarbor.MCP.Client.Core.Models;
|
|
using Xunit;
|
|
|
|
namespace OpenHarbor.MCP.Client.Core.Tests.Models;
|
|
|
|
/// <summary>
|
|
/// Unit tests for McpServerConfig and transport configurations.
|
|
/// Tests configuration creation and default values.
|
|
/// </summary>
|
|
public class McpServerConfigTests
|
|
{
|
|
[Fact]
|
|
public void Constructor_WithStdioTransport_CreatesConfig()
|
|
{
|
|
// Arrange
|
|
var transport = new StdioTransportConfig
|
|
{
|
|
Type = "Stdio",
|
|
Command = "dotnet",
|
|
Args = new[] { "run", "--project", "test.csproj" }
|
|
};
|
|
|
|
// Act
|
|
var config = new McpServerConfig
|
|
{
|
|
Name = "test-server",
|
|
Transport = transport
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("test-server", config.Name);
|
|
Assert.IsType<StdioTransportConfig>(config.Transport);
|
|
Assert.Equal(TimeSpan.FromSeconds(30), config.Timeout);
|
|
Assert.True(config.Enabled);
|
|
}
|
|
|
|
[Fact]
|
|
public void Constructor_WithHttpTransport_CreatesConfig()
|
|
{
|
|
// Arrange
|
|
var transport = new HttpTransportConfig
|
|
{
|
|
Type = "Http",
|
|
BaseUrl = "https://api.example.com/mcp"
|
|
};
|
|
|
|
// Act
|
|
var config = new McpServerConfig
|
|
{
|
|
Name = "http-server",
|
|
Transport = transport
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("http-server", config.Name);
|
|
Assert.IsType<HttpTransportConfig>(config.Transport);
|
|
Assert.Equal("https://api.example.com/mcp", ((HttpTransportConfig)config.Transport).BaseUrl);
|
|
}
|
|
|
|
[Fact]
|
|
public void Constructor_WithCustomTimeout_SetsTimeout()
|
|
{
|
|
// Arrange
|
|
var transport = new StdioTransportConfig
|
|
{
|
|
Type = "Stdio",
|
|
Command = "node",
|
|
Args = new[] { "server.js" }
|
|
};
|
|
|
|
// Act
|
|
var config = new McpServerConfig
|
|
{
|
|
Name = "custom-timeout-server",
|
|
Transport = transport,
|
|
Timeout = TimeSpan.FromMinutes(5)
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal(TimeSpan.FromMinutes(5), config.Timeout);
|
|
}
|
|
|
|
[Fact]
|
|
public void Constructor_WithEnabledFalse_SetsEnabledFalse()
|
|
{
|
|
// Arrange
|
|
var transport = new StdioTransportConfig
|
|
{
|
|
Type = "Stdio",
|
|
Command = "test"
|
|
};
|
|
|
|
// Act
|
|
var config = new McpServerConfig
|
|
{
|
|
Name = "disabled-server",
|
|
Transport = transport,
|
|
Enabled = false
|
|
};
|
|
|
|
// Assert
|
|
Assert.False(config.Enabled);
|
|
}
|
|
|
|
[Fact]
|
|
public void StdioTransportConfig_WithEmptyArgs_HasEmptyArray()
|
|
{
|
|
// Arrange & Act
|
|
var transport = new StdioTransportConfig
|
|
{
|
|
Type = "Stdio",
|
|
Command = "test"
|
|
};
|
|
|
|
// Assert
|
|
Assert.Empty(transport.Args);
|
|
}
|
|
|
|
[Fact]
|
|
public void HttpTransportConfig_WithApiKey_StoresApiKey()
|
|
{
|
|
// Arrange & Act
|
|
var transport = new HttpTransportConfig
|
|
{
|
|
Type = "Http",
|
|
BaseUrl = "https://secure.example.com/mcp",
|
|
ApiKey = "test-api-key-123"
|
|
};
|
|
|
|
// Assert
|
|
Assert.Equal("test-api-key-123", transport.ApiKey);
|
|
}
|
|
|
|
[Fact]
|
|
public void HttpTransportConfig_WithoutApiKey_HasNullApiKey()
|
|
{
|
|
// Arrange & Act
|
|
var transport = new HttpTransportConfig
|
|
{
|
|
Type = "Http",
|
|
BaseUrl = "https://public.example.com/mcp"
|
|
};
|
|
|
|
// Assert
|
|
Assert.Null(transport.ApiKey);
|
|
}
|
|
}
|