io.github.berthelius/frihet

编码与调试

by berthelius

通过 AI 管理 invoices、expenses、clients、products 与 quotes,内置 31 个工具并采用 MIT 许可。

什么是 io.github.berthelius/frihet

通过 AI 管理 invoices、expenses、clients、products 与 quotes,内置 31 个工具并采用 MIT 许可。

README

<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./assets/banner.svg"> <source media="(prefers-color-scheme: light)" srcset="./assets/banner-light.svg"> <img alt="frihet-mcp" src="./assets/banner.svg" width="100%"/> </picture> </p> <p align="center"> <strong>AI-native MCP server for business management.</strong><br/> <em>Servidor MCP nativo con IA para gestión empresarial.</em> </p> <p align="center"> <a href="https://www.npmjs.com/package/@frihet/mcp-server"><img src="https://img.shields.io/npm/v/@frihet/mcp-server?style=flat&color=18181b&labelColor=09090b" alt="npm version"></a> <a href="https://www.npmjs.com/package/@frihet/mcp-server"><img src="https://img.shields.io/npm/dm/@frihet/mcp-server?style=flat&color=18181b&labelColor=09090b&label=downloads" alt="npm downloads"></a> <a href="https://smithery.ai/server/frihet/frihet-mcp"><img src="https://smithery.ai/badge/frihet/frihet-mcp" alt="Smithery installs"></a> <a href="https://registry.modelcontextprotocol.io/?q=io.frihet"><img src="https://img.shields.io/badge/MCP_Registry-io.frihet%2Ferp-4A90D9?style=flat&logo=anthropic&logoColor=white" alt="MCP Registry"></a> <a href="https://github.com/Frihet-io/frihet-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-18181b?style=flat&labelColor=09090b" alt="license"></a> <img src="https://img.shields.io/badge/tools-55-18181b?style=flat&labelColor=09090b" alt="55 tools"> <img src="https://img.shields.io/badge/node-%3E%3D18-18181b?style=flat&labelColor=09090b" alt="node >=18"> <a href="https://www.typescriptlang.org/"><img src="https://img.shields.io/badge/TypeScript-18181b?style=flat&labelColor=09090b" alt="TypeScript"></a> </p>

What is this

An MCP server that connects your AI assistant to Frihet. Create invoices by talking. Query expenses in natural language. Manage your entire business from your IDE.

code
You:     "Create an invoice for TechStart SL, 40 hours of consulting at 75 EUR/hour, due March 1st"
Claude:  Done. Invoice INV-2026-089 created. Total: 3,000.00 EUR + 21% IVA = 3,630.00 EUR.

55 tools. 8 resources. 7 prompts. Structured output on every tool. Zero boilerplate.


Install

One-line (Claude Code, Cursor, Copilot, Codex, Windsurf, Gemini CLI, and more)

bash
npx skills add Frihet-io/frihet-mcp

Claude Code / Claude Desktop

json
{
  "mcpServers": {
    "frihet": {
      "command": "npx",
      "args": ["-y", "@frihet/mcp-server"],
      "env": {
        "FRIHET_API_KEY": "fri_your_key_here"
      }
    }
  }
}
ToolConfig file
Claude Code~/.claude/mcp.json
Claude Desktop~/Library/Application Support/Claude/claude_desktop_config.json
Cursor.cursor/mcp.json or ~/.cursor/mcp.json
Windsurf~/.windsurf/mcp.json
ClineVS Code settings or .cline/mcp.json
Codex CLI~/.codex/config.toml (MCP section)

The JSON config is identical for all tools. Only the file path changes.

Remote (no install)

Use the hosted endpoint at mcp.frihet.io -- zero local dependencies, runs on Cloudflare Workers.

With API key:

json
{
  "mcpServers": {
    "frihet": {
      "type": "streamable-http",
      "url": "https://mcp.frihet.io/mcp",
      "headers": {
        "Authorization": "Bearer fri_your_key_here"
      }
    }
  }
}

With OAuth 2.0 + PKCE (browser-based login, no API key needed):

Clients that support OAuth (Claude Desktop, Smithery, etc.) can connect directly to https://mcp.frihet.io/mcp and authenticate via browser. The server implements the full OAuth 2.1 authorization code flow with PKCE.

Get your API key

  1. Log into app.frihet.io
  2. Go to Settings > API
  3. Click Create API key
  4. Copy the key (starts with fri_) -- it's only shown once

What you can do

Talk to your ERP. These are real prompts, not marketing copy.

Invoicing

code
"Show me all unpaid invoices"
"Create an invoice for Acme SL with 10h of consulting at 95/hour"
"Mark invoice abc123 as paid"
"How much has ClientName been invoiced this year?"

Expenses

code
"Log a 59.99 EUR expense for Adobe Creative Cloud, category: software, tax-deductible"
"List all expenses from January"
"What did I spend on travel last quarter?"

Clients

code
"Add a new client: TechStart SL, NIF B12345678, email admin@techstart.es"
"Show me all my clients"
"Update ClientName's address to Calle Mayor 1, Madrid 28001"

CRM

code
"Add a contact to Acme SL: Ana Garcia, CTO, ana@acme.es"
"Log a call with TechStart: discussed Q2 proposal, they're interested in upgrade"
"Add a note to ClientName: prefers invoices in English, payment NET 30"
"Show me all activities for Acme SL"

Quotes

code
"Create a quote for Design Studio: logo design (2000 EUR) + brand guidelines (3500 EUR)"
"Show me all pending quotes"

Webhooks

code
"Set up a webhook to notify https://my-app.com/hook when invoices are paid"
"List all my active webhooks"

What to expect

This MCP is a structured data interface -- you describe what you want in natural language, and the AI creates, queries, or modifies business records in Frihet. All 55 tools are CRUD operations over the REST API.

Works great:

code
"Create an invoice for TechStart SL, 40h consulting at 75 EUR/h"   --> creates the invoice
"Show unpaid invoices over 1,000 EUR"                               --> queries and filters
"Log a 120 EUR expense for the Madrid train, category: travel"      --> records the expense
"Update client Acme's email to billing@acme.es"                     --> modifies the record

Does not do:

  • OCR or PDF scanning -- you cannot upload an invoice image and have it read
  • File upload or attachment handling
  • Image processing of any kind

If you need to digitize paper invoices or receipts, extract the data first (e.g., Claude Vision API, a dedicated OCR service, or manual entry), then use the MCP to create the record:

code
1. Scan/photograph the invoice
2. Use Claude Vision: "Read this invoice image and extract the vendor, items, amounts, and dates"
3. Then: "Create an expense in Frihet for [extracted data]"

Tools (55)

Invoices (6)

ToolWhat it does
list_invoicesList invoices with pagination
get_invoiceGet full invoice details by ID
create_invoiceCreate a new invoice with line items
update_invoiceUpdate any invoice field
delete_invoicePermanently delete an invoice
search_invoicesFind invoices by client name

Expenses (5)

ToolWhat it does
list_expensesList expenses with pagination
get_expenseGet expense details
create_expenseRecord a new expense
update_expenseModify an expense
delete_expenseDelete an expense

Clients (5)

ToolWhat it does
list_clientsList all clients
get_clientGet client details
create_clientRegister a new client
update_clientUpdate client info
delete_clientRemove a client

CRM: Contacts (3)

ToolWhat it does
list_client_contactsList all contacts for a client
create_client_contactAdd a contact person to a client
delete_client_contactRemove a contact from a client

CRM: Activities (2)

ToolWhat it does
list_client_activitiesList CRM activities (calls, emails, meetings, tasks)
log_client_activityLog a call, email, meeting, or task against a client

CRM: Notes (3)

ToolWhat it does
list_client_notesList all notes for a client
create_client_noteAdd a free-form note to a client
delete_client_noteRemove a note from a client

Products (5)

ToolWhat it does
list_productsList products and services
get_productGet product details
create_productAdd a product or service
update_productUpdate pricing or details
delete_productRemove a product

Quotes (5)

ToolWhat it does
list_quotesList all quotes
get_quoteGet quote details
create_quoteDraft a new quote
update_quoteModify a quote
delete_quoteDelete a quote

Webhooks (5)

ToolWhat it does
list_webhooksList configured webhooks
get_webhookGet webhook details
create_webhookRegister a new webhook endpoint
update_webhookModify events or URL
delete_webhookRemove a webhook

Intelligence (4)

ToolWhat it does
get_business_contextFull snapshot: profile, plan, recent activity, top clients, current month
get_monthly_summaryMonthly P&L: revenue, expenses, profit, tax liability, top clients by revenue
get_quarterly_taxesQuarterly tax prep: Modelo 303/130 fields, collected vs deductible, liability
duplicate_invoiceClone an invoice for recurring billing (copies items/client/tax, starts as draft)

All 55 tools return structured output via outputSchema -- typed JSON, not raw text. List tools return paginated results ({ data, total, limit, offset }).


Resources (8)

Context the AI can read to make smarter decisions.

Static (reference data, no API calls):

ResourceURIWhat it provides
API Schemafrihet://api/schemaOpenAPI summary: endpoints, auth, rate limits, pagination, error codes
Tax Ratesfrihet://tax/ratesTax rates by Spanish fiscal zone: IVA, IGIC, IPSI, EU reverse charge, IRPF
Tax Calendarfrihet://tax/calendarQuarterly filing deadlines: Modelo 303, 130, 390, 420, VeriFactu timeline
Expense Categoriesfrihet://config/expense-categories8 categories with deductibility rules, IVA treatment, amortization
Invoice Statusesfrihet://config/invoice-statusesStatus flow (draft > sent > paid/overdue > cancelled), transition rules, webhook events

Dynamic (live data from your account):

ResourceURIWhat it provides
Business Profilefrihet://business-profileYour business info, plan, defaults, recent activity, top clients
Monthly Snapshotfrihet://monthly-snapshotCurrent month P&L, revenue, expenses, tax liability
Overdue Invoicesfrihet://overdue-invoicesAll invoices past due date (up to 100)

Prompts (7)

Pre-built workflows the AI can execute as guided multi-step operations.

PromptWhat it doesArguments
monthly-closeClose the month: review unpaid invoices, categorize expenses, check tax obligations, generate summarymonth? (YYYY-MM)
onboard-clientSet up a new client with correct tax rates by location, optionally create a welcome quoteclientName, country?, region?
quarterly-tax-prepPrepare quarterly tax filing: calculate IVA/IGIC, identify deductibles, preview Modelo 303/130/420quarter?, fiscalZone?
overdue-followupFind overdue invoices, draft follow-up messages, suggest payment reminders--
new-client-invoiceCreate a client + first invoice in one workflow with tax rate lookupclientName, country?
expense-reportGenerate expense report grouped by category with deductible totalsmonth? (YYYY-MM)
expense-batchProcess expenses in bulk: categorize, apply tax rates, flag missing receiptsfiscalZone?

How it works

mermaid
graph LR
    AI["Your AI assistant"]
    MCP["frihet-mcp"]
    API["api.frihet.io"]
    DB["Frihet ERP"]

    AI -- "create_invoice()" --> MCP
    MCP -- "POST /v1/invoices" --> API
    API --> DB
    DB -- "201 + invoice data" --> API
    API -- "structured JSON" --> MCP
    MCP -- "typed response + suggestions" --> AI

    style AI fill:#09090b,stroke:#4ade80,color:#fafafa
    style MCP fill:#09090b,stroke:#fafafa,color:#fafafa
    style API fill:#09090b,stroke:#3f3f46,color:#a1a1aa
    style DB fill:#09090b,stroke:#3f3f46,color:#a1a1aa

The server translates tool calls into REST API requests. It handles authentication, rate limiting (automatic retry with backoff on 429), pagination, and error mapping.

Two transports:

  • stdio (local) -- npx @frihet/mcp-server with FRIHET_API_KEY
  • Streamable HTTP (remote) -- https://mcp.frihet.io/mcp with Bearer token or OAuth 2.0+PKCE

Environment variables

VariableRequiredDefault
FRIHET_API_KEYYes (stdio)--
FRIHET_API_URLNohttps://api.frihet.io/v1

API limits

LimitValue
Requests per minute100 per API key
Results per page100 max (50 default)
Request body1 MB max
Webhook payload100 KB max
Webhooks per account20 max

Rate limiting is handled automatically with exponential backoff.


Claude Code Skill

Beyond raw MCP tools, this repo includes a Claude Code skill that adds business context: Spanish tax rules, workflow recipes, financial reports, and natural language commands.

Install the skill

bash
git clone https://github.com/Frihet-io/frihet-mcp.git
ln -s "$(pwd)/frihet-mcp/skill" ~/.claude/skills/frihet

Or with the universal installer:

bash
npx skills add Frihet-io/frihet-mcp

Commands

CommandWhat it does
/frihet statusAccount overview, recent activity, pending payments
/frihet invoiceCreate, list, search invoices
/frihet expenseLog and query expenses
/frihet clientsManage client database
/frihet quoteCreate and manage quotes
/frihet reportFinancial summaries (P&L, quarterly, overdue)
/frihet webhooksConfigure automation triggers
/frihet setupGuided setup and connection test

The skill knows about IVA rates, IRPF retention, Modelo 303 prep, expense deductibility rules, and VeriFactu compliance.

Full documentation: docs.frihet.io/desarrolladores/skill-claude-code


Development

bash
git clone https://github.com/Frihet-io/frihet-mcp.git
cd frihet-mcp
npm install
npm run build

Run locally:

bash
FRIHET_API_KEY=fri_xxx node dist/index.js

Test with the MCP Inspector:

bash
npx @modelcontextprotocol/inspector node dist/index.js

Contributing

Contributions are welcome. Please open an issue first to discuss what you'd like to change.

bash
git clone https://github.com/Frihet-io/frihet-mcp.git
cd frihet-mcp
npm install
npm run build   # must pass before submitting

Current limitations

  • No OCR or file upload -- the MCP works with structured data, not images or PDFs. Planned for a future release.
  • Single company -- one API key maps to one Frihet workspace. Multi-company support is not yet available.
  • Frihet account required -- you need an active account at app.frihet.io and an API key (starts with fri_).

Ecosystem

PackageWhat it is
@frihet/mcp-serverThis MCP server (55 tools, 8 resources, 7 prompts)
@frihet/sdkTypeScript SDK (frihet.invoices.create())
frihetCLI (frihet invoices list --status overdue)
n8n-nodes-frihetn8n community node for workflow automation
REST APIOpenAPI 3.1 at api.frihet.io/v1
Remote MCPHosted endpoint on Cloudflare Workers (zero install)
WebhooksReal-time events with HMAC-SHA256

Links


License

MIT. See LICENSE.

Built by Frihet.

常见问题

io.github.berthelius/frihet 是什么?

通过 AI 管理 invoices、expenses、clients、products 与 quotes,内置 31 个工具并采用 MIT 许可。

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论