Tahubu-AI/mcp-simple
If you are the rightful owner of mcp-simple and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This project demonstrates a Model Context Protocol (MCP) server using .NET, featuring a Mars Photos API server and an interactive AI client.
get-current-date
Provides the current date for photo queries.
photo query
Allows querying of Mars rover photos by rover, date, and camera.
MCP .NET Demo - Mars Photos API
A complete demonstration of the Model Context Protocol (MCP) using .NET, featuring a Mars Photos API server and an interactive AI client. This project provides a simple example of how to build MCP servers and clients in .NET.
š Overview
This solution demonstrates a simple implementation of MCP (Model Context Protocol) using .NET 9.0, featuring:
- MCP Server: A Mars Photos API server that provides tools to query NASA's Mars rover data
- MCP Client: An interactive console application that connects to Claude AI for natural language queries
- Streaming HTTP Transport: Primary transport for client-server communication
- AI Integration: Anthropic Claude AI for intelligent photo queries
šļø Architecture
graph LR
A[MCP Client<br/>Claude AI] -->|HTTP Streaming| B[MCP Server<br/>Mars Photos]
B -->|HTTP| C[NASA API<br/>Mars Rovers]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
Transport Options
-
Streaming HTTP Transport (Primary)
- Used when running the
mcp-simple-client
project - Enables real-time communication between client and server
- Supports streaming responses for better user experience
- Used when running the
-
Stdio Transport (Alternative)
- Used when running the MCP server from external clients like Claude Desktop or VS Code
- Standard MCP transport for tool integration
Components
-
MCP Server (
mcp-simple-server/
)- Implements Mars Photos API tools
- Provides
get-current-date
and photo query capabilities - Handles NASA API communication
- Supports both HTTP and stdio transports
-
MCP Client (
mcp-simple-client/
)- Interactive console interface
- Integrates with Claude AI via Anthropic SDK
- Features conversation history and system prompt control
- Demonstrates different MCP interaction modes
- Uses streaming HTTP transport for real-time communication
š ļø Technologies Used
- .NET 9.0 - Modern .NET framework
- Model Context Protocol - AI tool integration standard
- Anthropic Claude AI - Natural language processing
- NASA Mars Photos API - Real Mars rover data
- Microsoft.Extensions.AI - AI integration libraries
- HTTP Streaming - Real-time client-server communication
š Project Structure
1-simple/
āāā README.md # This file
āāā mcp-simple.sln # Solution file
āāā mcp-simple-server/ # MCP Server implementation
ā āāā README.md # Server setup and documentation
ā āāā Program.cs # Server entry point
ā āāā MarsPhotosTools.cs # MCP tools implementation
ā āāā NasaApiConfiguration.cs # NASA API configuration
āāā mcp-simple-client/ # MCP Client implementation
āāā README.md # Client setup and documentation
āāā Program.cs # Client entry point
āāā mcp-simple-client.csproj # Client project file
š Quick Start
Prerequisites
- .NET 9.0 SDK
- Anthropic API key (for Claude AI access)
- Internet connection (for NASA API access)
Setup Instructions
-
Clone and Build
git clone <repository-url> cd 1-simple dotnet build
-
Configure API Keys
# Set Anthropic API key for the client cd mcp-simple-client dotnet user-secrets set "ANTHROPIC_API_KEY" "your-api-key-here"
-
Run the Demo
# Start the client (it will automatically start the server) cd mcp-simple-client dotnet run
š Detailed Documentation
Server Setup
For detailed server setup, configuration, and API documentation, see:
Client Setup
For client configuration, interactive menu system, and usage examples, see:
šÆ Demo Features
Interactive Menu System
- Choose between conversation history modes
- Toggle system prompt for date tool instructions
- Custom configuration options
Mars Photos Queries
- Query photos by rover, date, and camera
- Real-time date resolution for relative queries
- Detailed photo information and metadata
AI Integration
- Natural language processing with Claude
- Context-aware conversations
- Intelligent tool selection
Streaming Communication
- Real-time response streaming
- Immediate feedback during AI processing
- Enhanced user experience
š§ Development
Building from Source
# Build the entire solution
dotnet build
# Build individual projects
dotnet build mcp-simple-server
dotnet build mcp-simple-client
Debugging
- Open the solution in Visual Studio
- Set
mcp-simple-client
as the startup project - Press F5 to debug
š Key Learning Outcomes
This demo demonstrates:
-
MCP Server Implementation
- Tool definition and implementation
- API integration patterns
- Error handling and validation
-
MCP Client Implementation
- Client-server communication
- AI integration patterns
- User experience design
-
Real-world MCP Usage
- Practical tool development
- Natural language processing
- Context management
š¤ Contributing
This is a demonstration project. For contributions to the MCP specification or related tools, please refer to the official MCP documentation.
š License
This project is provided as a demonstration of MCP capabilities in .NET. Please refer to individual component licenses for specific terms.