Skip to main content

Ubidots MCP Server

Create AI applications that interact with your data.

Written by Sergio M

Overview

The Model Context Protocol (MCP) lets AI applications securely connect to external APIs. In IoT projects, that means your AI application can automatically decide whether it needs to call the Ubidots API in order to reply to a user prompt — whether that's reading data or making a change on your behalf.

Examples:

  • “Which devices are offline?”

  • “Show the last values of temperature for device aws810”.

  • "What was the average temperature yesterday of Machine ABC".

  • "Create a new incident for device `aws810` with severity P2."

  • "Update the description of device `pump-04`."

In this article we explore using Ubidots MCP from:

  • Claude Desktop

  • Anthropic API


Using Ubidots MCP server from Claude Desktop

Prerequisites

  • A Ubidots account and Ubidots API token (scoped for the org you want to use).

  • Claude Desktop installed (macOS/Windows/Linux).

Step-by-step

  1. Open Claude Desktop Settings
    Launch Claude Desktop → SettingsDeveloper.

  2. Edit Config
    Click Edit config to open claude_desktop_config.json.

  3. Add the Ubidots MCP server entry
    Paste the snippet below into the JSON (merge with your existing mcpServers if present).
    Replace <YOUR UBIDOTS TOKEN> with your actual token.

    {
    "mcpServers": {
    "ubidots": {
    "command": "npx",
    "args": [
    "-y",
    "mcp-remote",
    "https://mcp.ubidots.com/mcp",
    "--header",
    "Authorization:${AUTH_HEADER}"
    ],
    "env": {
    "AUTH_HEADER": "Bearer <YOUR UBIDOTS TOKEN>"
    }
    }
    }
    }

    Notes

    • If mcpServers already exists, add only the "ubidots" block inside it.

    • Keep JSON syntax valid (commas, braces).

    • The URL above (/mcp) exposes all available tools. See Scoped MCP paths below to restrict access by entity or permission level.

  4. Save & Reload Claude
    Save the file and restart Claude Desktop (or use “Reload” if available).

  5. Verify the connection


    In a new Claude chat, make sure the MCP is enabled and try this:

    • “Which devices are online?"

    If configured correctly, Claude should confirm the MCP tool is available and return live data from Ubidots.

Troubleshooting

Claude doesn’t show the Ubidots tool

  • Restart Claude after editing the config.

  • Check JSON validity (use an online JSON linter if needed).

  • Ensure npx is available in your system PATH.

401 / Unauthorized

  • Verify the header is exactly: x-auth-token: <YOUR UBIDOTS TOKEN>.

  • Check the token hasn’t expired or been revoked.

Network errors

  • Confirm you’re online and not behind a proxy/firewall blocking outbound HTTPS.

  • Try again later in case of transient network issues.

Multiple MCP servers configured

  • Make sure there are no duplicate keys named ubidots.

  • If you renamed the server, remember the name you’ll see inside Claude will match that key.

Updating or Removing the Integration

  • Update token: Open claude_desktop_config.json, replace the token in the header, save, and reload Claude.

  • Disable: Remove or comment out the "ubidots" block under mcpServers, save, and reload Claude.


Using Ubidots MCP server with Anthropic API

While Claude Desktop is great for testing, it does not resemble real world scenarios, where users will want to interact with an AI agent through Slack, Whatsapp, or a web-based chat box within your Ubidots-powered application.

In such scenarios, using an AI API such as OpenAI API or Anthropic API will enable you to add the required layer of intelligence to your use case.

Here's a sample request you'd use from such an application in order to interact with both your user queries, and Ubidots MCP:

curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "content-type: application/json" \
-H "anthropic-version: 2023-06-01" \
-H "anthropic-beta: mcp-client-2025-04-04" \
-d '{
"model": "claude-3-5-sonnet-20240620",
"max_tokens": 500,
"system": "You are a smart IoT assistant. If you need device data, use the attached MCP.",
"messages": [
{"role": "user", "content": "List my devices"}
],
"mcp_servers": [
{
"type": "url",
"name": "ubidots",
"url": "https://mcp.ubidots.com/mcp",
"authorization_token": "YOUR_UBIDOTS_TOKEN"
}
]
}'

To learn more about Anthropic MCP connector, please visit their official documentation.


Scoped MCP paths

By default, connecting to https://mcp.ubidots.com/mcp exposes all available tools to the AI — including tools that create or modify data, not just read it. You can narrow this down by using a more specific path — either to restrict permissions (read-only) or to limit the scope to a specific entity (devices, variables, incidents, etc.).

This is useful for two reasons:

  • Security: You can guarantee the AI only has read access, or that it can only interact with a specific subset of your data.

  • Preventing unintended changes: Since most entities now support write operations (creating or updating records), scoping to a `/readonly` path is recommended for any use case where the AI shouldn't be able to modify your account — for example, a read-only reporting chatbot.

  • Token efficiency: Exposing fewer tools means less context is sent to the AI model on every request, reducing input token consumption.

Available paths

Path

Description

/mcp

All tools (read and write) across all entities

/mcp/readonly

All tools, restricted to read-only operations

/mcp/_/devices

All tools scoped to devices only

/mcp/_/devices/readonly

Read-only tools scoped to devices only

/mcp/_/variables

All tools scoped to variables only

/mcp/_/variables/readonly

Read-only tools scoped to variables only

/mcp/_/device-groups

All tools scoped to device groups only

/mcp/_/device-groups/readonly

Read-only tools scoped to device groups only

/mcp/_/device-types

All tools scoped to device types only

/mcp/_/device-types/readonly

Read-only tools scoped to device types only

/mcp/_/organizations

All tools scoped to organizations only

/mcp/_/organizations/readonly

Read-only tools scoped to organizations only

/mcp/_/events

All tools scoped to events only (currently read-only)

/mcp/_/events/readonly

Same as /mcp/_/events; no write tools exist for this entity yet

/mcp/_/incidents

All tools scoped to incidents only

/mcp/_/incidents/readonly

Read-only tools scoped to incidents only

Example: read-only access to devices

In a Claude Desktop config, simply replace the URL:

"args": [
"-y",
"mcp-remote",
"https://mcp.ubidots.com/mcp/_/devices/readonly",
"--header",
"Authorization:${AUTH_HEADER}"
]

In an Anthropic API call:

"mcp_servers": [
{
"type": "url",
"name": "ubidots",
"url": "https://mcp.ubidots.com/mcp/_/devices/readonly",
"authorization_token": "YOUR_UBIDOTS_TOKEN"
}
]


FAQ

Does this work with other MCP clients?

Yes. Any MCP-compatible client can connect to https://mcp.ubidots.com/mcp (or any of the scoped paths) using the same Authorization header.

Is the server local?
No. The Ubidots MCP Server is cloud-hosted; saving you the need to run it locally, and enabling applications such as Whatsapp AI bots.

Can I use multiple Ubidots accounts?
Yes—create separate entries (e.g., ubidots-prod, ubidots-staging) with different tokens.


MCP Tools

The Ubidots MCP server provides access to your account data across the entities below. Most entities support both reading and writing — you can query existing records as well as create and update them. Events is currently read-only.

Entity

Read tools

Write tools

Devices

list_devices, list_device_last_values

create_device, update_device

Variables

list_variables, list_variables_by_device, get_variable_statistics, get_variable_series

create_variable, update_variable

Device Types

list_device_types

create_device_type, update_device_type

Device Groups

list_device_groups

create_device_group, update_device_group

Organizations

list_organizations

create_organization, update_organization

Events

list_events, list_event_logs

Incidents

list_incidents, list_incident_logs

create_incident, acknowledge_incident, add_incident_comment, assign_incident

Note on Incidents: An incident's assignment and state (acknowledged, commented) can be updated after creation, but its severity and description currently cannot be changed through the MCP once it's been created.

List of statistical aggregate functions that can be queried using the MCP server

The MCP server can compute aggregated results over user variables using the following operations:

  • First

  • Last

  • Min

  • Max

  • Count

  • Sum

  • Mean

  • Standard deviation

  • Percentile 25

  • Percentile 50

  • Percentile 75


Example Prompts to Get You Started

Reading data:

  • “List organizations and show device counts for each.”

  • “For device aws810, list variables and show last timestamps and values.”

  • "What’s the average temperature at which the AC is running on each floor?"

Creating and updating data:

  • "Create a new device called pump-04 under the Plant North organization."

  • "Update the description of device aws810 to 'North wing compressor'."

  • "Create a P2 incident for device aws810 about a sensor fault."

  • "Acknowledge incident #1234 and leave a comment that we're investigating."

  • "Show me all triggered incidents that aren't assigned to anyone."


If you run into issues or have feature requests for the Ubidots MCP Server, let us know what client you’re using, your OS, and a redacted copy of your mcpServers config so we can help faster.

Did this answer your question?