About TravelMCP
TravelMCP is an MCP server published by ppiova in the Search category: mCP Server for travel services - flights and hotels search.
The repository has 3 stars and 2 forks, with the last commit 11 months ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.
Install
git clone https://github.com/ppiova/TravelMCPThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about TravelMCP
Powered by Claude · Grounded in docs
Security checks
- ✓README presentThe repository ships documentation.
5 checks have not been run yet.
README
# Travel MCP Server
A Model Context Protocol (MCP) server built with .NET that provides travel information including flights and hotels data.
Features
- GetFlights: Search available flights with optional filtering by destination (IATA code)
- GetHotels: Search available hotels with optional filtering by city
- Case-insensitive filtering using
Contains - Data loaded from embedded JSON files
- Strongly typed with C# records
- Custom MCP protocol implementation over stdio (JSON-RPC 2.0)
- Zero external dependencies (except System.Text.Json)
Technologies
- .NET 8.0: Modern C# with minimal APIs
- System.Text.Json: Fast JSON serialization
- MCP Protocol: Custom implementation of Model Context Protocol over stdio
- JSON-RPC 2.0: Standard protocol for client-server communication
Prerequisites
- .NET 8.0 SDK or higher
- Visual Studio Code with GitHub Copilot extension
Setup
-
Clone or navigate to the project directory
cd TravelMCP -
Restore dependencies
dotnet restore -
Build the project
dotnet build
Visual Studio Code Configuration
Configure MCP in VS Code
The project includes a pre-configured .vscode/mcp.json file. To use it:
-
Open the project in VS Code:
code . -
Reload VS Code: Press
Ctrl+Shift+PDeveloper: Reload Window -
Open Copilot Chat: Press
Ctrl+Alt+I -
Verify tools are available: Type
@workspace /toolsin the chat
Using the MCP Server with GitHub Copilot
Once configured, you can interact with the server through GitHub Copilot Chat in VS Code:
Example prompts:
- "Show me all available flights"
- "Find flights to Las Vegas"
- "What hotels are available in San Francisco?"
- "Show me all hotels"
The MCP server will provide the data through the integrated tools.
Available Tools
GetFlights
Search for available flights with optional destination filtering.
Parameters:
to(optional): IATA destination code (e.g., "LAS", "SFO", "EZE")
Example usage in Copilot:
Show me flights to Las Vegas
Find flights with destination SFO
GetHotels
Search for available hotels with optional city filtering.
Parameters:
city(optional): City name (e.g., "Las Vegas", "San Francisco", "Buenos Aires")
Example usage in Copilot:
Show me hotels in San Francisco
Find hotels in Buenos Aires
Data Format
Flight Data
{
"flight_number": "AA1456",
"airline": "American Airlines",
"from": "Miami (MIA)",
"to": "Las Vegas (LAS)",
"departure_time": "2025-11-05T09:45:00",
"arrival_time": "2025-11-05T12:10:00",
"duration": "5h 25m",
"price_usd": 289.99
}
Hotel Data
{
"city": "Las Vegas",
"hotel_name": "The Venetian Resort",
"rating": 4.8,
"price_per_night_usd": 289.00,
"address": "3355 S Las Vegas Blvd, Las Vegas, NV 89109, USA",
"amenities": ["Pool", "Casino", "Spa", "Free WiFi"]
}
Project Structure
TravelMCP/
Data/
flights.json # Sample flight data
hotels.json # Sample hotel data
Mcp/
McpServer.cs # MCP server implementation
Protocol.cs # JSON-RPC protocol types
Models/
Flight.cs # Flight data model
Hotel.cs # Hotel data model
Program.cs # Application entry point
TravelServer.cs # Business logic and tool handlers
TravelMCP.csproj # Project configuration
Testing
Test with PowerShell Script
.\test-server.ps1
This will send sample MCP requests to the server and display the responses.
Test with Automated Tests
cd Tests
dotnet run
This runs automated tests verifying:
- Retrieving all flights
- Filtering by IATA code
- Case-insensitive partial search
- Filtering hotels by city
Key Implementation Details
- Immutable records: Uses C#
recordtypes for data models - Strong typing: All data is strongly typed with JSON deserialization
- Flexible filtering: Uses
Containsfor partial searches - Case-insensitive: Searches without case distinction
- XML documentation: Code comments for IntelliSense
- Complete MCP protocol: Custom implementation without external dependencies
- Safe null handling: Optional parameters with default values
- JSON Schema: Input schema definitions for tools
- Error handling: Proper error responses per JSON-RPC 2.0
Future Improvements
Functionality
- Add date validation to filter future flights
- Implement sorting by price, rating, duration
- Add combined
GetTravelPackage(destination)tool to search flight+hotel - Additional filters: airline, price range, specific amenities
- Add seat/room availability
- Implement booking (mock)
Technical
- Connect to real flight/hotel APIs
- Data caching with temporal invalidation
- Structured logging (Serilog, NLog)
- Unit tests with xUnit/NUnit
- Integration tests for MCP protocol
- Metrics and telemetry
- IATA code validation against official list
- Multi-language support (i18n)
Architecture
- Separate into layers (Data, Business, MCP)
- Dependency injection
- External configuration (appsettings.json)
- Containerization with Docker
- Health checks
- Rate limiting to prevent abuse
Contributing
This is a demonstration project. Suggestions and improvements are welcome!
Resources
License
MIT
Built with using .NET and MCP
README copy captured when this server was indexed; it may lag the repository. The original is authoritative.