SDKs overview

MuleSoft Anypoint Platform provides a range of Software Development Kits (SDKs) and libraries designed to extend its capabilities and enable programmatic interaction with its core services. These tools support developers in building custom connectors, developing advanced data transformations, and automating platform operations. The primary official SDKs are available for Java, Python, and Node.js, reflecting the platform's broad applicability in enterprise IT environments and common developer preferences.

Developers using MuleSoft often interact with the platform through Anypoint Studio, an integrated development environment (IDE) that supports visual and code-based development of APIs and integrations. While Anypoint Studio is central to building Mule applications, the SDKs allow for deeper customization and integration beyond the visual interface, enabling direct interaction with Mule runtime, API Manager, and other Anypoint Platform components. This dual approach supports both low-code development through connectors and high-code extensibility via SDKs.

The SDKs facilitate tasks such as creating custom policies for the API Gateway, developing new data connectors to integrate with niche systems, or scripting administrative tasks. For data transformation, MuleSoft utilizes DataWeave, a powerful, functional programming language specifically designed for data transformation, which has its own set of libraries and functions accessible within Mule applications.

Official SDKs by language

MuleSoft offers official SDKs and libraries primarily for Java, Python, and Node.js. These SDKs are maintained by MuleSoft and are intended for building extensions, custom connectors, and automating platform interactions programmatically. Each SDK is tailored to the conventions and ecosystems of its respective language.

Language Package/Module Installation Command Primary Use Cases
Java mule-sdk-api (Anypoint Connectors DevKit) Add as Maven dependency in pom.xml:
<dependency>
  <groupId>org.mule.sdk</groupId>
  <artifactId>mule-sdk-api</artifactId>
  <version>1.x.x</version>
</dependency>
Developing custom Anypoint Connectors, extending Mule runtime functionality, creating custom policies for API Gateway.
Python mule-rest-sdk pip install mule-rest-sdk Automating Anypoint Platform administration (e.g., managing APIs, applications, users), scripting integrations, interacting with Anypoint Platform APIs.
Node.js anypoint-platform-client npm install anypoint-platform-client Programmatic interaction with Anypoint Platform APIs, scripting deployment, monitoring, and administrative tasks; integrating Anypoint Platform into CI/CD pipelines.

Installation

Installation methods for MuleSoft Anypoint Platform SDKs vary by language and typically follow standard package management practices for each ecosystem.

Java SDK (Anypoint Connectors DevKit)

The Java SDK for building custom connectors and extensions is primarily used within Anypoint Studio. Developers include the necessary SDK dependencies in their Maven pom.xml file. Anypoint Studio handles the project setup and dependency management for connector development. A typical dependency for the Mule SDK API would be:

<dependency>
  <groupId>org.mule.sdk</groupId>
  <artifactId>mule-sdk-api</artifactId>
  <version>1.x.x</version>
  <scope>provided</scope>
</dependency>

Replace 1.x.x with the specific version compatible with your Mule runtime. Detailed instructions for creating a connector project are available in the MuleSoft documentation.

Python SDK (mule-rest-sdk)

The Python SDK can be installed using pip, Python's package installer. This SDK is often used for scripting administrative tasks or integrating Anypoint Platform into Python-based workflows.

pip install mule-rest-sdk

It is recommended to use a virtual environment to manage dependencies for Python projects to avoid conflicts.

Node.js SDK (anypoint-platform-client)

The Node.js client library is installed using npm, the Node.js package manager.

npm install anypoint-platform-client

This will add the package to your project's node_modules directory and update your package.json file. For more detailed usage, consult the official MuleSoft documentation.

Quickstart example

This example demonstrates how to use the Python SDK to list all APIs managed within your MuleSoft Anypoint Platform organization. This requires an Anypoint Platform account and appropriate credentials (client ID and client secret).

Python SDK Quickstart: List APIs

First, ensure you have the mule-rest-sdk installed:

pip install mule-rest-sdk

Then, use the following Python code:

from mule_rest_sdk import AnypointClient

# Replace with your Anypoint Platform Client ID and Client Secret
CLIENT_ID = "YOUR_ANYPOINT_CLIENT_ID"
CLIENT_SECRET = "YOUR_ANYPOINT_CLIENT_SECRET"

def list_apis():
    try:
        # Initialize the client with your credentials
        client = AnypointClient(CLIENT_ID, CLIENT_SECRET)

        # Get the organization ID (usually required for API operations)
        # For simplicity, we'll assume the client automatically handles fetching org details
        # In a real scenario, you might need to explicitly get the organization ID
        # For example, orgs = client.get_organizations(), then select one.
        
        # List all APIs in the default business group/organization
        apis = client.get_apis()
        
        if apis:
            print("Managed APIs in Anypoint Platform:")
            for api in apis:
                print(f"  - Name: {api.name}, ID: {api.id}, Version: {api.apiAssetVersion}")
        else:
            print("No APIs found.")

    except Exception as e:
        print(f"An error occurred: {e}")

if __name__ == "__main__":
    list_apis()

Before running, replace YOUR_ANYPOINT_CLIENT_ID and YOUR_ANYPOINT_CLIENT_SECRET with your actual Anypoint Platform credentials. These can typically be generated in the Access Management section of your Anypoint Platform account, under Connected Apps. This script will authenticate with the Anypoint Platform and then retrieve a list of all deployed APIs.

Community libraries

Beyond the official SDKs, the MuleSoft ecosystem benefits from a community of developers who contribute libraries, connectors, and tools. These community-driven projects can extend platform functionality, offer integrations with less common systems, or provide utility functions not present in the official offerings.

MuleSoft maintains Anypoint Exchange, a marketplace where both official and community-contributed assets are shared. This includes connectors, templates, examples, and API definitions. While not strictly SDKs, these assets often leverage the underlying SDKs and provide ready-to-use components that can significantly accelerate development.

Community contributions can be found on platforms like GitHub, often developed by individual developers, consulting partners, or organizations using MuleSoft. These libraries might address specific use cases, such as custom security policies, advanced logging aggregators, or specialized data format handlers. Developers should evaluate community libraries for their maintenance status, documentation quality, and compatibility with their Anypoint Platform version before incorporating them into production environments. Resources like MuleSoft's GitHub organization and broader developer communities are good places to discover such contributions, as is the Salesforce Developer Partners network for integration-focused solutions.