ghostfolio
MCP server for Ghostfolio management
claude mcp add --transport stdio mhajder-ghostfolio-mcp python run_server.py \ --env LOG_LEVEL="logging level (e.g., INFO, DEBUG)" \ --env SENTRY_DSN="optional Sentry DSN for error tracking" \ --env MCP_HTTP_HOST="HTTP host bind address" \ --env MCP_HTTP_PORT="HTTP port" \ --env MCP_TRANSPORT="transport type: 'stdio', 'sse', or 'http'" \ --env GHOSTFOLIO_URL="Ghostfolio instance URL (e.g., https://domain.tld:3333)" \ --env READ_ONLY_MODE="true to disable write operations, false otherwise" \ --env GHOSTFOLIO_TOKEN="Ghostfolio API token" \ --env GHOSTFOLIO_TIMEOUT="request timeout in seconds" \ --env RATE_LIMIT_ENABLED="true to enable rate limiting" \ --env GHOSTFOLIO_VERIFY_SSL="true|false" \ --env MCP_HTTP_BEARER_TOKEN="optional HTTP bearer token for auth" \ --env RATE_LIMIT_MAX_REQUESTS="max requests per window" \ --env GHOSTFOLIO_DISABLED_TAGS="comma-separated tool tags to disable" \ --env RATE_LIMIT_WINDOW_MINUTES="window size in minutes"
How to use
This Ghostfolio MCP Server provides a programmable interface to Ghostfolio data, allowing read and write access to portfolios, holdings, transactions, and market data through a modern MCP API. With the available tools, you can retrieve portfolio performance, holdings, dividends, and allocations, as well as manage accounts, import transactions, and monitor orders and balances across accounts. The server also supports security features such as read-only mode, rate limiting, and optional Sentry integration for observability. To get started, configure the required Ghostfolio URL and API token via environment variables, then run the Python-based MCP server. Once running, you can invoke operations like get_portfolio_performance, get_portfolio_holdings, get_accounts, and create_account through the MCP API, and you can enable read-only mode to prevent any write actions during monitoring.
How to install
Prerequisites:
- Python 3.11 or higher
- Access to a Ghostfolio instance
- Ghostfolio API token
Installation steps (recommended):
-
Install the MCP server from this repository or via PyPI:
Using UV (recommended)
uvx ghostfolio-mcp
Or using pip
pip install ghostfolio-mcp
-
Set up environment variables for your Ghostfolio connection. Create or edit a .env file or export variables directly:
export GHOSTFOLIO_URL=https://domain.tld:3333 export GHOSTFOLIO_TOKEN=your-ghostfolio-token export GHOSTFOLIO_VERIFY_SSL=true export GHOSTFOLIO_TIMEOUT=30
Optional: enable read-only mode
export READ_ONLY_MODE=false
Optional: rate limiting and logging
export RATE_LIMIT_ENABLED=false export LOG_LEVEL=INFO
-
Run the server:
Using Python (as configured in this repository)
python run_server.py
Or via installed script (if you installed via PyPI)
ghostfolio-mcp
-
(Optional) Development setup:
Install from source and install dependencies
git clone https://github.com/mhajder/ghostfolio-mcp.git cd ghostfolio-mcp uv sync --group dev
-
Verify the server is running by hitting the MCP endpoints or checking logs. Ensure the Ghostfolio URL and token are valid to avoid authentication errors.
Additional notes
Tips and known considerations:
- If you enable READ_ONLY_MODE, all PUT/POST/DELETE operations are disabled, making it safe for monitoring dashboards.
- Configure MCP_TRANSPORT (stdio, sse, or http) based on your deployment scenario. For local usage, stdio is typical; for streaming HTTP clients, consider sse or http transports.
- Secure your MCP HTTP endpoint if exposed externally by setting MCP_HTTP_BEARER_TOKEN and enabling SSL where applicable.
- Sentry integration is optional. If SENTRY_DSN is not configured, the server runs without error tracking.
- Use the provided environment variables to fine-tune timeouts, SSL verification, and logging to suit production workloads.
- For best results, ensure your Ghostfolio instance is accessible from the MCP server host and that the API token has the necessary permissions for the requested operations.
Related MCP Servers
web-eval-agent
An MCP server that autonomously evaluates web applications.
mcp-neo4j
Neo4j Labs Model Context Protocol servers
Gitingest
mcp server for gitingest
zotero
Model Context Protocol (MCP) server for the Zotero API, in Python
fhir
FHIR MCP Server – helping you expose any FHIR Server or API as a MCP Server.
unitree-go2
The Unitree Go2 MCP Server is a server built on the MCP that enables users to control the Unitree Go2 robot using natural language commands interpreted by a LLM.