This is a Model Context Protocol (MCP) server built with Zuplo that demonstrates how to create custom MCP tools that orchestrate multiple API calls using an OpenAPI-defined API.
About this example
This project implements a Travel Advisor with MCP integration that showcases:
MCP Custom Tool
plan-trip- A custom tool that aggregates weather forecasts, activity recommendations, and packing suggestions into a comprehensive travel brief for any destination
Key Features
This example demonstrates how to build an MCP tool that:
- Orchestrates multiple API calls - The
plan-triptool internally calls three separate endpoints (/weather,/activities,/packing) - Processes and combines data - Analyzes weather patterns to filter activities and adjust packing recommendations
- Returns structured responses - Provides a single, comprehensive JSON response optimized for LLM consumption
Key Components
- OpenAPI-based Routes (
config/routes.oas.json) - API routes with MCP annotations - Custom Tool Handler (
modules/plan-trip.ts) - Orchestration logic that combines multiple data sources
Prerequisites
- A Zuplo account. You can sign up for free.
Getting Started
Locally
Working locally is the best way to explore and understand the code for this example. You can get a local version by using the Zuplo CLI:
Environment Setup
Copy the example environment file and configure the BASE_URL:
For the BASE_URL, you can use the provided Mockbin API:
Alternatively, upload the travel-plan-api-oas.json file to Mockbin or another mock API service to create your own endpoints.
Note: When deploying to Zuplo, set environment variables in the Settings > Environment Variables section of your project in the Zuplo Portal.
Once you have the code on your local machine and environment configured, start the development server:
The API will be available at http://localhost:9000.
You can access:
- API Gateway -
http://localhost:9000 - Local API Route Designer -
http://localhost:9100 - MCP Endpoint -
http://localhost:9000/mcp(POST)
The dev server will automatically reload when you modify:
- Route definitions in
config/routes.oas.json - Handler modules in
modules/
Deploying with Zuplo CLI
Install the Zuplo CLI
Login to Zuplo
Create a New Project
Follow the prompts to create a new project in your Zuplo account.
Deploy to Zuplo
Deploy to a working copy environment:
Using the MCP Server
Once deployed, you can connect to your MCP server using any MCP testing tool:
Model Context Protocol Inspector
MCPJam
You can then test the MCP server locally, or point your inspector at a deployed version.
Local MCP Server
Deployed MCP Server
The server will expose 1 custom tool, plan-trip, that demonstrates API orchestration for travel planning.
Example Usage
Try asking the MCP tool:
- "I'm planning a trip to Tokyo, what should I know?"
- "Help me plan a trip to Tokyo"
- "What should I pack for Tokyo"
The tool will automatically fetch weather data, recommend activities, and suggest packing items based on the destination's climate.