Creating an MCP server
Add Runiq.Mcp to an ASP.NET Core application and expose an MCP endpoint.
Start with an ASP.NET Core application that should expose selected capabilities through MCP.
Runiq.Mcp hosts the MCP endpoint from the same application process. The application keeps its normal ASP.NET Core setup, dependency injection container, configuration, and services.
Register Runiq.Mcp
Add Runiq.Mcp to the host application.
Map the MCP endpoint
Map the MCP endpoint after building the application.
By default, the MCP endpoint is available at:
MCP-compatible clients connect to this endpoint using streamable HTTP transport.
Use a custom path
You can map a custom path when the default /mcp route does not fit your host application:
After the endpoint is mapped, expose application behavior by adding MCP tool classes. See Application service as MCP tool for the service-backed tool pattern.