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_funds

Fund Details

Get comprehensive fund profiles: AUM, inception date, manager, asset class, currency, and top holdings — all from a single query.

get_fund_details

Holdings Analysis

Drill into fund portfolios. See individual positions with CUSIP/ISIN, dollar value, percentage weight, and sector classification.

get_holdings

Macro Intelligence

Access GDP, inflation, unemployment, interest rates, and trade balance data from FRED, World Bank, and IMF — correlated with fund performance.

get_macro_data

Fund 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_funds

Country 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_overview

Quick 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

TierRequests / minRequests / day
Free10500
Pro6010,000
Enterprise500Unlimited

Rate limit headers are included in every response: X-RateLimit-Limit, X-RateLimit-Remaining.

Key Endpoints

ToolDescriptionExample
search_fundsSearch 639K+ funds by name, ticker, or ISINsearch_funds("Vanguard S&P 500")
get_fund_detailsFull fund profile: AUM, NAV, fees, holdingsget_fund_details(fund_id)
get_macro_indicatorsCountry macro data (CPI, GDP, rates)get_macro_indicators("USA", "CPI")
get_performanceHistorical returns, Sharpe ratio, drawdownget_performance(fund_id, "1y")
compare_fundsSide-by-side fund comparisoncompare_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

Search funds by name, ticker, CIK, ISIN, or StanShare Fund ID
query: string (required)  |  limit: int (1-50)  |  country: string  |  fund_type: string

get_fund_details

Get comprehensive fund profile with holdings
fund_id: string (required) — numeric ID, CIK, or StanShare ID

get_holdings

Get fund portfolio positions with values and identifiers
fund_id: string (required)  |  limit: int (1-100)  |  sector: string

get_macro_data

Query macroeconomic indicators (FRED, World Bank, IMF)
indicator: string  |  country: string  |  years: int

compare_funds

Side-by-side comparison of 2-4 funds
fund_ids: list[string] (required) — 2-4 identifiers

get_country_overview

Country fund market summary with managers and macro data
country: string — 3-letter country code
Read-Only Access
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.