MCP Integration
Connect Claude, GPT, or any MCP-compatible AI assistant directly to StanShare's fund intelligence database. Query 600K+ funds, holdings, and macroeconomic data through natural language.
Fund Search
Search across 600,000+ global funds by name, ticker, CIK, ISIN, or StanShare ID. Filter by country, fund type, and asset class.
search_fundsFund Details
Get comprehensive fund profiles: AUM, inception date, manager, asset class, currency, and top holdings — all from a single query.
get_fund_detailsHoldings Analysis
Drill into fund portfolios. See individual positions with CUSIP/ISIN, dollar value, percentage weight, and sector classification.
get_holdingsMacro Intelligence
Access GDP, inflation, unemployment, interest rates, and trade balance data from FRED, World Bank, and IMF — correlated with fund performance.
get_macro_dataFund Comparison
Compare 2-4 funds side-by-side: AUM, fees, holdings count, inception, manager, and more. Works across all fund types including REITs and CITs.
compare_fundsCountry Overview
Get a complete snapshot of any country's fund market: total funds, AUM, top managers, fund type distribution, and latest macro indicators.
get_country_overviewQuick Start
Connect to StanShareAI in seconds:
import anthropic
client = anthropic.Anthropic()
# Connect to StanShareAI MCP server
result = client.beta.messages.create(
model="claude-opus-4-6",
max_tokens=1024,
tools=[{"type": "mcp", "server_url": "https://www.stanshare.com/mcp"}],
messages=[{"role": "user", "content": "What are the top 5 Vanguard ETFs by AUM?"}]
)
print(result.content)
Authentication
Include your API key in the request header:
X-StanShare-Key: YOUR_API_KEY
API keys are available to Pro subscribers. Contact Us for Pro Access
Keys are prefixed with sk-stanshare-. Get your key from your dashboard after signing in.
Rate Limits
| Tier | Requests / min | Requests / day |
|---|---|---|
| Free | 10 | 500 |
| Pro | 60 | 10,000 |
| Enterprise | 500 | Unlimited |
Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining.
Key Endpoints
| Tool | Description | Example |
|---|---|---|
search_funds | Search 639K+ funds by name, ticker, or ISIN | search_funds("Vanguard S&P 500") |
get_fund_details | Full fund profile: AUM, NAV, fees, holdings | get_fund_details(fund_id) |
get_macro_indicators | Country macro data (CPI, GDP, rates) | get_macro_indicators("USA", "CPI") |
get_performance | Historical returns, Sharpe ratio, drawdown | get_performance(fund_id, "1y") |
compare_funds | Side-by-side fund comparison | compare_funds([id1, id2]) |
Setup Guide
1 Install Dependencies
Ensure you have Python 3.10+ and the MCP SDK installed:
pip install mcp psycopg[binary]
2 Set Database Credentials
Set your StanShare database connection as an environment variable:
export DATABASE_URL="postgresql://user:pass@host:5432/dbname"
3 Configure Claude Desktop
Add the StanShare MCP server to your Claude Desktop config file:
{
"mcpServers": {
"stanshare": {
"command": "python",
"args": ["path/to/mcp_server.py"],
"env": {
"DATABASE_URL": "postgresql://user:pass@host:5432/dbname"
}
}
}
}
Config file location: ~/.claude/claude_desktop_config.json (Mac/Linux)
4 Start Querying
Restart Claude Desktop and start asking questions about funds. Examples:
"Search for Vanguard equity funds with AUM over $10B" "Compare VTSMX and SPY side by side" "What are the top holdings of BlackRock's largest ETF?" "Show me GDP growth vs fund AUM correlation for India" "Give me a country overview for Japan's fund market"
Tool Reference
search_funds
get_fund_details
get_holdings
get_macro_data
compare_funds
get_country_overview
The MCP server provides read-only access to the StanShare database. No data can be modified, deleted, or inserted through MCP tools. Your database credentials are never transmitted to Anthropic or any third party — they remain local on your machine.