Personal Expense Tracker MCP
Personal Expense Tracker MCP
Qué hace este proyecto
Personal Expense Tracker MCP es un servidor MCP local y sencillo para registrar gastos personales
Almacena los datos de gastos en un archivo CSV local
El servidor ofrece a un cliente MCP cinco herramientas específicas
añadir un nuevo gasto
listar los gastos guardados
crear un resumen de gastos
actualizar un gasto existente
eliminar un gasto existente
El proyecto está diseñado para ser simple y fácil de ejecutar localmente
No se necesita ninguna cuenta bancaria ni API externa
Related MCP server: Expense Tracker MCP
Requisitos
Antes de empezar, asegúrate de tener instalado lo siguiente
Node.js versión 20 o superior
npm
Git
Comprueba Node.js
node --versionComprueba npm
npm --versionComprueba Git
git --versionInstalación
1 Clona el repositorio
git clone https://github.com/MohammadYousef-001/Personal-Expenses-Tracker.git2 Entra en la carpeta del proyecto
cd Personal-Expenses-Tracker3 Instala los paquetes
npm installEspera a que npm termine de instalar los paquetes necesarios
Archivo de datos
Los gastos se guardan localmente en
data/expenses.csvEl archivo CSV utiliza estas columnas
id,amount,category,date,descriptionNo cambies los nombres de las columnas
Ejecutar el servidor MCP
Para iniciar el servidor, ejecuta
npm run devEl servidor utiliza la entrada y la salida estándar para la comunicación MCP
Es un servidor local y no necesita un puerto web
Ejecutar MCP Inspector
MCP Inspector es la forma más sencilla de probar las herramientas manualmente
Ejecuta
npm run inspectSe debería abrir una ventana del navegador con MCP Inspector
Si no se abre automáticamente, usa la URL que se muestra en el terminal
En el Inspector
Conecta con el servidor
Abre la sección Tools
Elige una herramienta
Introduce la entrada
Haz clic en Execute Tool
Comprueba el resultado
Herramientas disponibles
Tool | Qué hace | Entradas principales |
| añade un gasto nuevo al archivo CSV | amount category date description |
| lista los gastos guardados y puede filtrarlos | month category |
| calcula los totales de gasto de un mes | month |
| actualiza un gasto existente | id y al menos un campo del gasto |
| elimina un gasto existente | id |
Herramienta 1 add_expense
Usa add_expense para guardar un nuevo gasto
Entradas
amount
La cantidad de dinero gastada
Debe ser un número positivo
category
La categoría del gasto
Ejemplos
groceries
transport
bills
shoppingLa categoría se guarda en minúsculas para que los nombres de las categorías sean coherentes
date
La fecha del gasto
Debe usar
YYYY-MM-DDEjemplo
2026-08-12La fecha también debe ser una fecha real del calendario
Esto no es válido
2026-99-99description
Información breve y opcional sobre el gasto
Ejemplo
{
"amount": 25,
"category": "groceries",
"date": "2026-08-12",
"description": "milk and bread"
}Una solicitud correcta añade el gasto a
data/expenses.csvHerramienta 2 list_expenses
Usa list_expenses para ver los gastos guardados
Sin filtros
{}Filtrar por categoría
{
"category": "groceries"
}Filtrar por mes
{
"month": "2026-08"
}Usar ambos filtros
{
"month": "2026-08",
"category": "groceries"
}El mes debe usar
YYYY-MMEl mes debe estar entre 01 y 12
Esto no es válido
2026-99Herramienta 3 get_spending_summary
Usa get_spending_summary para ver un resumen de tus gastos
Ejemplo
{
"month": "2026-08"
}El resultado puede incluir
el mes seleccionado
el importe total gastado
el número de gastos
el gasto total de cada categoría
Resultado de ejemplo
month: 2026-08
total amount: 150
expense count: 4
category totals:
groceries: 80
transport: 30
bills: 40Los valores reales dependen de los datos que hay dentro de data/expenses.csv
Prompts de ejemplo
Añadir un gasto
I spent 25 on groceries todayEsto puede usar
add_expenseBuscar gastos
show my grocery expenses for this monthEsto puede usar
list_expensesConsultar gastos
how much did I spend this monthEsto puede usar
get_spending_summaryValidación de entrada
El proyecto comprueba la entrada de las herramientas antes de usarla
Ejemplos de entradas no válidas
importe negativo
importe cero
formato de fecha incorrecto
fecha de calendario imposible
mes no válido
categoría demasiado larga
descripción demasiado larga
La entrada no válida se rechaza antes de guardarla
Probar los esquemas
Ejecuta
npm run check:schemaUn resultado correcto debería mostrar
All expense schemas are valid.Solución de problemas
Problema 1: faltan paquetes
Si ves un error que indica que no se puede encontrar un paquete o módulo, ejecuta
npm installDespués inténtalo de nuevo
npm run devProblema 2: MCP Inspector no se inicia
Asegúrate de que los paquetes estén instalados
npm installDespués ejecuta
npm run inspectSi sigue ejecutándose desde una sesión anterior, pulsa
Ctrl + CDespués vuelve a iniciar el Inspector
Problema 3: error de TypeScript o de esquema
Ejecuta
npm run check:schemaSi todo es correcto, deberías ver
All expense schemas are valid.Si hay un error, comprueba el nombre del archivo y el número de línea que se muestran en el terminal
Corrige el error antes de volver a iniciar el Inspector
Problema 4: fecha no válida
Una fecha válida debe usar
YYYY-MM-DDEjemplo válido
2026-08-12Ejemplo no válido
2026-99-99Problema 5: no se devuelven gastos
Comprueba
data/expenses.csvAsegúrate de que el archivo contenga filas de gastos por debajo de la cabecera del CSV
Si el archivo solo contiene la cabecera, es normal que el resultado esté vacío
Estructura del proyecto
Archivos importantes del proyecto
Personal-Expenses-Tracker/
│
├── data/
│ └── expenses.csv
│
├── docs/
│ ├── design.md
│ └── threat-model.md
│
├── examples/
│
├── src/
│ ├── index.ts
│ ├── schemas/
│ ├── tools/
│ └── lib/
│
├── SECURITY.md
├── package.json
└── README.mdSeguridad
La entrada de las herramientas se trata como una entrada no fiable
El proyecto valida la entrada antes de las operaciones importantes
La ruta del archivo de gastos está controlada por la aplicación
Los errores devueltos al cliente MCP se mantienen breves
Los errores más detallados se quedan en el terminal local para depurar
Las herramientas de gastos no requieren solicitudes de red externas
Hay más información de seguridad en
SECURITY.mdAlcance del proyecto
Este proyecto es una pequeña herramienta local de seguimiento de gastos personales
No incluye
conexiones con cuentas bancarias
importaciones bancarias automáticas
inicio de sesión de usuario
base de datos en la nube
aplicación gráfica completa
previsión financiera
El objetivo principal es proporcionar herramientas MCP sencillas para el seguimiento local de gastos
Licencia
Este proyecto usa la licencia MIT
Consulta LICENSE
Available Tools
5 toolsadd_expenseC
add a new expense
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | The expense date in YYYY-MM-DD format | |
| amount | Yes | The expense amount, up to 1000000 | |
| category | Yes | The normalized expense category | |
| description | No | A short optional description of the expense |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=false, so the description does not need to restate that this is a write operation. However, it adds no behavioral context beyond what the name implies—it simply restates 'add a new expense', which is effectively a tautology. There is no mention of side effects, idempotency, validation rules, or what happens on conflict, making it entirely uninformative for behavioral expectations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely short (five words), which could be seen as concise, but it is under-specified rather than efficiently structured. It lacks any front-loaded information beyond a bare verb phrase. There is no hierarchy of information; it is merely a label, failing to earn its place by providing any useful detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
With four parameters, three of which are required, and no output schema, the description is completely inadequate. It does not mention required fields, expected input format (though schema covers this), possible side effects, or return behavior. An agent has no way to anticipate the tool's behavior or success criteria beyond the raw schema, making the description insufficient for correct invocation in a meaningful context.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides 100% coverage of all four parameters, including descriptions for amount, category, date, and optional description. The description adds no parameter-specific meaning, so the baseline score of 3 applies. While the description doesn't harm parameter understanding, it also doesn't supplement the schema or clarify relationships between parameters.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'add a new expense' conveys a clear verb (add) and resource (expense). It is distinct from sibling tools like update_expense and delete_expense simply by the verb 'add', so an agent can infer its core purpose. However, it does not explicitly distinguish itself from potential overlap or specify any scope (e.g., personal vs. shared), so it stops short of full differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites, context, or when 'add' is preferred over 'update' or other siblings. An agent is left to infer usage purely from the tool name and schema, which is insufficient for a choice among several expense-related tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delete_expenseADestructive
delete an existing expense by ID
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the expense |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructiveHint=true and readOnlyHint=false, indicating a destructive write operation. The description adds no further behavioral context beyond restating the action; it does not mention side effects, irreversibility, or the nature of the response. It does not contradict the annotations, so it meets the baseline but adds little value.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, concise sentence that clearly communicates the action and target. It is front-loaded and contains no extraneous words, achieving appropriate brevity for a simple operation.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter delete operation with no output schema, the description covers the essential purpose and key parameter. It does not describe return values or error conditions, but these are often standard for delete operations and are not critical given the tool's simplicity. The description is complete enough for an agent to call it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema fully covers the single parameter 'id' with a description, and the tool description also mentions 'by ID', but adds no additional semantic detail beyond what the schema provides. With 100% schema description coverage, the baseline of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'delete an existing expense by ID' clearly states the action (delete) and the resource (expense), and specifies the identifier used. It is unambiguous and easily distinguishes from siblings like add_expense, update_expense, and list_expenses through the verb and resource.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implicitly conveys usage by the verb 'delete', but it does not explicitly state when to use it versus the alternatives, nor does it mention any constraints such as required existence or irreversibility. The context is clear enough for an agent to infer usage, but no explicit guidance or exclusions are provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_spending_summaryCRead-only
get a spending summary
| Name | Required | Description | Default |
|---|---|---|---|
| month | No | A calendar month in YYYY-MM format |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is fully covered and the bar is lower. The description adds only the marginal notion that this returns an aggregated summary, but does not disclose what gets aggregated or scoped. It does not contradict the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The phrase is four words with zero waste and a front-loaded verb, which is efficient. However, the brevity stems more from under-specification than from disciplined trimming, so it does not reach the level of a well-packaged, substance-complete definition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a read-only tool with one optional parameter and annotations covering safety, this is a simple tool, but the description omits what the summary contains and what happens when month is omitted. With no output schema and no descriptive context, an agent still cannot predict the return shape or default time scope.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% — the single month parameter is fully documented with the description 'A calendar month in YYYY-MM format' and a regex pattern. Per the rubric, the baseline is 3 when the schema does the heavy lifting, and the description adds nothing beyond it.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a verb ('get') and a resource ('spending summary'), and it distinguishes itself from the CRUD siblings (add/update/delete/list_expenses) as the aggregation view. However, it essentially restates the tool name ('get_spending_summary' → 'get a spending summary') and adds no new information about what the summary contains, so it sits at minimum viable rather than distinctly helpful.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to choose this tool vs its siblings. There is no mention of how a summary differs from list_expenses, when the optional month should be supplied, or what default scope applies if month is omitted. With four sibling tools, this leaves the decision entirely to the agent's inference.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_expensesBRead-only
list expenses with optional filters
| Name | Required | Description | Default |
|---|---|---|---|
| month | No | A calendar month in YYYY-MM format | |
| category | No | The normalized expense category |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The annotations already declare readOnlyHint=true, so the tool is known to be safe. The description adds no behavioral context beyond 'list expenses'—nothing about pagination, sorting, default behavior (e.g., what happens if no filters are provided), or response format. Given annotations cover safety, the description fails to enrich the agent's understanding of how the tool behaves.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, short sentence with no redundant words or filler. It is efficiently front-loaded with the core action ('list expenses') and the key feature ('optional filters'). Every word earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's low complexity (2 optional params, no nested objects, no output schema) and strong annotations, the description is minimally adequate. However, it does not explain whether the filters can be combined, what the response looks like, or if there are limits. An agent would have to infer these from the schema and typical conventions. It is complete enough for a basic call but leaves room for ambiguity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so both month and category are fully described in the schema. The description's phrase 'optional filters' adds no extra meaning about semantics like combined filtering or format. The baseline is 3 because the schema carries the full load; the description offers no additional insight.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool lists expenses and mentions optional filters, which maps to the parameters. It is distinct from the siblings (add/update/delete/spending summary) since 'list' is unambiguous. However, it does not explicitly name the filter dimensions (month, category) or contrast with the summary tool, so it's specific but not maximally differentiated.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
There is no guidance on when to use this tool versus alternatives. The description does not mention that get_spending_summary is for aggregated data, nor does it indicate that list_expenses is for raw expense details. The usage context is only implied by the verb 'list' and not explicitly stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
update_expenseB
update an existing expense by ID
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The ID of the expense | |
| date | No | The expense date in YYYY-MM-DD format | |
| amount | No | The expense amount, up to 1000000 | |
| category | No | The normalized expense category | |
| description | No | A short optional description of the expense |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already indicate readOnlyHint=false and destructiveHint=false, so the mutation nature is expected. The description adds that it updates an existing expense by ID, implying the target must exist. However, it does not disclose whether it performs a partial update (only provided fields) or a full replacement, nor what happens if the ID is not found. Given the annotations, the additional information is minimal but not contradictory.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, compact sentence that front-loads the core action. There is no filler or redundant information. It earns its place with zero waste, making it exemplarily concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with 5 parameters, no output schema, and only basic annotations, the description is insufficiently complete. It does not explain the update semantics (partial vs. full), error behavior for missing ID, or what the tool returns. While parameters are covered by the schema, key operational context is absent, leaving an agent to guess.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% since every parameter (id, date, amount, category, description) has its own description in the schema. The tool description adds no parameter-specific details beyond what the schema already provides. The baseline of 3 is appropriate given the high schema coverage.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb 'update' and identifies the resource 'expense' and the key 'by ID'. It clearly distinguishes from sibling tools (add, delete, list, summary) by indicating this modifies an existing record. The purpose is unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is given on when to use this tool versus alternatives, such as using add_expense for new expenses or delete_expense for removal. The description relies on the tool name and context, but does not explicitly state conditions or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
5 tool updates
v0.1.0- First observed
add_expense - First observed
delete_expense - First observed
get_spending_summary - First observed
list_expenses - First observed
update_expense
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: add, update, delete, list, and summarize expenses. There is zero overlap, making it easy for an agent to select the right tool for the task.
All tools follow the consistent verb_noun pattern (add_expense, update_expense, delete_expense, list_expenses, get_spending_summary). This creates a predictable and uniform naming convention.
With only 5 tools, the server is tightly scoped for a personal expense tracker. Each tool serves a necessary function without unnecessary bloat, and the count is well within the ideal range.
The toolset covers full CRUD for expenses (add, update, delete, list) plus a summary function. A minor gap is the lack of a direct 'get_expense' by ID, but the list tool with filters can likely retrieve individual expenses, so it's a workable limitation.
Maintenance
Related MCP Connectors
- ManiloOAuthapp.manilo
Log, query, and edit expenses, budgets, and accounts in Manilo from any MCP-compatible AI assistant.
- ManiloOAuthapp.ledgy.api
Log, query, and edit expenses, budgets, and accounts in Manilo (formerly Ledgy) from any MCP-compatible AI assistant.
Track expenses from your AI chat: log, categorize, monthly CSV reports. All data is local.
Log, query, and edit expenses, budgets, and accounts in Ledgy from any MCP-compatible AI assistant.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables users to track personal expenses through natural language interactions with comprehensive category support and financial summaries. Provides both local and remote MCP server options with SQLite storage for fast expense management operations.-
- FlicenseNot gradedqualityDmaintenanceMCP server for tracking expenses with local SQLite storage. Provides tools to add, list, and summarize expenses by category.-
- FlicenseAqualityCmaintenanceMCP server for managing personal expenses, enabling users to add, list, and summarize expenses by category, with data stored in a local SQLite database.3-
- FlicenseNot gradedqualityBmaintenanceEnables managing and analyzing personal expenses through MCP tools, including adding expense records, listing expenses within date ranges, and summarizing spending by category, with expense categories exposed as an MCP resource.-