A Model Context Protocol (MCP) server for accessing the Climatiq API to calculate carbon emissions. This allows AI assistants to perform real-time carbon calculations and provide climate impact insights. Demo https://github.com/user-attachments/assets/c253d6d1-ccf6-4c14-965e-6023ba2a0296 https://github.com/user-attachments/assets/d61c1181-acf6-4d9f-9a48-537fc64ac4c3 Features This MCP server integrates with the Climatiq API to provide carbon emission calculations for AI assistants: Tools - **set-api-key**: Configure the Climatiq API key used for authentication - **electricity-emission**: Calculate carbon emissions from electricity consumption - **travel-emission**: Calculate carbon emissions from travel by car, plane, or train - **search-emission-factors**: Search for specific emission factors in the Climatiq database - **custom-emission-calculation**: Perform custom calculations using specific emission factors - **cloud-computing-emission**: Calculate emissions from cloud computing resources usage - **freight-emission**: Calculate emissions from freight transportation - **procurement-emission**: Calculate emissions from procurement spending - **hotel-emission**: Calculate emissions from hotel stays - **travel-spend**: Calculate emissions from travel expenses Resources - Carbon calculation results are exposed as resources with a climatiq://calculation/{id} URI scheme - Each resource contains detailed information about an emission factor and calculation results Prompts - **climate-impact-explanation**: Generate natural language explanations about the climate impact of specific emission calculations Installation From Source This project uses uv for virtual environment and dependency management. Make sure to install uv first. Using uv API Key Configuration The server requires a Climatiq API key to function. You have several options to provide it: 1. **Environment Variable**: Set the CLIMATIQ_API_KEY environment variable before starting the server 2. **Configuration During Installation**: 3. **set-api-key Tool**: Use the set-api-key tool to configure it during runtime within the AI assistant 4. **Configuration File**: Create a .env file in the project directory: To get a Climatiq API key: 1. Sign up at app.climatiq.io 2. Follow the instructions at Getting API Keys Running the Server The server can be started directly from the command line: Setup in AI Assistants Claude Desktop On MacOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json Configuration Example Examples and Utilities Examples Directory The examples/ directory contains: - **climatiq.ipynb**: A Jupyter notebook demonstrating direct API usage with Climatiq - **simple_test.py**: A simple utility for testing the API integration directly without MCP protocol Utility Scripts The utils/ directory contains several helpful scripts: Test Client The test_client.py script tests all the tools, prompts, and resources: LLM Example Client The llm_example_client.py script demonstrates how a Large Language Model (like Claude) could interact with the Climatiq MCP server: