Resource subscribe should be true if handler provided (#676)

Co-authored-by: Stephen Halter <halter73@gmail.com>
Co-authored-by: Mike Kistler <mikekistler@microsoft.com>
This commit is contained in:
Peder Holdgaard Pedersen 2025-12-12 05:41:43 +01:00 • committed by GitHub
commit 9bbae84c9b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -110,21 +110,6 @@ public class ServerConformanceTests : IAsyncLifetime
private void StartConformanceServer()
{
// The ConformanceServer binary is in a parallel directory to the test binary
// Test binary is in: artifacts/bin/ModelContextProtocol.ConformanceTests/Debug/{tfm}/
// ConformanceServer binary is in: artifacts/bin/ModelContextProtocol.ConformanceServer/Debug/{tfm}/
var testBinaryDir = AppContext.BaseDirectory; // e.g., .../net10.0/
var configuration = Path.GetFileName(Path.GetDirectoryName(testBinaryDir.TrimEnd(Path.DirectorySeparatorChar))!);
var targetFramework = Path.GetFileName(testBinaryDir.TrimEnd(Path.DirectorySeparatorChar));
var conformanceServerDir = Path.GetFullPath(
Path.Combine(testBinaryDir, "..", "..", "..", "ModelContextProtocol.ConformanceServer", configuration, targetFramework));
if (!Directory.Exists(conformanceServerDir))
{
throw new DirectoryNotFoundException(
$"ConformanceServer directory not found at: {conformanceServerDir}");
}
// Start the server in a background task
_serverCts = new CancellationTokenSource();
_serverTask = Task.Run(() => ConformanceServer.Program.MainAsync(["--urls", _serverUrl], new XunitLoggerProvider(_output), cancellationToken: _serverCts.Token));