Skip to main content
Glama
yash-201

Expense Tracker MCP Server

by yash-201

Сервер MCP для учёта расходов

Сервер Model Context Protocol (MCP), созданный на базе FastMCP (v3.x) и Python, предназначен для предоставления инструментов и ресурсов для учёта расходов MCP-совместимым клиентам, таким как Claude Desktop и MCP Inspector.


📋 Предварительные требования

  • Python: 3.10+ (проверено на Python 3.14)

  • uv: Быстрый установщик пакетов и резолвер Python (astral.sh/uv)

  • Node.js: v22.x или v24.x (LTS) — требуется для интерфейса MCP Inspector

  • Claude Desktop (необязательно): для тестирования инструментов прямо в Claude


Related MCP server: Demo MCP Server

🚀 Установка и настройка

1. Инициализация проекта и окружения

# Initialize uv project (if starting fresh)
uv init .

# Install FastMCP
uv add fastmcp

2. Подготовка Node.js для интерфейса MCP Inspector

MCP Inspector (@modelcontextprotocol/inspector) требует Node.js v22.19.0+ или v24+. Если используется nvm-windows:

nvm install lts
nvm use 24

Установите inspector глобально или разрешите npx загрузить его:

npm install -g @modelcontextprotocol/inspector

🛠️ Запуск и разработка

Вариант A: Интерактивный веб-интерфейс (MCP Inspector)

Чтобы запустить веб-интерфейс MCP Inspector с горячей перезагрузкой:

uv run fastmcp dev inspector main.py
  • Оставьте это окно терминала открытым.

  • Консоль выведет локальный URL с токеном аутентификации:

    MCP Inspector Web is up and running at:
       http://127.0.0.1:6274?MCP_INSPECTOR_API_TOKEN=<token>
  • Откройте эту ссылку в браузере, чтобы тестировать инструменты, просматривать схемы и видеть логи запросов и ответов в реальном времени.

Вариант B: Прямой запуск сервера (STDIO)

Чтобы запустить MCP-сервер в режиме стандартного ввода-вывода:

uv run fastmcp run main.py

(или uv run python main.py)


🤖 Подключение к Claude Desktop

1. Расположение файла конфигурации

В Windows конфигурация Claude Desktop хранится по адресу:

%APPDATA%\Claude\claude_desktop_config.json

(Полный путь: C:\Users\<ВашеИмяПользователя>\AppData\Roaming\Claude\claude_desktop_config.json)

2. Настройки конфигурации

Добавьте определение expense-server в раздел mcpServers.

Примечание: В Windows GUI-приложения, такие как Claude Desktop, часто не наследуют PATH из оболочки. Всегда указывайте абсолютный путь к файлу uv.exe.

{
  "mcpServers": {
    "expense-server": {
      "command": "C:\\Users\\hp\\AppData\\Local\\Python\\pythoncore-3.14-64\\Scripts\\uv.exe",
      "args": [
        "run",
        "--directory",
        "g:\\Projects\\expense-tracker-mcp-server",
        "fastmcp",
        "run",
        "main.py"
      ]
    }
  }
}

3. Перезапуск Claude Desktop

  1. Полностью закройте Claude Desktop (убедитесь, что приложение закрыто из системного трея Windows рядом с часами).

  2. Снова откройте Claude Desktop.

  3. Проверьте Settings > Developer, чтобы убедиться, что expense-server подключён.


🧰 Доступные инструменты (текущий main.py)

Инструмент

Параметры

Описание

roll_dice

n_dice: int = 1

Бросает n_dice шестигранных кубиков и возвращает список результатов.

add_numbers

a: float, b: float

Складывает два числа и возвращает сумму.


🔧 Устранение неполадок

1. Unknown command "main.py". Available commands: inspector, apps.

В FastMCP 3.x fastmcp dev — это группа команд. Используйте fastmcp dev inspector main.py вместо fastmcp dev main.py.

2. node:util does not provide an export named 'styleText'

Версия Node.js старше v20.12. Обновитесь до Node v22+ или v24+ с помощью nvm install lts && nvm use 24.

3. Cannot find native binding (npm optional dependencies bug)

Повреждённый кэш npx из-за переключения версий Node. Выполните:

npm cache clean --force
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\npm-cache\_npx" -ErrorAction SilentlyContinue
npm install -g @modelcontextprotocol/inspector

Available Tools

2 tools
add_numbersA

Add two numbers together.

ParametersJSON Schema
NameRequiredDescriptionDefault
aYes
bYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.5/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It states the operation but does not explicitly mention that it is pure, has no side effects, or what the return value is. While obvious for addition, it falls short of full transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, direct sentence with zero filler. It is front-loaded and every word earns its place, exemplifying appropriate conciseness.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a trivial addition tool with a clear input schema and an output schema (as indicated by the signal), the description is largely sufficient. It lacks explicit mention of edge cases or preconditions, but none are expected for this operation, making it nearly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%—the description does not mention parameters by name or add any nuance. The schema already declares a and b as required numbers, but the description adds no value beyond that, failing to compensate for the low coverage.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Add two numbers together' uses a specific verb and resource, clearly stating exactly what the tool does. It is distinct from siblings like roll_dice and add_expense, so agents can easily differentiate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no guidance on when to use this tool versus alternatives, nor any exclusions. There is no context about when addition is appropriate or not, leaving the agent to infer usage from the name and schema alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

roll_diceA

Roll n_dice 6-sided dice and return the results.

ParametersJSON Schema
NameRequiredDescriptionDefault
n_diceNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden of behavioral disclosure. It correctly implies a random stochastic process and states the output ('return the results'), but does not explicitly mention randomness, the range of outcomes (1–6 per die), or that subsequent calls produce independent results. This is adequate for a simple tool but lacks any deeper context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence, front-loaded with the core action, and contains no filler words. Every term contributes to understanding the tool's behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the low complexity (one parameter, simple output) and the presence of an output schema, the description is complete enough. It explains the parameter's role and the action's purpose. It could mention the non-deterministic nature more explicitly, but that is implicit for a dice-rolling tool, and the output schema likely covers return formatting.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has zero description coverage for the parameter n_dice, so the description must compensate. It does so by framing n_dice as the number of dice to roll, adding semantic meaning to an otherwise bare integer field. However, it does not specify constraints like minimum value or positivity, which would have improved clarity further.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a clear, specific action: 'Roll n_dice 6-sided dice and return the results.' The verb 'Roll' and resource 'dice' are unambiguous, and the tool is easily distinguished from siblings like add_numbers or list_expenses, which handle arithmetic or expense management.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance about when to use this tool versus alternatives, nor any exclusions or prerequisites. Sibling tools are unrelated, but the description provides no context for selection, leaving the agent to infer its suitability from the name alone.

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.

  1. 2 tool updatesv0.1.0
    • First observedadd_numbers
    • First observedroll_dice

TDQS

B3.4/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have completely disjoint purposes—one rolls dice and the other adds numbers. There is no ambiguity between them and no chance of an agent misselecting one for the other.

Naming Consistency5/5

Both tool names follow the same verb_noun snake_case pattern: roll_dice and add_numbers. The naming is predictable and straightforward.

Tool Count1/5

A server named 'Expense Tracker' offers only two tools that perform unrelated operations (dice rolling and arithmetic). This is a severe mismatch between scope and purpose, making the count completely inappropriate.

Completeness1/5

The tools do not cover any expense tracking functionality whatsoever—no add expense, list expenses, delete expense, or summaries. The surface is entirely incomplete for the stated domain.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    D
    maintenance
    A simple demonstration MCP server that provides basic utility tools including dice rolling and number addition functionality. This server serves as a tutorial example for setting up both local and remote MCP servers using FastMCP.
    3
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables rolling dice with customizable sides and counts, returning results and totals via MCP Streamable HTTP transport.
    -