# Portfolio Concentration Calculator MCP

> Portfolio Concentration Calculator measures investment risk using the Herfindahl-Hirschman Index (HHI). It instantly computes concentration metrics across your assets, sectors, and geographies. If you need to know where your portfolio is over-weighted—and what to do about it—this MCP gives you precise, actionable analysis.

## Overview
- **Category:** finance
- **Price:** Free
- **Tags:** hhi, portfolio, diversification, investment, risk

## Description

Running a complex investment portfolio means managing more than just asset allocation; you're managing risk. This connection provides an engine to calculate the Herfindahl-Hirschman Index (HHI), which pinpoints exactly where your holdings are too concentrated. You can check concentration metrics by breaking down risks across three dimensions: the specific assets you own, the sectors they belong to, and the geographic regions. It's not enough to know *that* a risk exists; you need to know how bad it is and what to do next. The MCP also validates your input data first, ensuring any calculations are mathematically sound before generating results. If you connect this through Vinkius, your AI client can handle the entire process—from initial data check to providing concrete rebalancing advice based on industry best practices.

## Tools

### calculate_concentration_metrics
Computes the Herfindahl-Hirschman Index (HHI) and other metrics to measure portfolio risk by asset, sector, and geography.

### get_diversification_recommendation
Provides specific advice on how to rebalance a portfolio when one or more dimensions show signs of high concentration.

### validate_portfolio_data
Checks your input data set for mathematical soundness, catching issues like negative weights before calculations run.

## Prompt Examples

**Prompt:** 
```
Calculate the concentration metrics for a portfolio with 50% Apple (Tech, USA), 30% Microsoft (Tech, USA), and 20% Tesla (Auto, USA).
```

**Response:** 
```
The analysis shows a high concentration in the Technology sector (HHI: 0.34) and the USA geography (HHI: 1.0). The Sector rating is 'Concentrated'.
```

**Prompt:** 
```
What should I do to diversify my portfolio if my sector concentration is too high?
```

**Response:** 
```
To reduce risk, you should redistribute weight from your most concentrated sectors into underrepresented industries like Healthcare or Energy.
```

**Prompt:** 
```
Check if my portfolio data is valid: [{'weight': 0.5, 'sector': 'Tech', 'geography': 'USA'}, {'weight': -0.1, 'sector': 'Energy', 'geography': 'UK'}]
```

**Response:** 
```
The validation failed because the asset with weight -0.1 has an invalid negative value.
```

## Capabilities

### Identify Concentration Risk
Calculates the Herfindahl-Hirschman Index (HHI) across your portfolio's holdings, sector breakdown, and geographic spread.

### Validate Input Data Integrity
Checks your raw investment data to ensure all weights are mathematically valid before running complex metrics.

### Receive Rebalancing Advice
Generates specific, actionable recommendations on how and where to rebalance highly concentrated areas of the portfolio.

## Use Cases

### Client Portfolio Review
A financial analyst needs to review a client's portfolio quarterly. They run the MCP using `calculate_concentration_metrics` and discover the HHI for the Energy sector is too high. The agent then uses `get_diversification_recommendation` to suggest reducing exposure in that sector and increasing weight in underrepresented industries like Healthcare.

### Stress-Testing a New Strategy
A portfolio manager builds a theoretical strategy using highly weighted tech stocks. They use the MCP to calculate concentration metrics, which immediately flag an excessive Tech sector HHI score. This prevents them from submitting a high-risk plan that might fail in a downturn.

### Cleaning Up Bad Data
A junior analyst copies portfolio data and includes one record with a negative weight. Before running the main analysis, they run `validate_portfolio_data` and get an immediate error message pointing out the invalid entry, saving hours of failed calculations.

### Understanding Geographic Drift
An investment advisor notices their client’s portfolio has drifted heavily toward US-based assets. They use `calculate_concentration_metrics` to confirm a high geographic HHI for the USA, and then use the recommendation tool to suggest diversifying into international markets.

## Benefits

- Instantly quantify structural risk. Instead of guessing where a portfolio is weak, the `calculate_concentration_metrics` tool delivers the HHI score for assets, sectors, and geographies, telling you exactly how concentrated your holdings are.
- Ensure data accuracy first. Before running any complex analysis, use `validate_portfolio_data`. This prevents calculation failures by catching invalid inputs like negative weights or missing sector assignments.
- Get actionable next steps. If the metrics show a problem, don't just look at the number. The MCP uses `get_diversification_recommendation` to advise on specific weight shifts needed for rebalancing.
- Compare risk dimensions easily. You can run calculations and immediately see if your portfolio is more heavily concentrated in one sector (e.g., Tech) or one geography (e.g., USA), giving you a holistic view of exposure.
- Save hours on due diligence. Your agent handles the entire sequence: data validation, metric calculation, and recommendation generation—all without you needing to manage multiple spreadsheets.

## How It Works

The bottom line is your agent takes raw investment data and converts it into clear, measurable risk scores and an immediate action plan.

1. First, you provide your raw investment data (weights, sectors, geographies) to validate it using the MCP's built-in checks.
2. Next, the system calculates concentration metrics across asset, sector, and geography dimensions, returning specific HHI values for each area of concern.
3. Finally, the MCP uses those high-risk readings to generate a tailored recommendation, telling you where to shift capital to reduce overall risk.

## Frequently Asked Questions

**How does the Portfolio Concentration Calculator MCP work with raw data?**
It first uses `validate_portfolio_data` to check weights and sector assignments, ensuring all inputs are mathematically clean before calculating any risk metrics.

**What is HHI, and what does the Portfolio Concentration Calculator MCP tell me about it?**
HHI (Herfindahl-Hirschman Index) measures market concentration. A higher score means a smaller number of assets or sectors make up a larger percentage of your total portfolio weight.

**Can I use the Portfolio Concentration Calculator MCP if my data is incomplete?**
No. The tool requires complete, valid data for all dimensions (asset, sector, geography). Always check inputs using `validate_portfolio_data` first.

**Does the Portfolio Concentration Calculator MCP just tell me I'm risky?**
Not at all. After calculating metrics with `calculate_concentration_metrics`, you run `get_diversification_recommendation`. This provides specific, actionable advice on where to reallocate capital.

**Is the Portfolio Concentration Calculator MCP better than standard risk reports?**
Yes. Standard reports often give a single overall score. This MCP breaks down that risk into three separate dimensions (asset, sector, and geography), allowing you to target precise areas of weakness.