# Portfolio CSV Analyzer MCP for AI Agents AI Agent Connect

> Portfolio CSV Analyzer lets you feed huge broker exports into your AI without crashing the session. It reads your DEGIRO, XTB, or Interactive Brokers CSVs locally, extracting only the headers and a few sample rows. This keeps your data private and your AI's memory clear while still letting you analyze thousands of trades.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_UXTNF7rAXxtPhyKSsuqvjd7wl2jy9r8H1MHscdNL/ai-agent-connect
- **Tags:** csv-parsing, data-streaming, financial-data, data-processing, large-file-handling

## Description

You've got a massive CSV export from your broker, but trying to paste it into your AI client is a recipe for a crash. These files are often too big for any AI to handle in one go, leading to hallucinations or context window exceeded errors. This Connector changes that by acting as a local data bridge. Instead of uploading the whole file, it scans the data on your machine and gives your AI a clear map of what's inside. It tells your agent exactly what columns you have, like Purchase Price or Ticker, and shows it a tiny slice of the actual data. You can then ask your agent to write a script to calculate your total gains or filter for specific stocks without ever dumping your entire history into the chat. It's a much cleaner way to handle personal finance data. You can find this and thousands of other tools in the Vinkius marketplace to keep your local data workflows organized.

## Tools

### parse_portfolio_csv
Scans your broker's CSV file locally to extract the schema and a few sample rows. This lets your AI understand your data structure without reading every single row at once.

## Prompt Examples

**Prompt:** 
```
Parse my DEGIRO_export.csv and tell me what data columns I have available to calculate my total dividends.
```

**Response:** 
```
I've analyzed your DEGIRO export. Here are the columns available in your file:

- **Date**: The date of the transaction.
- **Product**: The name of the asset.
- **ISIN**: The unique identifier.
- **Description**: This column contains the labels for your dividends.
- **Amount**: The numerical value of the transaction.

You can use the **Description** column to filter for "Dividend" and the **Amount** column to sum the total.
```

**Prompt:** 
```
Look at the schema of this broker export and write a Python script for me that sums up all my buy orders.
```

**Response:** 
```
Based on the schema I retrieved from your file, here is a Python script using the `pandas` library to sum your buy orders:

```python
import pandas as pd
df = pd.read_csv('your_file.csv')
# Filtering for 'Buy' actions and summing the 'Value' column
total_buy = df[df['Action'] == 'Buy']['Value'].sum()
print(f"Total Buy Amount: {total_buy}")
```

This targets the **Action** and **Value** columns found in your export.
```

**Prompt:** 
```
How many total rows are in this trading history CSV?
```

**Response:** 
```
I've finished scanning your trading history file. It contains exactly **4,521 rows** of transaction data.
```

## Capabilities

### Scan massive CSV files
Process large broker exports without using up your AI's memory or context window.

### Extract column headers
Automatically identify the structure of any broker's CSV export format.

### Get sample data rows
Provide your AI with a small slice of real data to help it understand the content.

### Identify data types
Detect dates, currency, and text types automatically during the local scan.

### Keep history local
Keep your full trading history on your machine instead of uploading it to the cloud.

## Use Cases

### Calculating Dividends
A trader wants to know their total yearly dividends from a DEGIRO export. They ask the agent to find the Amount column and sum it up.

### Tax Preparation
A user needs to extract all Buy actions from an XTB history to calculate their cost basis for the year.

### Performance Review
A user wants to see which stocks they've held the longest. The agent looks at the Date and Product columns to generate a summary.

### Cross-Broker Audit
A user has files from two different brokers and wants to see the total balance. The agent compares the schemas of both files.

## Benefits

- Stop your AI from crashing when you try to analyze large trading files using parse_portfolio_csv.
- Keep your private financial data on your machine instead of uploading it to the cloud.
- Get accurate P&L calculations by letting your agent see the correct column names first.
- Handle files with thousands of rows instantly using local streaming.
- Save time on data cleaning by letting the Connector automatically detect your broker's format.

## How It Works

The bottom line is you get a structured data map for your AI to use without crashing the chat.

1. Provide the local file path to your broker's CSV export.
2. The Connector streams the file locally to identify the headers and data types.
3. You get a summary of the columns and a small sample of the data.

## Frequently Asked Questions

**Can Portfolio CSV Analyzer handle files with thousands of rows?**
Yes, it's built specifically for large files. It uses a streaming parser to read your data locally, so it won't crash your AI client or your computer's memory even with massive broker exports.

**Is my financial data safe with Portfolio CSV Analyzer?**
Your data stays on your machine. The Connector processes the file locally and only sends the column headers and a small sample to your AI client, keeping your full history private.

**What brokers does Portfolio CSV Analyzer work with?**
It works with any CSV export from a broker, including DEGIRO, XTB, Trading212, and Interactive Brokers. As long as it's a standard CSV format, the Connector can parse it.

**Does Portfolio CSV Analyzer replace my spreadsheet?**
It's a companion to your spreadsheet. It helps you quickly understand your data structure so your AI can write scripts or perform complex math that would take a long time to do manually in a sheet.

**How does Portfolio CSV Analyzer prevent AI hallucinations?**
By providing the AI with a clear schema (the exact names of your columns) and a few sample rows, it removes the guesswork. The AI knows exactly which column to use for "Price" or "Quantity," leading to much more accurate results.

**Can I use Portfolio CSV Analyzer to see my total profit?**
Yes, that's a primary use case. Once the Connector identifies your "Profit," "Amount," or "Value" columns, you can ask your AI to write a script to calculate your total gains across all trades.

**Will it send my entire trading history to the AI?**
No! To protect your privacy and prevent context crashes, it only sends the column headers (the schema), the total row count, and a tiny 20-row sample to the AI.

**What brokers does this work with?**
It works with ANY standard CSV file. Whether it's from DEGIRO, Interactive Brokers, Robinhood, or Trading212, this engine will parse the schema dynamically.

**Can it calculate live market P&L?**
This specific tool focuses purely on parsing the historical CSV data local. For live market prices, a separate API MCP (like Yahoo Finance) would be needed.