# Portfolio Rebalance Planner AI Agent Connect

> Portfolio Rebalance Planner MCP acts as a math engine for your investment strategy. It calculates the specific buy and sell orders needed to fix portfolio drift, manages cash optimization, and lets you simulate new target weights before you commit to a single trade.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_wzE5yKcg39qUPX6cptBGBD4m9mviId0upjXHakzx/ai-agent-connect
- **Tags:** rebalancing, portfolio, trading, allocation, finance-tools

## Description

Managing a portfolio means constantly fighting drift. When one asset grows too large, it throws your risk profile out of whack. This MCP handles the heavy lifting of the math required to get you back to your target. Instead of guessing how much to sell or buy, you give your AI client your current holdings and your desired percentages. It then generates a specific list of instructions to bring everything back into alignment while accounting for your available cash. You can check if your current drift is too high, run through hypothetical scenarios to see how new targets would look, and get a clear plan for your next set of trades. It turns messy asset distributions into a clean, actionable execution list.

## Tools

### calculate_rebalance_plan
This tool generates a specific list of buy and sell orders to hit your target percentages.

### get_current_allocation
Use this to see how your current asset distribution compares to your intended targets.

### simulate_what_if_allocation
This tool lets you project how changing your target weights will affect your portfolio.

### validate_portfolio_health
This tool checks if your current asset drift has exceeded your set limits.

## Prompt Examples

**Prompt:** 
```
Calculate a rebalance plan for my holdings: [{assetId: 'BTC', quantity: 0.5}, {assetId: 'USD', quantity: 1000}] with prices: [{assetId: 'BTC', price: 50000}, {assetId: 'USD', price: 1}] and targets: [{assetId: 'BTC', targetPercentage: 80}, {assetId: 'USD', targetPercentage: 20}].
```

**Response:** 
```
To reach your target allocation, you should sell 0.02 BTC and buy 0.01 BTC. Your residual cash will be $100 and your final allocation will be 80% BTC and 20% USD.
```

**Prompt:** 
```
Is my portfolio healthy? Holdings: [{assetId: 'AAPL', quantity: 10}] Prices: [{assetId: 'AAPL', price: 150}] Targets: [{assetId: 'AAPL', targetPercentage: 100}].
```

**Response:** 
```
Your portfolio is healthy with a total drift of 0% and no misaligned assets.
```

**Prompt:** 
```
What is my current allocation? Holdings: [{assetId: 'ETH', quantity: 10}] Prices: [{assetId: 'ETH', price: 2000}] Targets: [{assetId: 'ETH', targetPercentage: 100}] Cash: 500.
```

**Response:** 
```
Your current ETH allocation is 97.5% with a target of 100%, resulting in a drift of 2.5%.
```

## Capabilities

### Drift Analysis
Your agent uses this to identify how far your current assets have strayed from your targets.

### Trade Instruction Generation
The AI creates exact buy and sell amounts to fix your portfolio weightings.

### Risk Assessment
Your agent checks if your current asset distribution is within safe limits.

### Scenario Modeling
The AI simulates the results of changing your target allocations before you trade.

### Cash Optimization
The math engine accounts for available cash when calculating rebalance orders.

## Use Cases

### Correcting Portfolio Drift
When a specific asset grows too large, use the MCP to find the exact sell amount needed to return to your target.

### Testing New Strategies
Simulate how a shift from aggressive to conservative weights would look based on your current holdings.

### Risk Monitoring
Regularly check if your portfolio's deviation from its target is within acceptable bounds.

### Cash Management
Calculate rebalance plans that use existing cash to buy underweight assets.

## Benefits

- Eliminates manual calculation errors in trade sizing.
- Provides a way to test new allocation strategies without risk.
- Maintains strict adherence to target risk profiles.
- Optimizes the use of available cash during rebalancing.

## How It Works

Connecting this MCP to your AI client gives your agent immediate access to portfolio math tools.

1. Connect the MCP to your client like Claude or Cursor via Vinkius.
2. Provide your current asset quantities and prices to your agent.
3. Define your target percentage allocations.
4. Ask your agent to calculate a rebalance plan or simulate a change.
5. Receive a precise list of buy and sell orders.

## Frequently Asked Questions

**What does this MCP actually do?**
It performs the mathematical calculations needed to rebalance an investment portfolio. It tells you exactly how much of an asset to buy or sell to match your target percentages.

**Can I use this with Claude or Cursor?**
Yes. You can connect this MCP to any compatible client including Claude, Cursor, Windsurf, and VS Code.

**Does it execute trades for me?**
No. This MCP generates the mathematical instructions for trades. You must use those instructions in your own trading platform or execution tool.

**How does it handle cash?**
The calculation engine optimizes for available cash to ensure your rebalance plan is realistic based on your liquidity.

**Can I test new target weights?**
Yes. You can use the simulation tool to see how changing your target allocations would impact your portfolio before you make any moves.

**How does the rebalancing plan handle available cash?**
The engine prioritizes selling assets to generate liquidity first, then uses available cash to fulfill buy orders. If cash is insufficient, buy orders are scaled to respect liquidity constraints.

**Can I simulate changes before executing trades?**
Yes, you can use the `simulate_what_if_allocation` tool to project the theoretical outcome of new target percentages without executing actual trades.

**What defines a 'healthy' portfolio in this tool?**
A portfolio is considered healthy if the maximum drift for any single asset remains below the system's defined sensitivity threshold, as determined by `validate_portfolio_health`.
