Firefly III MCP Server
Enables AI assistants to manage Firefly III personal finance accounts and transactions through the Model Context Protocol.
README
Firefly III MCP Server
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.
Project Structure
This project uses a Turborepo-managed monorepo structure, containing the following main packages:
- @firefly-iii-mcp/core - Core functionality module providing the foundation for interacting with the Firefly III API
- @firefly-iii-mcp/local - Command-line tool for running the MCP server locally
- @firefly-iii-mcp/cloudflare-worker - Implementation for deployment to Cloudflare Workers
- @firefly-iii-mcp/server - Express-based server implementation with Streamable HTTP and SSE support
Features
- Interact with Firefly III instances via AI
- Programmatically manage accounts and transactions
- Extensible toolset for various financial operations
- Support for both local and cloud deployment
- Compatible with the Model Context Protocol standard
- Tool filtering via presets or custom tags to reduce token usage
Prerequisites
- A running Firefly III instance
- A Cloudflare account if you plan to deploy using the "Deploy to Cloudflare" button
Getting Started
1. Obtain a Firefly III Personal Access Token (PAT)
To allow the MCP server to interact with your Firefly III instance, you need to generate a Personal Access Token (PAT):
- Log in to your Firefly III instance
- Navigate to Options > Profile > OAuth
- Under the "Personal access tokens" section, click on "Create new token"
- Give your token a descriptive name (e.g., "MCP Server Token")
- Click "Create"
- Important: Copy the generated token immediately. You will not be able to see it again.
For more details, refer to the official Firefly III documentation on Personal Access Tokens.
2. Configure the MCP Server
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:
Request Headers (Recommended)
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 withBearer(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.
Query Parameters (Use with caution)
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 Token
Please note that URLs, including query parameters, can be logged in various places, potentially exposing sensitive information.
Environment Variables (Primarily for self-hosting/local development)
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"
Running the MCP Server
Method 1: Local Mode
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"
]
}
}
}
Method 2: Express Server (Recommended for Web Apps)
This method provides an HTTP-based server with Streamable HTTP and SSE support, making it ideal for web applications.
As a Command-Line Tool
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 enable
As a Library
npm 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.
Method 3: Deploy to Cloudflare Workers (Recommended for Production)
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:
- Go to your Cloudflare dashboard
- Navigate to Workers & Pages
- Select your deployed Worker
- Go to Settings > Variables
- Add the following variables:
- Required:
FIREFLY_III_BASE_URLandFIREFLY_III_PAT - Optional:
FIREFLY_III_PRESETorFIREFLY_III_TOOLS
- Required:
Method 4: Run Locally from Source
[!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
.envfile: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
Tool Filtering Options
You can filter which tools are exposed to the MCP client to reduce token usage and focus on specific functionality:
Available Presets
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 tools
Development Guide
This project uses Turborepo to manage the monorepo workflow and Changesets for versioning and publishing.
Common Commands
- Build all packages:
npm run build - Build specific packages:
npm run build:coreornpm run build:local - Clean build artifacts:
npm run clean - Development mode:
npm run dev - Publish packages:
npm run publish-packages
For detailed development guidelines, please refer to the contribution guide.
Acknowledgements
This project utilizes and modifies generation scripts from harsha-iiiv/openapi-mcp-generator. Many thanks to the original authors for their work.
Contributing
Contributions are welcome! This project uses Turborepo to manage the monorepo workflow. Please see CONTRIBUTING.md for detailed guidelines on how to contribute.
License
This project is licensed under the MIT License.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。