Sharesight MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with access to the Sharesight portfolio tracking platform via the v3 API.
Overview
This MCP server enables Claude and other AI assistants to interact with Sharesight accounts, allowing natural language queries and operations on investment portfolios, holdings, custom investments, and performance reports.
What is Sharesight?
Sharesight is a portfolio tracking platform that helps investors track their stocks, ETFs, mutual funds, and other investments across multiple markets. It provides performance reporting, dividend tracking, and tax reporting features.
What is MCP?
The Model Context Protocol is an open standard that enables AI assistants to securely connect to external data sources and tools.
Features
This server exposes 27 tools covering all Sharesight v3 API endpoints:
Portfolio Management
Tool | Description |
| List all user portfolios with optional consolidated view |
| Get detailed portfolio information by ID |
| List all holdings within a specific portfolio |
| Get user display preferences for a portfolio |
| Update chart type, grouping, and other display settings |
Holdings Management
Tool | Description |
| List all holdings across all portfolios |
| Get holding details with optional cost base and historical values |
| Update holding settings (DRP configuration) |
| Remove a holding from a portfolio |
Custom Investments
Tool | Description |
| List custom/unlisted investments |
| Get custom investment details |
| Create a new custom investment (property, bonds, etc.) |
| Update custom investment properties |
| Remove a custom investment |
Custom Investment Prices
Tool | Description |
| Get price history for a custom investment |
| Add a new price entry |
| Modify an existing price entry |
| Remove a price entry |
Coupon Rates (Fixed Interest)
Tool | Description |
| List interest rates for fixed interest investments |
| Add a new coupon rate |
| Modify a coupon rate |
| Remove a coupon rate |
Performance Reports
Tool | Description |
| Detailed performance breakdown with gains analysis |
| Chart data for visualizing portfolio performance |
Other
Tool | Description |
| Get Sharesight-supported countries and their settings |
| View applied promotional coupon code |
| Apply a promotional coupon code |
| Remove applied coupon code |
| Disconnect API access (invalidates all tokens) |
Prerequisites
Node.js 18+ - Required runtime
Sharesight Account - With API access enabled
OAuth2 Credentials - Client ID and Secret from Sharesight
Installation
Option 1: Use via npx (Recommended)
No installation required! Configure your MCP client to run directly via npx:
Option 2: Global Install
Then configure with:
Option 3: From Source
Authentication
This server supports two authentication methods:
Method 1: OAuth with Client Credentials (Recommended)
Provide your Sharesight OAuth client credentials. The server handles token refresh automatically after initial setup:
Register your application with Sharesight to get
client_idandclient_secretRun the one-time authentication setup (see below)
Configure the MCP server with your credentials
Subsequent runs: Tokens are stored in
~/.sharesight-mcp/tokens.jsonand refreshed automatically
Method 2: Static Access Token (Legacy)
If you already have an access token, you can use it directly:
Note: You'll need to manually refresh this token when it expires.
Configuration
Claude Desktop Configuration
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
If you installed from source, use the absolute path instead:
One-Time Authentication Setup
Before using the MCP server, you need to complete a one-time OAuth authentication. This must be done in a terminal (not through Claude) since it requires interactive input.
Using npx (Recommended):
The CLI will prompt you for your Client ID and Client Secret.
If installed from source:
The authentication flow will:
Prompt for Client ID and Client Secret (if not in environment)
Display a URL to open in your browser
Ask you to log in and authorize the application
Prompt you to paste the authorization code
Save tokens to
~/.sharesight-mcp/tokens.json
After successful authentication, tokens are saved and you won't need to authorize again unless they're revoked or you delete the tokens file.
Token Storage
OAuth tokens are stored at:
Linux/macOS:
~/.sharesight-mcp/tokens.jsonWindows:
%USERPROFILE%\.sharesight-mcp\tokens.json
To re-authorize, delete this file and restart the server.
Usage Examples
Once configured, you can interact with Sharesight using natural language:
Portfolio Queries
"Show me all my portfolios"
"What holdings do I have in my retirement portfolio?"
"Get the details for portfolio ID 12345"
Performance Analysis
"What's my portfolio performance for 2024?"
"Show me a performance report from January to June grouped by market"
"Compare my portfolio against the S&P 500 (SPY.NYSE)"
Holdings Management
"List all my holdings"
"What's the cost base for my Apple shares?"
"Enable dividend reinvestment for holding 67890"
Custom Investments
"Create a custom investment for my property at 123 Main St"
"Add a price of $500,000 for my property investment dated today"
"List all my custom investments"
Reports
"What are my total gains this financial year?"
"Break down my performance by country"
"Show me the performance chart data for the last 12 months"
Project Structure
Development
Adding New Tools
Add the endpoint method to
src/sharesight-client.tsAdd types to
src/types.tsif neededAdd the tool definition in
src/index.ts(in thetoolsarray)Add the case handler in the
CallToolRequestSchemahandler
API Reference
This server implements the Sharesight v3 API. Key concepts:
Date Formats
All dates use YYYY-MM-DD format in the portfolio's timezone.
Pagination
List endpoints support cursor-based pagination:
page: Cursor from previous responseper_page: Items per page (default: 50, max: 100)
Grouping Options
Performance reports support grouping by:
market- Stock exchangecountry- Country of listingcurrency- Trading currencyinvestment_type- Type of investmentindustry_classification- FactSet industrysector_classification- FactSet sectorportfolio- Individual portfolio (for consolidated views)custom_group- User-defined groupsungrouped- No grouping
Investment Types
Custom investments support these types:
ORDINARY- Ordinary sharesWARRANT- WarrantsSHAREFUND- Share fundsPROPFUND- Property fundsPREFERENCE- Preference sharesSTAPLEDSEC- Stapled securitiesOPTIONS- OptionsRIGHTS- RightsMANAGED_FUND- Managed fundsFIXED_INTEREST- Fixed interest (bonds, term deposits)PIE- Portfolio Investment Entity
Error Handling
The server returns errors in this format:
Common errors:
401 - Invalid or expired access token
403 - Token revoked or insufficient permissions
404 - Resource not found
422 - Validation error (check field values)
Security Notes
Never commit credentials (client secrets, access tokens) to version control
Use environment variables for sensitive configuration
Token storage: Tokens are stored in
~/.sharesight-mcp/tokens.json- ensure this location is securedAutomatic refresh: When using OAuth credentials, tokens are refreshed automatically
Revoke access: Use the
revoke_api_accesstool or delete~/.sharesight-mcp/tokens.jsonto disconnect
License
MIT
Support
Sharesight Support: support@sharesight.com
API Documentation: https://api.sharesight.com/doc/api/v3
MCP Protocol: https://modelcontextprotocol.io/
This server cannot be installed