Dirigera Mcp Iot Device Control Server
LocalAbout Dirigera Mcp Iot Device Control Server
An MCP server for managing IKEA Dirigera smart-home devices, aimed at users connecting lights, outlets, and environment sensors to MCP clients. It offers device status tools and controls, with stdio and remote transport options.
Key features
- 01List sensor readings
- 02Inspect outlets and lights
- 03Switch devices on or off
- 04Adjust light brightness and color
- 05Run over stdio or remote transports
- 06Optional JWT authentication
Use cases
- 01Check temperature, humidity, and air-quality readings
- 02Review outlet power and light status
- 03Turn a named light or outlet on or off
- 04Change a compatible light’s brightness or color
MCP support
Exposes sensor, outlet, and light status tools, plus controls for power and light settings, to MCP clients. Supports stdio, streamable HTTP, and SSE transports.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEDirigera MCP Server
An MCP server for controlling IKEA Dirigera smart home devices -- outlets, lights, and environment sensors.
Built with FastMCP and the dirigera Python library.
Prerequisites
- Python 3.11+
- uv package manager
- IKEA Dirigera Hub on your local network
Setup
1. Install dependencies
uv sync
2. Get a Dirigera token
You need a JWT token to authenticate with your Dirigera Hub. Use the included helper:
uv run gen_token.py 192.168.1.200
This will send an authentication challenge to the hub. Press the action button on your Dirigera Hub when prompted, and the token will be printed.
3. Configure
Copy the example config and fill in your values:
cp config.example.toml config.toml
[dirigera]
host = "192.168.1.200"
token = "your-dirigera-token-here"
The server looks for ../config.toml by default (one directory up). Override with --config-path:
uv run dirigeramcp.py --config-path ./config.toml
Running the server
Local (stdio) -- for Claude Desktop, Claude Code, MCP CLI
uv run dirigeramcp.py
Remote (streamable-http) -- recommended for remote clients
uv run dirigeramcp.py --transport streamable-http --host 0.0.0.0 --port 8000
Server will be available at http://<your-ip>:8000/mcp.
Remote (SSE) -- legacy
uv run dirigeramcp.py --transport sse --host 0.0.0.0 --port 8000
Server will be available at http://<your-ip>:8000/sse.
With JWT authentication
For remote transports, you can enable JWT authentication:
uv run dirigeramcp.py --transport streamable-http --host 0.0.0.0 --auth
On first run with --auth, if no [auth] section exists in your config, the server auto-generates secrets and saves them. You can also set them manually in config.toml:
[auth]
jwt_secret = "your-hex-secret"
api_key = "your-hex-api-key"
expiry_hours = 24
To get a JWT token, POST to the token endpoint:
curl -X POST http://localhost:8000/auth/token \
-H "Content-Type: application/json" \
-d '{"api_key": "your-api-key"}'
To refresh an expiring token:
curl -X POST http://localhost:8000/auth/refresh \
-H "Authorization: Bearer <your-jwt-token>"
Available tools
| Tool | Description | Parameters |
|---|---|---|
get_environment_sensors | List sensors with temperature, humidity, PM2.5, VOC, CO2 | -- |
get_outlets | List outlets with power, voltage, current | -- |
get_lights | List lights with brightness, color temp, hue, saturation, on/off | -- |
set_onoff | Turn an outlet or light on/off by name | name, is_on |
set_light_level | Set light brightness | name, light_level (int) |
set_light_color | Set light color (if supported) | name, color_saturation (0.0-1.0), color_hue (0-360) |
Testing with MCP Inspector
npx @modelcontextprotocol/inspector uv --directory . run dirigeramcp.py
Claude Desktop configuration
Add this to your Claude Desktop claude_desktop_config.json:
{
"mcpServers": {
"dirigera": {
"command": "uv",
"args": [
"--directory",
"/path/to/mcp-agents/dirigera/fastmcp",
"run",
"dirigeramcp.py"
]
}
}
}
Command-line options
--config-path Path to config TOML file (default: ../config.toml)
--host Host to bind to (default: 127.0.0.1, use 0.0.0.0 for remote)
--port Port to bind to (default: 8000)
--transport stdio | sse | streamable-http (default: stdio)
--auth Enable JWT authentication (remote transports only)
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.