Generates UNHCR data visualization charts (bar, line, pie, scatter) by interacting with a FastAPI chart generation service, returning charts as base64-encoded images.
UNHCR Chart Generation MCP Server
This MCP (Model Context Protocol) server in smithery.ai provides tools for generating UNHCR charts using the FastAPI chart generation service. It allows AI agents to create various types of charts (bar, line, pie, etc.) with UNHCR data visualization.
This server interacts with the UNHCR Chart Generation API.
Features
Generate various types of charts (bar, line, pie, scatter) with UNHCR data
Create population trend charts for refugee data
Generate comparison charts with multiple datasets
Customize chart titles, labels, and styling
Return charts as base64-encoded images for easy integration
Connect to MCP Server
To access the server, open your web browser and visit the following URL: https://smithery.ai/server/@rvibek/mcp_unhcrpyplot
Configure the MCP host/client as needed.
API Endpoint
The server generates charts using the following API endpoint:
https://unhcrpyplot.rvibek.com.np/plot
The API accepts JSON payloads with the following structure:
MCP Tools
The server exposes the following tools:
generate_unhcr_graph
Generate a UNHCR chart using the FastAPI chart generation service.
Parameters:
chart_type(required): Type of chart to generate (bar, line, pie, scatter, etc.)title(required): Main title of the chartsubtitle(required): Subtitle describing the chart contentx_label(required): Label for the x-axisy_label(required): Label for the y-axislabels(required): List of labels for the data points (e.g., years, countries)values(required): List of numerical values corresponding to the labels
Returns:
Dictionary containing the chart image as base64 and metadata
generate_comparison_chart
Generate a comparison chart with multiple datasets.
Parameters:
chart_type(required): Type of chart (bar, line, etc.)title(required): Main title of the chartsubtitle(required): Subtitle describing the chart contentx_label(required): Label for the x-axisy_label(required): Label for the y-axisdatasets(required): List of datasets, each containing 'label', 'labels', and 'values'
Returns:
Dictionary containing the chart image as base64 and metadata
generate_population_trend_chart
Generate a population trend chart for UNHCR data.
Parameters:
years(required): List of years for the x-axispopulation_counts(required): List of population counts for each yearcountry_name(optional): Name of the country or region being visualized (default: "Country")chart_type(optional): Type of chart (line, bar, etc.) (default: "line")
Returns:
Dictionary containing the chart image as base64 and metadata
Example Usage
Here's an example of how to use the generate_unhcr_graph tool:
Response Format
Successful chart generation returns:
License
MIT
Acknowledgments
This project uses the UNHCR Chart Generation API for creating visualizations of UNHCR data.