Minimum Spanning Tree Calculator

Minimum Spanning Tree Calculator MCP Connector for Claude

A+

Calculate Minimum and Maximum Spanning Trees using Kruskal's and Prim's algorithms.

3 tools Official Updated Oct 1, 2026 Official Vinkius Partner

This MCP server provides algorithmic tools to find the Minimum Spanning Tree (MST) and Maximum Spanning Tree of a graph. Using compute_kruskal_mst, you can identify the lowest-weight edges that connect all nodes without cycles, which is ideal for network design. The compute_prim_mst tool allows you to grow a tree from a specific starting node by always selecting the cheapest available connection. For scenarios where you need to maximize connectivity weight, use compute_max_spanning_tree. All tools accept an edge list format and can identify if the resulting structure is a single tree or a spanning forest.

mstkruskalprimgraphalgorithm

3 tools expose this connector's capabilities to your AI agent.

compute_kruskal_mst

Calculates the Minimum Spanning Tree using Kruskal's algorithm

compute_max_spanning_tree

Calculates the Maximum Spanning Tree

compute_prim_mst

Calculintates the Minimum Spanning Tree using Prim's algorithm

See how to talk to your AI agent using Minimum Spanning Tree Calculator.

Find the MST for a graph with edges: [{'source': 'A', 'target': 'B', 'weight': 4}, {'source': 'B', 'target': 'C', 'weight': 1}, {'source': 'A', 'target': 'C', 'weight': 3}]

The Minimum Spanning Tree edges are: [{'source': 'B', 'target': 'C', 'weight': 1}, {'source': 'A', 'target': 'C', 'weight': 3}]. Total weight is 4.

Calculate the Maximum Spanning Tree for edges: [{'source': 'Node1', 'target': 'Node2', 'weight': 10}, {'source': 'Node2', 'target': 'Node3', 'weight': 5}, {'source': 'Node1', 'target': 'Node3', 'weight': 2}]

The Maximum Spanning Tree edges are: [{'source': 'Node1', 'target': 'Node2', 'weight': 10}, {'source': 'Node2', 'target': 'Node3', 'weight': 5}]. Total weight is 15.

Using Prim's algorithm, find the MST starting from node 'A' for edges: [{'source': 'A', 'target': 'B', 'weight': 2}, {'source': 'B', 'target': 'C', 'weight': 3}, {'source': 'A', 'target': 'C', 'weight': 5}]

The Minimum Spanning Tree edges are: [{'source': 'A', 'target': 'B', 'weight': 2}, {'source': 'B', 'target': 'C', 'weight': 3}]. Total weight is 5.

Kruskal's algorithm sorts all edges by weight and adds them if they don't form a cycle, making it efficient for sparse graphs. Prim's algorithm starts from a specific node and expands the tree by picking the cheapest edge connected to the current tree.

Related Connectors