Logga in eller skapa ett konto för att få din API-nyckel och koppla upp din AI-assistent.

What is MCP?

MCP (Model Context Protocol) is a standard that allows AI assistants to interact with external services. QtrlMe supports MCP, enabling AI agents like Claude to list your devices, read sensor data, control switches and dimmers, and even check electricity prices - all through natural conversation.

Available Tools

Tool Description
hub_control Control hubs: list all hubs, get status (RSSI, firmware, uptime), or reboot
device_control Control devices: list devices, get state (temperature, switch), or set state (on/off, up/down)
get_electricity_price Get current electricity prices for Swedish price areas (SE1-SE4)

Setup Instructions

Choose your AI platform below for setup instructions:

Exemplen nedan använder platshållaren YOUR_API_TOKEN_HERE. Logga in för att se dina riktiga nycklar.
Claude Code (Recommended - Easiest)

Claude Code CLI has direct SSE support - no bridge needed!

Step 1: Install Claude Code
npm install -g claude-code
# or
curl -fsSL https://claude.ai/install.sh | sh
Step 2: Add QtrlMe MCP Server
Command
claude mcp add --transport sse qtrlme https://qtrl.me/mcp/sse \
  --header "Authorization: Bearer YOUR_API_TOKEN_HERE"
Step 3: Start Using

That's it! Start a chat and ask Claude about your devices:

claude chat
Then type: "List my RF-HUBs"
Claude Desktop (Requires Bridge)

Claude Desktop only supports stdio transport, so we need a bridge.

Step 1: Download the Bridge

Download qtrlme-bridge.js to a permanent location:

Download qtrlme-bridge.js

Save to: C:\qtrlme\qtrlme-bridge.js (or your preferred location)

Step 2: Configure Claude Desktop

Edit your Claude Desktop config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "qtrlme": {
      "command": "node",
      "args": [
        "C:\\qtrlme\\qtrlme-bridge.js",
        "https://qtrl.me/mcp",
        "YOUR_API_TOKEN_HERE"
      ]
    }
  }
}
Note: Update the bridge path to match where you saved it. On macOS/Linux, use forward slashes: /Users/yourname/qtrlme-bridge.js
Step 3: Restart Claude Desktop

Close and restart Claude Desktop completely for changes to take effect.

ChatGPT / OpenAI

API Endpoints:

  • GET https://qtrl.me/api/openai/functions - List available functions
  • POST https://qtrl.me/api/openai/functions/execute - Execute a function

Quick Test:

Test with curl
curl https://qtrl.me/api/openai/functions \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Python Example:

import openai
import requests

# Fetch QtrlMe functions
response = requests.get("https://qtrl.me/api/openai/functions",
    headers={"Authorization": "Bearer YOUR_TOKEN"})
functions = response.json()["functions"]

# Use with ChatGPT
client = openai.OpenAI(api_key="your_openai_key")
response = client.chat.completions.create(
    model="gpt-4",
    messages=[{"role": "user", "content": "List my RF-HUBs"}],
    functions=functions
)

Node.js Example:

const OpenAI = require('openai');
const axios = require('axios');

const client = new OpenAI({ apiKey: 'your_openai_key' });

// Fetch QtrlMe functions
const { data } = await axios.get('https://qtrl.me/api/openai/functions', {
  headers: { Authorization: 'Bearer YOUR_TOKEN' }
});

// Use with ChatGPT
const response = await client.chat.completions.create({
  model: 'gpt-4',
  messages: [{ role: 'user', content: 'List my RF-HUBs' }],
  functions: data.functions
});

// Handle function call
if (response.choices[0].message.function_call) {
  const { name, arguments: args } = response.choices[0].message.function_call;

  const result = await axios.post('https://qtrl.me/api/openai/functions/execute',
    { name, arguments: args },
    { headers: { Authorization: 'Bearer YOUR_TOKEN' }}
  );

  console.log(result.data.content);
}
Authentication: All requests require your API token via Bearer authentication header.
Google Gemini

API Endpoints:

  • GET https://qtrl.me/api/gemini/functions - List available functions
  • POST https://qtrl.me/api/gemini/functions/execute - Execute a function

Quick Test:

Test with curl
curl https://qtrl.me/api/gemini/functions \
  -H "Authorization: Bearer YOUR_API_TOKEN"

Python Example:

import google.generativeai as genai
import requests

# Fetch QtrlMe functions
response = requests.get("https://qtrl.me/api/gemini/functions",
    headers={"Authorization": "Bearer YOUR_TOKEN"})
functions = response.json()["functionDeclarations"]

# Use with Gemini
genai.configure(api_key="your_gemini_key")
model = genai.GenerativeModel(
    model_name="gemini-pro",
    tools=[{"function_declarations": functions}]
)

chat = model.start_chat()
response = chat.send_message("List my RF-HUBs")

Node.js Example:

const { GoogleGenerativeAI } = require('@google/generative-ai');
const axios = require('axios');

const genAI = new GoogleGenerativeAI('your_gemini_key');

// Fetch QtrlMe functions
const { data } = await axios.get('https://qtrl.me/api/gemini/functions', {
  headers: { Authorization: 'Bearer YOUR_TOKEN' }
});

// Use with Gemini
const model = genAI.getGenerativeModel({
  model: 'gemini-pro',
  tools: [{ functionDeclarations: data.functionDeclarations }]
});

const chat = model.startChat();
const result = await chat.sendMessage('List my RF-HUBs');

// Handle function call
const call = result.response.functionCalls()?.[0];
if (call) {
  const executeResult = await axios.post(
    'https://qtrl.me/api/gemini/functions/execute',
    { name: call.name, args: call.args },
    { headers: { Authorization: 'Bearer YOUR_TOKEN' }}
  );

  console.log(executeResult.data.response);
}
Authentication: All requests require your API token via Bearer authentication header.

Example Commands

Once connected, you can ask Claude things like:

  • "Show me the temperature from all my sensors"
  • "Turn on the living room light"
  • "What's the current electricity price in SE3?"
  • "List all my connected hubs and their status"
  • "Lower the bedroom blinds"

Your API Token


Logga in för att se och använda dina API-nycklar.

Logga in

MCP Endpoints