MyFirstMCP - Model Context Protocol Server Example
LocalAbout MyFirstMCP - Model Context Protocol Server Example
MyFirstMCP is a C# MCP server example built with .NET 9. It demonstrates service-backed tools for retrieving monkey data and managing sales records.
Key features
- 01Monkey data retrieval through an external API
- 02Sales record management
- 03MCP tools for service commands
Use cases
- 01Learning a basic C# MCP server structure
- 02Trying MCP tools backed by services
MCP support
Implements an MCP server that exposes command tools for its monkey and sales services.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMyFirstMCP - Model Context Protocol Server Example
This is a simple C# implementation of a Model Context Protocol (MCP) server using .NET 9. The project demonstrates how to create an MCP server with basic functionality including monkey and selling services.
Prerequisites
- .NET 9.0 SDK
- Visual Studio Code or Visual Studio 2022
Project Structure
MyFirstMCP/
├── Model/
│ └── Selling.cs
├── Service/
│ ├── MonkeyService.cs
│ └── SellingService.cs
├── Tools/
│ ├── EchoTool.cs
│ ├── MonkeyTools.cs
│ └── SellingTool.cs
└── Program.cs
Configuration
To use this MCP server with Visual Studio Code, add the following configuration to your ./claude/claude_desktop_config.json:
{
"mcpServers": {
"weather": {
"command": "dotnet",
"args": [
"run",
"--project",
"F:\\MyFirstMCP\\MyFirstMCP.csproj",
"--no-build"
]
}
}
}
Make sure to update the project path to match your local environment.
Features
- MonkeyService: Fetches monkey data from an external API
- SellingService: Manages selling records
- MCP Tools: Provides command interfaces for the services
Getting Started
- Clone the repository
- Open the project in Visual Studio Code
- Restore NuGet packages
- Run the project
References
For more information about Model Context Protocol:
Dependencies
- Microsoft.Data.Sqlite (9.0.4)
- Microsoft.Extensions.Hosting (9.0.4)
- ModelContextProtocol (0.1.0-preview.7)
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.