Skip to main content

A Python-based MCP server for Cumulocity IoT platform integration

Project description

MCP Cumulocity Server

A Python-based server that provides Cumulocity IoT platform functionality through the MCP (Model Control Protocol) interface. This server enables seamless interaction with Cumulocity's device management, measurements, and alarm systems.

Available Tools

Device Management

  1. Get Devices

    • List and filter devices
    • Parameters:
      • type: Filter by device type
      • name: Filter by device name
      • page_size: Results per page (max 2000)
      • current_page: Page number
  2. Get Device by ID

    • Retrieve detailed information for a specific device
    • Parameter:
      • device_id: Device identifier
  3. Get Child Devices

    • View child devices of a specific device
    • Parameter:
      • device_id: Parent device identifier
  4. Get Device Fragments

    • Access device fragments and their values
    • Parameter:
      • device_id: Device identifier

Measurements

Get Device Measurements

  • Retrieve device measurements with time filtering
  • Parameters:
    • device_id: Device identifier
    • date_from: Start date (ISO 8601 format)
    • date_to: End date (ISO 8601 format)
    • page_size: Number of measurements to retrieve

Alarms

Get Active Alarms

  • Monitor active alarms in the system
  • Parameters:
    • severity: Filter by severity level
    • page_size: Number of results to retrieve

Installation

Using uv (recommended)

When using uv no specific installation is needed. We will use uvx to directly run mcp-server-c8y.

Using PIP

Alternatively you can install mcp-server-c8y via pip:

pip install mcp-server-c8y

After installation, you can run it as a script using:

python -m mcp_server_c8y

Configuration

Create a .env file in the project root with the following variables:

C8Y_BASE_URL=<your-cumulocity-base-url>
C8Y_TENANT_ID=<your-tenant-id>
C8Y_USERNAME=<your-username>
C8Y_PASSWORD=<your-password>

Usage with Claude Desktop

This MCP Server can be used with Claude Desktop to enable Claude to interact with your Cumulocity IoT platform. Follow these steps to set it up:

  1. Download and install Claude Desktop

  2. Configure Claude Desktop to use this MCP Server:

    • Open Claude Desktop
    • Click on the Claude menu and select "Settings..."
    • Navigate to "Developer" in the left-hand bar
    • Click "Edit Config"
  3. Add the following configuration to your claude_desktop_config.json:

Using uvx
"mcpServers": {
  "c8y": {
    "command": "uvx",
    "args": ["mcp-server-c8y"],
      "env": {
        "C8Y_BASE_URL": "https://your-cumulocity-instance.com",
        "C8Y_TENANT_ID": "your-tenant-id",
        "C8Y_USERNAME": "your-username",
        "C8Y_PASSWORD": "your-password"
      }
  }
}
Using pip installation
"mcpServers": {
  "c8y": {
    "command": "python",
    "args": ["-m", "mcp_server_c8y"],
      "env": {
        "C8Y_BASE_URL": "https://your-cumulocity-instance.com",
        "C8Y_TENANT_ID": "your-tenant-id",
        "C8Y_USERNAME": "your-username",
        "C8Y_PASSWORD": "your-password"
      }
  }
}

Replace the following placeholders with your actual values:

  • https://your-cumulocity-instance.com: Your Cumulocity instance URL
  • your-tenant-id: Your Cumulocity tenant ID
  • your-username: Your Cumulocity username
  • your-password: Your Cumulocity password
  1. Restart Claude Desktop

  2. You should now see a hammer icon in the bottom right corner of the input box. Click it to see the available Cumulocity tools.

For more detailed information about using MCP Servers with Claude Desktop, visit the official MCP documentation.

Options

  • --session, -s: Specify a Cumulocity session
  • -v, --verbose: Increase verbosity (can be used multiple times)

Contributing

We welcome contributions from everyone! Here's how you can contribute to this project:

  1. Fork the repository
  2. Create a new branch for your feature or bugfix
  3. Make your changes following these best practices:
    • Write clear, descriptive commit messages
    • Follow the existing code style and conventions
    • Add tests for new features
    • Update documentation as needed
    • Ensure all tests pass
  4. Submit a pull request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_c8y-0.1.1.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_c8y-0.1.1-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_c8y-0.1.1.tar.gz.

File metadata

  • Download URL: mcp_server_c8y-0.1.1.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mcp_server_c8y-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0c0f80bd204f65dcae15803ff6e055ed5842f1475517d08f8ebab19d0b2e384a
MD5 4952183092e21cfebd015146e0e23684
BLAKE2b-256 c3f31ecb0514c22c3e25450e6476b60b75fe889b6d15a5477a4e15827e62be49

See more details on using hashes here.

File details

Details for the file mcp_server_c8y-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: mcp_server_c8y-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for mcp_server_c8y-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 365617efbe2007bfc5c94dcb46f474c79c0579a542b2e012bc206bb867caee99
MD5 6fa16bf5c982ff4a9d942ae38b4c3f5c
BLAKE2b-256 7c9b2894014f905b000b3a3bbb8760f08c016e76f0ca2db8a8fcd8f85a3602ef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page