Ghostfolio MCP — Claude Code MCP server: install
Connects an AI agent to Ghostfolio for portfolio analysis, market data, and investment account operations.
claude mcp add --env GHOSTFOLIO_URL=<GHOSTFOLIO_URL> --env GHOSTFOLIO_TOKEN=<GHOSTFOLIO_TOKEN> --env GHOSTFOLIO_VERIFY_SSL=<GHOSTFOLIO_VERIFY_SSL> --env GHOSTFOLIO_TIMEOUT=<GHOSTFOLIO_TIMEOUT> --env READ_ONLY_MODE=<READ_ONLY_MODE> --transport stdio ghostfolio-mcp -- uvx ghostfolio-mcpWhat Ghostfolio MCP does
Ghostfolio MCP gives an AI agent an MCP connection to a Ghostfolio instance. It can inspect holdings, positions, returns, dividends, allocations, and historical prices. The server also exposes symbol lookup plus account balances, orders, and transaction data.
This Python server supports both read and write actions. Set GHOSTFOLIO_URL and GHOSTFOLIO_TOKEN for the connection, then use READ_ONLY_MODE to block changes. SSL checks, request timeouts, rate limits, and tool filtering can be configured through environment variables.
The setup needs Python 3.11 to 3.15, access to Ghostfolio, and a valid Ghostfolio API token. Without that token, the server cannot connect to Ghostfolio.
What it helps with
- inspect portfolio holdings and returns
- retrieve dividends and asset allocations
- track orders, transactions, and balances
- look up stocks, ETFs, and financial symbols
- import transactions from another platform
Example prompts for the agent
- Review my Ghostfolio portfolio performance for the selected period.
- Show dividends, asset allocation, and the benchmark comparison.
- Create a transaction in Ghostfolio and verify the result.
How to install Ghostfolio MCP
Platform CLI
claude mcp add --env GHOSTFOLIO_URL=<GHOSTFOLIO_URL> --env GHOSTFOLIO_TOKEN=<GHOSTFOLIO_TOKEN> --env GHOSTFOLIO_VERIFY_SSL=<GHOSTFOLIO_VERIFY_SSL> --env GHOSTFOLIO_TIMEOUT=<GHOSTFOLIO_TIMEOUT> --env READ_ONLY_MODE=<READ_ONLY_MODE> --transport stdio ghostfolio-mcp -- uvx ghostfolio-mcpReplace <…> with your own values. 10 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from ghostfolio-mcp <command>
Platform CLI
codex mcp add ghostfolio-mcp --env GHOSTFOLIO_URL=<GHOSTFOLIO_URL> --env GHOSTFOLIO_TOKEN=<GHOSTFOLIO_TOKEN> --env GHOSTFOLIO_VERIFY_SSL=<GHOSTFOLIO_VERIFY_SSL> --env GHOSTFOLIO_TIMEOUT=<GHOSTFOLIO_TIMEOUT> --env READ_ONLY_MODE=<READ_ONLY_MODE> -- uvx ghostfolio-mcpReplace <…> with your own values. 10 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from ghostfolio-mcp <command>
Config file
{
"mcpServers": {
"ghostfolio-mcp": {
"command": "uvx",
"args": [
"ghostfolio-mcp"
],
"env": {
"GHOSTFOLIO_URL": "<GHOSTFOLIO_URL>",
"GHOSTFOLIO_TOKEN": "<GHOSTFOLIO_TOKEN>",
"GHOSTFOLIO_VERIFY_SSL": "<GHOSTFOLIO_VERIFY_SSL>",
"GHOSTFOLIO_TIMEOUT": "<GHOSTFOLIO_TIMEOUT>",
"READ_ONLY_MODE": "<READ_ONLY_MODE>"
}
}
}
}Replace <…> with your own values. 10 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from ghostfolio-mcp <command>
Config file
{
"servers": {
"ghostfolio-mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"ghostfolio-mcp"
],
"env": {
"GHOSTFOLIO_URL": "<GHOSTFOLIO_URL>",
"GHOSTFOLIO_TOKEN": "<GHOSTFOLIO_TOKEN>",
"GHOSTFOLIO_VERIFY_SSL": "<GHOSTFOLIO_VERIFY_SSL>",
"GHOSTFOLIO_TIMEOUT": "<GHOSTFOLIO_TIMEOUT>",
"READ_ONLY_MODE": "<READ_ONLY_MODE>"
}
}
}
}Replace <…> with your own values. 10 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from ghostfolio-mcp <command>
Platform CLI
gemini mcp add -e GHOSTFOLIO_URL=<GHOSTFOLIO_URL> -e GHOSTFOLIO_TOKEN=<GHOSTFOLIO_TOKEN> -e GHOSTFOLIO_VERIFY_SSL=<GHOSTFOLIO_VERIFY_SSL> -e GHOSTFOLIO_TIMEOUT=<GHOSTFOLIO_TIMEOUT> -e READ_ONLY_MODE=<READ_ONLY_MODE> ghostfolio-mcp uvx ghostfolio-mcpReplace <…> with your own values. 10 more environment variables are in the server README. uvx runs the command named after the package; if the README names another one, use uvx --from ghostfolio-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Ghostfolio MCP
How do I install Ghostfolio MCP in Claude Code?
Replace the placeholders with your Ghostfolio URL and API token, then run claude mcp add ghostfolio-mcp -e GHOSTFOLIO_URL=<GHOSTFOLIO_URL> -e GHOSTFOLIO_TOKEN=<GHOSTFOLIO_TOKEN> -- uvx ghostfolio-mcp.
What does Ghostfolio MCP do?
It lets an AI agent read and manage Ghostfolio data, including portfolios, market information, transactions, accounts, and settings.
Can I prevent data changes?
Yes. Set READ_ONLY_MODE to disable write operations such as creating or deleting records.