A complete Model Context Protocol (MCP) solution containing both server and client applications for database operations.
This monorepo contains two main components:
- Purpose: Provides MCP tools and services
- Technologies: .NET 8.0, Model Context Protocol SDK
- Features:
- Weather information tools
- Random number generation
- Extensible tool architecture
- NuGet package distribution
- Purpose: Consumes MCP services through Azure OpenAI
- Technologies: .NET 10.0, Azure OpenAI, Microsoft Extensions AI
- Features:
- Azure OpenAI integration
- Interactive chat interface
- Automatic tool invocation
- Environment-based configuration
- .NET 8.0+ SDK
- Azure OpenAI service account (for client)
- Visual Studio 2022 or VS Code
cd server
dotnet run
# Set environment variables first
export AZURE_OPENAI_ENDPOINT="https://your-resource.openai.azure.com/"
export AZURE_OPENAI_API_KEY="your-api-key"
export AZURE_OPENAI_DEPLOYMENT_NAME="gpt-4o"
export MCP_SERVER_PROJECT_PATH="../server/SampleMcpServer.csproj"
cd client
dotnet run
mcp-database-solution/
├── README.md
├── MCP-Database-Solution.sln # Main solution file
├── server/ # MCP Server Project
│ ├── Program.cs
│ ├── SampleMcpServer.csproj
│ ├── Tools/
│ │ ├── WeatherTools.cs
│ │ └── RandomNumberTools.cs
│ ├── .mcp/
│ │ └── server.json
│ └── .vscode/
│ └── mcp.json
├── client/ # MCP Client Project
│ ├── Program.cs
│ ├── MCPHostApp.csproj
│ └── .env.example
└── docs/ # Documentation
└── setup.md
The server can be configured through:
- Environment variables (e.g.,
WEATHER_CHOICES
) - VS Code MCP settings (
.vscode/mcp.json
) - MCP server manifest (
.mcp/server.json
)
Create a .env
file in the client directory with:
AZURE_OPENAI_ENDPOINT=https://your-resource.openai.azure.com/
AZURE_OPENAI_API_KEY=your-api-key-here
AZURE_OPENAI_DEPLOYMENT_NAME=gpt-4o
MCP_SERVER_PROJECT_PATH=../server/SampleMcpServer.csproj
dotnet build MCP-Database-Solution.sln
dotnet test
cd server
dotnet pack
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
- mcpserver-database - Standalone server
- mcpclient-database - Standalone client