Introduction
In the era of AI, integrating agents with external systems is crucial for expanding their capabilities. Whether accessing local file systems, remote databases, or APIs, external data significantly enhances an AI agent’s ability to assist in daily tasks.
However, connecting AI agents to external systems can be challenging. Different systems use various interfaces and protocols, making integration complex. Fortunately, Anthropic’s Model Context Protocol (MCP) simplifies this process, providing a standardized way for AI agents to interact with external resources and tools.
MCP functions similarly to HTTP on the internet—it defines a standardized approach that enables AI agents to discover and interact with external systems seamlessly.
Building an MCP Server for Tibber
In this blog post, I’ll demonstrate how I built a MCP server for integrating Tibber with an AI agent.
Tibber is a Norwegian power supplier that we’ve been using for years. They provide APIs that allow users to retrieve electricity prices and energy consumption data. By integrating Tibber’s API with an AI agent, I can ask natural language questions like:
- “What is the current electricity price?”
- “What was my house’s energy cost yesterday?”
- “List the 3 cheapest hours of tomorrow.”
This integration enables a more intuitive and efficient way to access real-time energy data without manually querying APIs.
Demo video
Architecture

Installation and Setup Tibber MCP server
You can find the source code for Tibber MCP on my GitHub repository: https://github.com/linkcd/tibber-mcp.
Follow the installation steps in the repository to deploy Tibber MCP on your local machine. Once installed, configure the MCP server settings as follows:
1 | { |
Once it is successfully connected to the MCP server, you can see the available tools (and resources) this MCP server provides. This is the screenshot of Roo Code MCP servers in VS Code.

Sample questions and answers
Question #1: “What is the current electricity price?”
Answer:
1 | The current electricity price (as of 16:00) is 0.6955 NOK/kWh with a NORMAL price level. |
Question #2: “What was my house’s energy cost yesterday?”
Answer:
1 | Your total electricity cost for yesterday (March 27th) was: |
Thoughts and improvement areas
When reading the source code, you may have noticed how easy it is to build an MCP server using tools like FastMCP. With fewer than 100 lines of code, it efficiently wraps the pyTibber library into an MCP server implementation, enabling the AI agent to interact with it automatically.
Currently, this MCP server implementation does not support parameters such as date or time when making API calls. For example, when you ask, “What was my energy consumption yesterday?”, it retrieves all consumption data for the past 30 days and relies on the LLM (Large Language Model) to extract the relevant information.
To improve efficiency and reduce token usage, we could implement parameterized API calls. This would allow the AI agent to pass a specific date (e.g., yesterday) and retrieve only the necessary data, making the interaction more precise and resource-efficient.
Feedback
If you have any questions or suggestions, feel free to reach out or create a GitHub issue for the repository: https://github.com/linkcd/tibber-mcp.