
Firefly III
STDIOMCP server for Firefly III personal finance management and AI assistant integration.
MCP server for Firefly III personal finance management and AI assistant integration.
This is a Model Context Protocol (MCP) server for Firefly III, a free and open-source personal finance manager. Through this MCP server, users can leverage AI tools to manage their Firefly III accounts and transactions, creating AI assistants for personal finance and accounting.
This project uses a Turborepo-managed monorepo structure, containing the following main packages:
To allow the MCP server to interact with your Firefly III instance, you need to generate a Personal Access Token (PAT):
For more details, refer to the official Firefly III documentation on Personal Access Tokens.
You need to provide the Firefly III PAT and your Firefly III instance URL to the MCP server. This can be done in several ways:
Provide these values in the headers of each request to the MCP server. This is generally the most secure method:
X-Firefly-III-Url
: Your Firefly III instance URL (e.g., https://firefly.yourdomain.com
)Authorization
: The Personal Access Token, typically prefixed with Bearer
(e.g., Bearer YOUR_FIREFLY_III_PAT
)Please consult the documentation of the AI tool or client you are using for the exact header names it expects.
Alternatively, you can provide these values in the query parameters of each request to the MCP server:
baseUrl
: Your Firefly III instance URLpat
: Your Firefly III Personal Access TokenPlease note that URLs, including query parameters, can be logged in various places, potentially exposing sensitive information.
Set the following environment variables before running the server:
FIREFLY_III_BASE_URL="YOUR_FIREFLY_III_INSTANCE_URL" # e.g., https://firefly.yourdomain.com FIREFLY_III_PAT="YOUR_FIREFLY_III_PAT" # Optional: Filter tools using preset or custom tags FIREFLY_III_PRESET="default" # Available: default, full, basic, budget, reporting, admin, automation # Or specify custom tool tags (overrides preset if both are set) FIREFLY_III_TOOLS="accounts,transactions,categories"
This method is suitable for clients that support calling MCP tools via standard input/output (stdio), such as Claude Desktop.
Basic run command:
npx @firefly-iii-mcp/local --pat YOUR_PAT --baseUrl YOUR_FIREFLY_III_URL
You can also filter the available tools to reduce token usage:
# Using a preset npx @firefly-iii-mcp/local --pat YOUR_PAT --baseUrl YOUR_FIREFLY_III_URL --preset budget # Using custom tool tags npx @firefly-iii-mcp/local --pat YOUR_PAT --baseUrl YOUR_FIREFLY_III_URL --tools accounts,transactions,categories
You can also refer to the official tutorial for configuration in JSON format.
{ "mcpServers": { "firefly-iii": { "command": "npx", "args": [ "@firefly-iii-mcp/local", "--pat", "<Your Firefly III Personal Access Token>", "--baseUrl", "<Your Firefly III Base URL>", "--preset", "default" ] } } }
This method provides an HTTP-based server with Streamable HTTP and SSE support, making it ideal for web applications.
npx @firefly-iii-mcp/server --pat YOUR_PAT --baseUrl YOUR_FIREFLY_III_URL
Command-line options:
-p, --pat <token>
- Firefly III Personal Access Token-b, --baseUrl <url>
- Firefly III Base URL-P, --port <number>
- Port to listen on (default: 3000)-l, --logLevel <level>
- Log level: debug, info, warn, error (default: info)-s, --preset <name>
- Tool preset to use (default, full, basic, budget, reporting, admin, automation)-t, --tools <list>
- Comma-separated list of tool tags to enablenpm install @firefly-iii-mcp/server
Basic usage:
import { createServer } from '@firefly-iii-mcp/server'; const server = createServer({ port: 3000, pat: process.env.FIREFLY_III_PAT, baseUrl: process.env.FIREFLY_III_BASE_URL, enableToolTags: ['accounts', 'transactions', 'categories'] // Optional: Filter available tools }); server.start().then(() => { console.log('MCP Server is running on http://localhost:3000'); });
For more details, see the @firefly-iii-mcp/server documentation.
You can easily deploy this MCP server to Cloudflare Workers using the button below:
Note: After deploying, you will need to configure the environment variables in your Cloudflare Worker's settings:
FIREFLY_III_BASE_URL
and FIREFLY_III_PAT
FIREFLY_III_PRESET
or FIREFLY_III_TOOLS
[!NOTE] For production use, it is recommended to use the NPM package or deploy to Cloudflare Workers.
Clone the repository:
git clone https://github.com/etnperlong/firefly-iii-mcp.git cd firefly-iii-mcp
Install dependencies:
npm install
Create a .env
file:
FIREFLY_III_BASE_URL="YOUR_FIREFLY_III_INSTANCE_URL"
FIREFLY_III_PAT="YOUR_FIREFLY_III_PAT"
# Optional: Filter tools
FIREFLY_III_PRESET="default"
# Or
FIREFLY_III_TOOLS="accounts,transactions,categories"
Build the project:
npm run build
Start the development server:
npm run dev
You can filter which tools are exposed to the MCP client to reduce token usage and focus on specific functionality:
default
: Basic tools for everyday use (accounts, bills, categories, tags, transactions, search, summary)full
: All available toolsbasic
: Core financial management toolsbudget
: Budget-focused toolsreporting
: Reporting and analysis toolsadmin
: Administration toolsautomation
: Automation-related toolsThis project uses Turborepo to manage the monorepo workflow and Changesets for versioning and publishing.
npm run build
npm run build:core
or npm run build:local
npm run clean
npm run dev
npm run publish-packages
For detailed development guidelines, please refer to the contribution guide.
This project utilizes and modifies generation scripts from harsha-iiiv/openapi-mcp-generator. Many thanks to the original authors for their work.
Contributions are welcome! This project uses Turborepo to manage the monorepo workflow. Please see CONTRIBUTING.md for detailed guidelines on how to contribute.
This project is licensed under the MIT License.