Skip to content

MCP Inspector #622

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
aaronpowell opened this issue Apr 8, 2025 · 4 comments · May be fixed by #625
Open

MCP Inspector #622

aaronpowell opened this issue Apr 8, 2025 · 4 comments · May be fixed by #625
Assignees
Labels
integration A new .NET Aspire integration

Comments

@aaronpowell
Copy link
Member

.NET Aspire issue link

No response

Overview

MCP Inspector is a debugging tool for working with MCP servers, and it'd be a useful one to combine with Aspire for building MCP Servers with Aspire.

Usage example

builder.AddMcpInspector("inspector")
    .WithMcpServer(api);

This assumes you have a MCP Server at api, and that it's running with SSE mode

Additional context

There are a few issues that make it a little clunky:

Help us help you

Yes, I'd like to be assigned to work on this item

@aaronpowell aaronpowell added the integration A new .NET Aspire integration label Apr 8, 2025
@aaronpowell aaronpowell self-assigned this Apr 8, 2025
aaronpowell added a commit that referenced this issue Apr 8, 2025
This is only designed to work with SSE transport type, as it will configure that through Aspire. If you want to use SSE, you can still launch it, but it will require some manual configuration in the inspector UI once started.

Currently it runs the inspector via `npx`, since there's no docker image available.

Fixes #622
@aaronpowell aaronpowell linked a pull request Apr 8, 2025 that will close this issue
10 tasks
@NikiforovAll
Copy link

Alternatively, you can use https://www.nuget.org/packages/Nall.ModelContextProtocol.Inspector.Aspire.Hosting

AppHost:

var builder = DistributedApplication.CreateBuilder(args);

var sse = builder.AddProject<Projects.MCPServerHybrid>("server");
builder.AddMCPInspector("mcp-sse", serverPort: 9000, clientPort: 8080).WithSSE(sse);

builder
    .AddMCPInspector("mcp-stdio")
    .WithStdio<Projects.MCPServerHybrid>();

builder.Build().Run();

Source code: https://github.com/NikiforovAll/mcp-template-dotnet

@aaronpowell
Copy link
Member Author

Nice - want to combine efforts?

@NikiforovAll
Copy link

@aaronpowell

Sure, I'd be happy to contribute!

The idea behind my package is that the MCP Inspector is embedded as an NPM app inside the NuGet package. I'm not sure if that's something you'd want to do since it’s a bit of a "hacky" solution. A more standard approach would probably be to use containers instead.

That said, containers come with their own set of challenges, so I decided to explore a different approach.

@aaronpowell
Copy link
Member Author

Bundling the node packing in the NuGet package would be tricky, as you'd still need to have the node runtime installed when using it.

Containers do pose a problem for stdio in particular since you need to get the executable (or .NET project) into the container and you need the runtime there so it can do dotnet run.

But I feel like from an Aspire perspective, stdio transport isn't the most logical approach you'd take.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integration A new .NET Aspire integration
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants