This is the core library containing all the shared MCP server handlers (tools, prompts, resources) used by both the HTTP and stdio implementations of the EverythingServer sample.
This library contains:
-
Tools: Various example tools demonstrating different MCP capabilities
AddTool: Simple addition operationAnnotatedMessageTool: Returns annotated messagesEchoTool: Echoes input back to the clientLongRunningTool: Demonstrates long-running operations with progress reportingPrintEnvTool: Prints environment variablesSampleLlmTool: Example LLM sampling integrationTinyImageTool: Returns image content
-
Prompts: Example prompts showing argument handling
SimplePromptType: Basic prompt exampleComplexPromptType: Prompt with multiple arguments
-
Resources: Example resources with subscriptions
SimpleResourceType: Dynamic resource with URI template matching
-
Background Services: For managing subscriptions and logging
SubscriptionMessageSender: Sends periodic updates to subscribed resourcesLoggingUpdateMessageSender: Sends periodic logging messages at different levels
-
Extension Method:
AddEverythingMcpHandlersto configure all handlers in one call
Reference this project from your MCP server implementation (HTTP or stdio) and call the extension method:
builder.Services
.AddMcpServer()
.WithHttpTransport() // or WithStdioServerTransport()
.AddEverythingMcpHandlers(subscriptions);See the EverythingServer.Http and EverythingServer.Stdio projects for complete examples.