We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/sbroenne/mcp-server-excel'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
ServiceFixture.cs•1.5 KiB
using Sbroenne.ExcelMcp.Service;
using Xunit;
namespace Sbroenne.ExcelMcp.CLI.Tests.Integration;
/// <summary>
/// Fixture that starts an in-process ExcelMCP service for CLI integration tests.
/// Uses the CLI pipe name so CLI commands can connect to it.
/// </summary>
public sealed class ServiceFixture : IAsyncLifetime, IDisposable
{
private ExcelMcpService? _service;
public async Task InitializeAsync()
{
var pipeName = ServiceSecurity.GetCliPipeName();
_service = new ExcelMcpService();
_ = Task.Run(() => _service.RunAsync(pipeName));
// Wait for pipe server to be ready
for (int i = 0; i < 20; i++)
{
await Task.Delay(100);
using var client = new ServiceClient(pipeName, connectTimeout: TimeSpan.FromSeconds(1));
if (await client.PingAsync())
{
return;
}
}
throw new InvalidOperationException("ExcelMCP service did not start within timeout.");
}
public Task DisposeAsync()
{
Dispose();
return Task.CompletedTask;
}
public void Dispose()
{
_service?.RequestShutdown();
_service?.Dispose();
_service = null;
}
}
/// <summary>
/// Collection definition for tests that require the ExcelMCP service.
/// Apply [Collection("Service")] to test classes that call excelcli commands.
/// </summary>
[CollectionDefinition("Service")]
public sealed class ServiceTestGroup : ICollectionFixture<ServiceFixture>;