Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Splunk | Total Number of Splunk dashboards
## Installation

### Requirements
- Mule Runtime 4.2.2 or above
- Mule Runtime 4.9.3 or above
- All deployments models are supported: CloudHub, OnPrem hosted Runtimes, Runtime Fabric
- Anypoint Platform credentials - Two options are supported:
- Anypoint Platform user with the Organization Administrator role, and CloudHub Admin role (or specific permissions - see connected app section). Both roles should be provided in the Master and all Sub Orgs for which you wish to gather data. The CloudHub Admin role is environment specific - therefore should be granted for each environment in each business group.
Expand Down Expand Up @@ -445,7 +445,7 @@ Using the `sfdc` loader option, and initialising Salesforce Analytics Studio wit
5. Create a new data recipe, setting your new dataset as the source. Transform "value" from a dimension to a measure.
6. (Optional) - Filter out the non-numeric value fields (API Manager Policies Used and CloudHub Runtime Versions Used) and store this in a new 'enum' dataset
7. (Optional) - Create a 'historic' dataset. Add a step to your data recipe to append to this historic dataset
More detailed steps can be found in the [SFDC specific README](README_sfdc.md).
More detailed steps can be found in the [SFDC specific README](/docs/README_sfdc.md).

**Note:** This is only a high level introduction and it is highly recommended that you become familiar with Tableau CRM through official documentation.

Expand Down Expand Up @@ -575,6 +575,10 @@ How to link business needs, measurements and data sources?
#### Detailed
![Implementation Approach](/img/implementation_approach.png)

### MCP Support
Starting version 2.0.0, the Metrics Toolkit introduces MCP support to facilitate the discovery and usage of the Toolkit in agentic architectures. Please see ![MCP Server](/docs/MCP_SUPPORT.md) doc for more details


## Final Notes
Enjoy and provide feedback / contribute :)

Expand Down
248 changes: 248 additions & 0 deletions docs/MCP_SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
## MCP Server Support
---

> **Disclaimer:** MCP Support requires Mule 9.6+.

MCP Server Structure based on the RAML specification of the Metrics Toolkit API. The focus is on **granularity**, **performance**, and **agent-readiness**, breaking down the heavy endpoints into finer-grained, composable tools for MCP Agents.

Complete MCP Spec can be found here. As a high level summary, MCP tools conform to the [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification).

**NOTE**: The initial implementation of the MCP support will cover the (GET) endpoints of the platform metrics. Benefits and POST endpoints to load data will be added in future.

### Available MCP Server Tools

1. [`getCapabilities`](###getcapabilities)
2. [`getAvailableCollectors`](###getavailablecollectors)
3. [`getPlatformMetricsByCollector`](###getplatformmetricsbycollector)
4. [`getPlatformMetricByKey`](###getplatformmetricbykey)

#### getCapabilities

> **Disclaimer:** This tool may be replaced in future versions by native support for the [Google A2A Protocol](https://github.com/google/a2a/blob/main/spec.md), which standardizes agent capability declarations and execution formats.

| Field | Details |
|------------------------|------------------------------------------------------------------------------------------------------|
| Method | getCapabilities |
| Type | For Agent Discovery Purposes|
| Summary | Returns a machine-readable summary of the metrics toolkit MCP capabilities, including available tools, parameters, and usage hints. |
| Inputs (`params`) | None |
| Output (`result`) | Array of tool metadata objects, each describing one available method and useful info to respond to general FAQ |
| Performance Guidance | Lightweight. Recommended for initialization, Agent planning (ReAct patterns), or UI rendering of available actions.|
| Agent Use Case | Enables dynamic planning and tool discovery at runtime. Useful for self-configuring or ReAct-style agents. |

###### JSON-RPC Request Example

```json
{
"jsonrpc": "2.0",
"id": {uuuid},
"method": "tools/call",
"params": {
"name": "getCapabilities",
"arguments": {
}
}
}
```

###### Response Example

```json
{
"jsonrpc": "2.0",
"result": {
"description": "This capability manifest describes the tools (methods) exposed by this server. Each tool includes a name, description, and an input schema that defines the parameters required to invoke it. Agents can use this manifest to dynamically plan their next actions without hardcoding tool knowledge. The tools listed here follow the JSON-RPC 2.0 specification and must be invoked via POST requests to the MCP endpoint. Agents should first inspect this manifest to determine which tools are available and how to use them, then construct a valid request matching the tool’s input schema.",
"tools": [
{
"name": "getAvailableCollectors",
"description": "Returns all collector identifiers supported by the server.",
"inputSchema": {
"type": "object",
"properties": {}
}
},
{
"name": "getPlatformMetricsByCollector",
"description": "Retrieves metrics from a specific Anypoint collector with optional filters",
"inputSchema": {
"type": "object",
"properties": {
"collectorId": { "type": "string" },
"bg": { "type": "string" },
"filters": {
"type": "object",
"properties": {
"environment": { "type": "string" },
"region": { "type": "string" }
}
}
},
"required": ["collectorId", "bg"]
}
},
{
"name": "getPlatformMetricByKey",
"description": "Fetches a single metric value by key and collector. Useful for atomic, low-latency reads.",
"inputSchema": {
"type": "object",
"properties": {
"collector": { "type": "string" },
"metricKey": { "type": "string" },
"bg": { "type": "string" },
"environment": { "type": "string" }
},
"required": ["collector", "metricKey", "bg"]
}
}
]
},
"id": {uuuid}
}
```

#### getAvailableCollectors

| Field | Details |
|------------------------|------------------------------------------------------------------------------------------------------|
| Method | getAvailableCollectors |
| Type | DiscoveryTool |
| Summary | Lists all available collector IDs used to retrieve platform metrics. |
| Inputs (`params`) | None |
| Output (`result`) | array<string> of collector identifiers |
| Performance Guidance | Lightweight, cacheable, suitable for prefetch or UI support. |
| Agent Use Case | Agent dynamically determines what collector IDs are supported in the org. |

##### JSON-RPC Request Example

```json
POST /mcp
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "getAvailableCollectors",
"arguments": {
}
},
"id": {uuuid},
}
```

##### Response Example

```json
{
"jsonrpc":"2.0",
"id": {uuid},
"result":{
"content":[
{
"type":"text",
"audience":[],
"text": "[\"arm\",\"ch\",\"apma\",\"ex\",\"core\",\"dc\",\"rtf\",\"amq\",\"osv2\"]"
}],
"isError":false
}
}
```

#### getPlatformMetricsByCollector

| Field | Details |
|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| Method | getPlatformMetricsByCollector |
| Type | QueryTool |
| Summary | Retrieves platform metrics for a specific collector. |
| Inputs (`params`) | - `collectorId` (string, required). Any of `getAvailableCollectors`|
| Output (`result`) | JSON result with the collected metrics for the given collector |
| Performance Guidance | Require collectorId. Multiple collectors cannot be used to avoid delayed answers to the calling agent |
| Agent Use Cases | ITops support Agent monitors apps health, licensing Agent to support during renewals |

##### JSON-RPC Request Example

```json
POST /mcp
Content-Type: application/json

{
"jsonrpc": "2.0",
"id": {uuid},
"method": "tools/call",
"params": {
"name": "getPlatformMetricsByCollector",
"arguments": {
"collector": "ch",
"bg": {orgId}
}
}
}
```

##### Response Example

```json
{
"jsonrpc": "2.0",
"id": {uuid},
"result": {
"content": [
{
"type": "text",
"audience": [

],
"text": "[\n {\n \"businessGroup\": \"Fantasy Company\",\n \"businessGroupId\": \"{orgId}\" ... ]"
}
],
"isError": false
}
}
```
#### getPlatformMetricByKey

| Field | Details |
|------------------------|---------------------------------------------------------------------------------------------------|
| Method | getPlatformMetricByKey |
| Type | QueryTool |
| Summary | Fetches a single platform metric value by key. It supports keys containing multiple child keys e.g. networking will return all the networking config for ch collector|
| Inputs (`params`) | `collector` (string, required), `bg` (string, required), metricKey` (string, required)
| Output (`result`) | JSON response with metric value |
| Performance Guidance | Optimized for low-latency, atomic metric retrieval. |
| Agent Use Case | Alerting agent reads one key for rapid decision making. |

##### JSON-RPC Request Example

```json
{
"jsonrpc": "2.0",
"id": {uuid},
"method": "tools/call",
"params": {
"name": "getPlatformMetricsByKey",
"arguments": {
"collector": "ch",
"bg": {orgId},
"metricKey": "networking"
}
}
}
```

##### Response Example

```json
{
"jsonrpc":"2.0",
"id": {uuid},
"result":{
"content":[
{
"type":"text",
"audience":[],
"text": "[{\"businessGroup\": ... "
}],
"isError":false
}
}
```
File renamed without changes.
2 changes: 1 addition & 1 deletion mule-artifact.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"minMuleVersion": "4.6.0",
"minMuleVersion": "4.9.3",
"javaSpecificationVersions": ["17"],
"secureProperties": [
"auth.orgId",
Expand Down
15 changes: 11 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.mulesoft</groupId>
<artifactId>metrics-toolkit</artifactId>
<version>1.10.0</version>
<version>2.0.0</version>
<packaging>mule-application</packaging>

<name>metrics-toolkit</name>
Expand All @@ -13,10 +13,10 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<app.runtime>4.8.0</app.runtime>
<app.runtime>4.9.3</app.runtime>
<mule.maven.plugin.version>4.4.0</mule.maven.plugin.version>
<!-- MUnit Dependencies versions -->
<munit.runtime>4.8.0</munit.runtime>
<munit.runtime>4.9.3</munit.runtime>
<munit.version>3.4.0</munit.version>
<munit-runner.version>3.4.0</munit-runner.version>
<munit-tools.version>3.4.0</munit-tools.version>
Expand All @@ -32,7 +32,8 @@
<mule-mongodb-connector.version>6.3.10</mule-mongodb-connector.version>
<mongodb-driver-legacy.version>4.0.4</mongodb-driver-legacy.version>
<validation-module.version>2.0.7</validation-module.version>
<assertions.version>1.0.2</assertions.version>
<assertions.version>1.0.2</assertions.version>
<mcp.version>1.1.0</mcp.version>
</properties>

<build>
Expand Down Expand Up @@ -194,6 +195,12 @@
<version>${analytics.version}</version>
<classifier>mule-plugin</classifier>
</dependency>
<dependency>
<groupId>com.mulesoft.connector</groupId>
<artifactId>mule-mcp-connector</artifactId>
<version>${mcp.version}</version>
<classifier>mule-plugin</classifier>
</dependency>
</dependencies>

<repositories>
Expand Down
Loading
Loading