# Stock Average Price Tracker AI Agent Connect

> Stock Average Price Tracker MCP lets your AI client manage and calculate the weighted average cost basis of your stock holdings. You can record new purchases, pull full transaction histories, and verify that your recorded data matches your calculated averages. It works directly with Claude, Cursor, Windsurf, and VS Code.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_JhIliby4Kvj2FO1m6kFcZ7QwqkdMSi2PJDJ5kSJA/ai-agent-connect
- **Tags:** stocks, finance, portfolio, average-price, investment

## Description

Managing a stock portfolio means keeping a constant eye on your cost basis. This MCP handles the math for you by tracking every purchase and calculating the weighted average price of your holdings. Instead of manually updating spreadsheets, you just tell your AI client when you've bought more shares, and it updates your records immediately. 

You can ask your agent to pull a full history of your buys for a specific ticker or check your current average price to see if you're sitting on a gain or a loss. If you're worried about data entry errors, the MCP can run a check to ensure your transaction logs actually align with your current averages. It's a straightforward way to keep your investment data clean and ready for analysis within your preferred coding or chat environment.

## Tools

### add_purchase
Records a new stock purchase and automatically updates your weighted average price.

### get_average_price
Retrieves the current weighted average price for your total holdings of a specific stock.

### get_transaction_history
Fetches a complete list of all individual purchase events for a specific stock.

### validate_portfolio_integrity
Checks that your recorded transaction history is consistent with your calculated average prices.

## Prompt Examples

**Prompt:** 
```
What is my current average price for AAPL?
```

**Response:** 
```
The current weighted average price for AAPL is $150.25 with a total of 50 shares held.
```

**Prompt:** 
```
I just bought 10 shares of MSFT at $300.00 today.
```

**Response:** 
```
Successfully added the purchase. Your new average price for MSFT is $300.00.
```

**Prompt:** 
```
Show me all my transactions for TSLA.
```

**Response:** 
```
You have three transactions for TSLA: 5 shares at $200.00 on 2023-01-10, 10 shares at $210.00 on 2023-02-15, and 2 shares at $220.00 on 2023-03-01.
```

## Capabilities

### Cost Basis Calculation
Your agent calculates weighted averages every time you add a new buy.

### Transaction Logging
The MCP stores every purchase event for your specific stock tickers.

### Data Validation
Your AI client can verify that your transaction history matches your current averages.

### Portfolio Auditing
You can pull full histories to review your buying patterns over time.

## Use Cases

### Real-time Purchase Updates
Tell your agent you bought shares, and it immediately updates your average price.

### Portfolio Auditing
Use the validation tool to make sure your transaction logs haven't drifted from your averages.

### Investment Analysis
Ask your agent for your total cost basis to decide whether to sell a position.

### Transaction Review
Request a full history of a specific ticker to see your entry points over time.

## Benefits

- Automates the math for weighted average cost basis.
- Maintains a clean history of all stock purchases.
- Detects inconsistencies between transactions and averages.
- Works inside your existing AI-powered development or chat tools.

## How It Works

Connect the MCP to your client and start talking to your data.

1. Connect the MCP to Claude, Cursor, or another compatible client via Vinkius.
2. Tell your agent about a new stock purchase.
3. The MCP records the transaction and recalculates the average price.
4. Ask your agent for history or validation checks whenever needed.

## Frequently Asked Questions

**How do I add a new stock purchase?**
You simply tell your AI client that you bought a certain amount of a stock at a specific price, and it uses the add_purchase tool to record it.

**Which AI clients can I use with this MCP?**
You can use this MCP with Claude Desktop, Cursor, Windsurf, VS Code, or any other MCP-compatible client.

**Can this MCP check for errors in my data?**
Yes, the validate_portfolio_integrity tool checks if your recorded transactions are consistent with your calculated averages.

**Does this track my sales?**
The current tools focus on recording purchases and calculating the weighted average cost basis for your holdings.

**Where is my data stored?**
Vinkius hosts and manages the MCP, ensuring your tools are ready to use whenever you connect your client.
