1. Conduid
  2. Developer Tools
  3. McpServerFactory templates
MCP server · Developer Tools

McpServerFactory templates

dotnet new templates for bootstrapping MCP server integration tests using McpServerFactory.

Unclaimed devtools
34Low

Scored 7 months ago · breakdown

About McpServerFactory templates

McpServerFactory templates is an MCP server published by diomonogatari in the Developer Tools category: dotnet new templates for bootstrapping MCP server integration tests using McpServerFactory.

The repository has 1 stars and 0 forks, with the last commit 4 months ago. Recent commit activity is the strongest signal that reported issues will get attention.

Install

From source
git clone https://github.com/diomonogatari/mcp-server-factory

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about McpServerFactory templates

Powered by Claude · Grounded in docs

I know everything about McpServerFactory templates. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

McpServerFactory

NuGet NuGet Downloads CI codecov license .NET 10.0

In-memory integration testing factory for .NET Model Context Protocol (MCP) servers.

McpServerFactory gives .NET MCP servers a testing experience similar in spirit to WebApplicationFactory<T> for ASP.NET Core. It boots an MCP server in-process, connects a real McpClient through in-memory streams, and lets you run realistic integration tests without network ports, Docker, or external services.

Installation

dotnet add package McpServerFactory

Template-based scaffolding

Install the template pack to bootstrap an MCP integration test project:

dotnet new install McpServerFactory.Templates
dotnet new mcp-itest -n MyServer.Tests

The mcp-itest template accepts --McpServerFactoryVersion to override the package version (default 0.1.0).

Quick start

using McpServerFactory.Testing;
using ModelContextProtocol.Server;

[McpServerToolType]
public sealed class EchoTools
{
    [McpServerTool(Name = "echo")]
    public string Echo(string message)
    {
        return message;
    }
}

await using var factory = new McpServerIntegrationFactory(
    configureMcpServer: builder => builder.WithTools<EchoTools>());

await using var client = await factory.CreateClientAsync();

var result = await client.CallToolAsync(
    "echo",
    arguments: new Dictionary<string, object?> { ["message"] = "hello" });

Why use this library

  • In-memory transport using the MCP SDK's public stream APIs.
  • Real MCP protocol flow (tools/list, tools/call) in tests.
  • Easy dependency overrides through configureServices and ConfigureServices.
  • Framework-agnostic library (works with xUnit, NUnit, MSTest, etc.).

Behavioral guarantees

  • CreateClientAsync is thread-safe and idempotent per factory instance.
  • Concurrent calls return the same connected McpClient instance.
  • Startup failures do not leak the temporary host instance.
  • DisposeAsync is safe to call multiple times.
  • CreateClientAsync throws ObjectDisposedException after disposal.

Compatibility and support

  • Target framework: net10.0.
  • MCP SDK dependency: ModelContextProtocol 0.4.0-preview.3.
  • Compatibility promise: each package release is validated against the pinned MCP SDK version.
  • Upgrade policy: MCP SDK bumps are explicit and called out in CHANGELOG.md.

API overview

  • McpServerFactory
    • Backward-compatible factory entry point.
  • McpServerIntegrationFactory
    • Preferred factory type for new code.
    • Starts an in-process server host.
    • Creates a connected McpClient via CreateClientAsync().
    • Exposes Services for DI validation after startup.
  • McpServerFactoryOptions
    • Configure server identity, startup/disposal timeouts, and instructions.
    • Suppress host logging by default and optionally customize logging.
  • McpTestClient
    • Convenience wrapper for common test operations.

Logging in test output

By default, host logging providers are suppressed to keep test output clean. To enable custom logging during tests:

using Microsoft.Extensions.Logging;

var options = new McpServerFactoryOptions
{
    SuppressHostLogging = false,
    ConfigureLogging = logging => logging.SetMinimumLevel(LogLevel.Debug),
};

Release notes

See CHANGELOG.md for release history and upcoming changes.

Samples

Repository layout

  • src/McpServerFactory — reusable factory library.
  • tests/McpServerFactory.Tests — unit/integration-focused library tests.
  • templates/McpServerFactory.Templates — dotnet new template pack.
  • samples/MinimalSmoke — runnable sample console app.
  • docs — architecture notes and usage guidance.

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About McpServerFactory templates

How do I install McpServerFactory templates?

No package has been published for this server, so install it from source: clone the repository and follow its README.

Is McpServerFactory templates safe to use with an AI agent?

Its trust score is 34 out of 100 (low). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is McpServerFactory templates still maintained?

Yes — the last commit was 4 months ago. The repository has 1 stars and 0 forks.