MCP Inspector integration

Цей контент ще не доступний вашою мовою.

⭐ Community Toolkit MCP Inspector logo

MCP Inspector is a development tool for testing and debugging Model Context Protocol (MCP) servers. The Aspire Community Toolkit integration adds it to your AppHost and configures it to inspect one or more HTTP MCP server resources.

Use the Inspector UI to connect to the configured server and test its MCP interactions. Aspire starts the Inspector alongside your application and provides a dashboard link to its client endpoint.

  • Run the Inspector as an Aspire-managed resource beside your MCP server.
  • Configure server endpoints, transport types, paths, and a default server from the AppHost.
  • Use the Aspire dashboard to open the Inspector and monitor its health.

The AppHost starts your MCP server and the Inspector process. Calling WithMcpServer registers the server endpoint with the Inspector and creates a resource relationship in the dashboard. The Inspector has a browser client endpoint and a server proxy endpoint. Aspire configures a proxy authentication token and adds it to the Inspector’s dashboard URL.

  • An MCP server resource with at least one HTTP endpoint.
  • Node.js and npm available on the machine running the AppHost. To use Yarn, pnpm, or Bun instead, install that package manager as well.

Install the hosting integration package in your AppHost project:

Aspire CLI — Додати пакет CommunityToolkit.Aspire.Hosting.McpInspector
aspire add communitytoolkit-mcpinspector

Aspire CLI інтерактивний; оберіть відповідний результат пошуку:

Aspire CLI — Приклад виводу
Select an integration to add:
> communitytoolkit-mcpinspector (CommunityToolkit.Aspire.Hosting.McpInspector)
> Other results listed as selectable options...

Add your MCP server and MCP Inspector as AppHost resources:

apphost.mts
import { createBuilder } from './.aspire/modules/aspire.mjs';
const builder = await createBuilder();
const mcpServer = await builder.addProject(
'mcp-server',
'../McpServer/McpServer.csproj'
);
const inspector = await builder.addMcpInspector('inspector');
await inspector.withInspectedMcpServer(mcpServer);
await builder.build().run();

The server project must expose an HTTP endpoint. The integration uses the https endpoint when available, otherwise it selects http, then the first endpoint on the server resource. WithMcpServer defaults to Streamable HTTP and the /mcp path.