expense-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@expense-mcp add 15 and 27"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
expense-mcp
A minimal FastMCP server that exposes demo tools for arithmetic and dice rolls. Use it to learn MCP wiring with Claude Desktop or other MCP clients.
Requirements
Python 3.13+ (see
.python-version/pyproject.toml)uv for environments and dependency management
Related MCP server: Calculator MCP Server
Setup with uv (step by step)
Follow these in order on a machine that does not have the project set up yet.
1. Install uv
Pick the official installer for your OS. Common one-liners:
Windows (PowerShell):
irm https://astral.sh/uv/install.ps1 | iexmacOS / Linux:
curl -LsSf https://astral.sh/uv/install.sh | shClose and reopen the terminal (or reload your shell profile) so uv is on your PATH.
2. Confirm uv
uv --version3. Get the code
Clone the repository and move into it (use your real clone URL or path):
git clone <repository-url> expense-mcp
cd expense-mcpIf you already have the folder unpacked, just cd to the repo root (where pyproject.toml lives).
4. (Optional) Install a matching Python with uv
If you do not have Python 3.13 available, uv can fetch one:
uv python install 3.13The repo’s .python-version pins 3.13; uv sync will respect that when creating the environment.
5. Create the virtual environment and install dependencies
From the repo root:
uv syncThis will:
Create
.venvif it is missing (or update it to match the lockfile)Install packages from
pyproject.tomlusing versions fromuv.lock
If you prefer to create the venv yourself first (optional):
uv venv --python 3.13
uv sync6. (Optional) Activate the virtual environment
You do not need activation if you always use uv run … (recommended). To activate:
Windows (PowerShell):
.venv\Scripts\Activate.ps1Windows (cmd):
.venv\Scripts\activate.batmacOS / Linux:
source .venv/bin/activate
7. Verify the install
uv run fastmcp --version
uv run python --versionYou should see a FastMCP version and Python 3.13.x.
Quick reference (after setup)
Goal | Command |
Reinstall deps from lockfile |
|
Add a new dependency |
|
Refresh |
|
Run a one-off command in the project env |
|
Run the server
Development / inspector (useful for debugging tools in the browser):
uv run fastmcp dev inspector main.pyProduction-style run (stdio transport for MCP clients):
uv run fastmcp run main.pyDirect Python (stdio, same entry as if __name__ == "__main__"):
uv run python main.pyTools (API)
Defined in main.py:
Tool | Description |
| Rolls |
|
|
|
|
|
|
Docstrings on each function are what MCP clients show as tool descriptions.
Install into Claude Desktop
uv run fastmcp install claude-desktop main.pyThen:
Restart Claude Desktop fully (quit the app, not only the window).
In settings, ensure the expense-mcp (or similarly named) server is enabled.
If the install command errors (especially on Windows), see Claude Desktop: config path / install fails.
Troubleshooting
Use this section when something fails or behaves unexpectedly. Work from the top of each subsection that matches your symptom.
uv and Python
Symptom | What to try |
| Install uv (see Setup), then restart the terminal. Confirm install docs for your OS put |
| Run |
Packages seem missing | From repo root: |
“No |
|
Windows: PowerShell and scripts
Symptom | What to try |
Running | For your user only: |
Activation not needed | Using |
Server / dev inspector
Symptom | What to try |
| Run with |
Inspector / dev command errors | Run from repo root; pass |
Stdio server exits immediately | In a terminal: |
Claude Desktop: MCP does not connect or server errors
Symptom | What to try |
Server disabled | Settings → MCP: turn on the expense-mcp entry; restart Claude. |
Wrong working directory | The MCP process must run with |
| Use the full path to |
JSON config mistakes | Open |
Manual config shape (illustrative) — names and keys follow your Claude Desktop version; adjust paths:
"mcpServers": {
"expense-mcp": {
"command": "C:\\Users\\you\\AppData\\Local\\Programs\\uv\\uv.exe",
"args": ["run", "fastmcp", "run", "main.py"],
"cwd": "C:\\path\\to\\expense-mcp"
}
}On macOS/Linux use forward slashes and typical uv location from which uv. Re-installing via fastmcp install is usually easier than hand-editing.
Claude Desktop: config path or install fails (Windows Store and paths)
Classic path (many installers): %APPDATA%\Claude (contains claude_desktop_config.json).
Microsoft Store build often uses:
%LOCALAPPDATA%\Packages\Claude_<id>\LocalCache\Roaming\Claude
If fastmcp install claude-desktop says Claude has no config folder or cannot find it:
Environment variable — set the directory that actually holds
claude_desktop_config.json(names depend on FastMCP version):FASTMCP_CLAUDE_DESKTOP_CONFIG_DIR, orCLAUDE_DESKTOP_CONFIG_DIR
Then runuv run fastmcp install claude-desktop main.pyagain in the same terminal session.
Patch in
.venv(advanced) — Patchingfastmcp\cli\install\claude_desktop.pyunder.venvcan teach the installer to scanPackages\Claude_*\LocalCache\Roaming\Claude. Any lateruv syncor fresh venv removes that patch — re-apply or use option 1 or 3.Directory junction — If
%APPDATA%\Claudedoes not already exist as a real folder, junction it to the Store path (adjust<your-id>; may need an elevated cmd):mklink /J "%APPDATA%\Claude" "%LOCALAPPDATA%\Packages\Claude_<your-id>\LocalCache\Roaming\Claude"Then run
uv run fastmcp install claude-desktop main.pyagain.
Upstream FastMCP may add first-class support for the Store layout so patching or junctions are unnecessary.
Assistant answers without using your tools
A normal-looking answer (e.g. “8 + 10 = 18”) does not prove the MCP ran. Check for tool-use in the UI or force a unique tool.
UI — Look for a tool / “used …” step, not only the final message.
Explicit instruction — e.g. “Use the
add_numberstool from expense-mcp for 8 and 10 and state that you used the tool.”Unique tool — e.g. “Call
roll_dicewithn_dice=4.” Matching tool name and die results implicates this server (unless another MCP defines the same tool name).Proof tool — Add a tiny tool in
main.pythat returns a string only this project would emit; call it once and compare the tool output.
Patches or local edits under .venv disappeared
Anything changed only inside .venv (including hand-patched FastMCP files) is replaced when you run uv sync, delete .venv, or reinstall deps. Prefer env vars, junctions, or documented config over long-lived venv edits; otherwise re-apply the patch after each sync.
Project layout
Path | Role |
| FastMCP server and |
| Package metadata and dependencies |
| Locked dependency versions |
Available Tools
3 toolsadd_expenseA
Insert one expense row and return the new row id.
Args:
date: Calendar date of the expense, preferably YYYY-MM-DD.
amount: Monetary amount (positive number).
category: High-level label (e.g. food, transport).
subcategory: Optional finer grouping (default empty string).
note: Optional free text (default empty string).
Returns:
A dict with status "ok" and id set to the new SQLite
INTEGER PRIMARY KEY, or None if the driver does not expose it.
Inputs: date (required), amount (required), category (required), note, +1 more. Returns: object
list_expensesA
Return all expenses with date between start_date and end_date, inclusive.
Rows are ordered by id ascending.
Args:
start_date: Range start, YYYY-MM-DD recommended.
end_date: Range end, YYYY-MM-DD recommended.
Returns:
List of dicts with keys id, date, amount, category,
subcategory, note.
Inputs: end_date (required), start_date (required). Returns: result
summarizeA
Aggregate total spend per category over a date range.
Args:
start_date: Range start, YYYY-MM-DD recommended.
end_date: Range end, YYYY-MM-DD recommended.
category: If set, only this category is included in the aggregation.
Returns:
List of dicts with keys category and total_amount (sum of
amount). Sorted by category ascending.
Inputs: end_date (required), start_date (required), category. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a distinct purpose: adding an expense, listing expenses by date range, and summarizing spending by category. There is no overlap or ambiguity.
All tool names follow a consistent verb_noun pattern using snake_case (add_expense, list_expenses, summarize). The pattern is predictable and clear.
With 3 tools, the server is well-scoped for its purpose of basic expense tracking. The count is neither too few nor too many for the apparent domain.
The tool surface covers adding, listing, and summarizing expenses, which covers core use cases. However, it lacks update and delete operations, which are minor gaps for complete lifecycle management.
Related MCP Connectors
MCP server for progressive tool usage at any scale (see https://klavis.ai)
A simple MCP server built with FastMCP and python
This MCP server enables users to perform scientific computations regarding linear algebra and vect…
Educational MCP server with 17 math/stats tools, visualizations, and persistent workspace
Related MCP Servers
- FlicenseBqualityDmaintenanceA 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-
- FlicenseNot gradedqualityDmaintenanceA simple MCP server that provides basic calculator functionality for performing mathematical operations. Built with FastMCP and demonstrates fundamental MCP server implementation patterns.-
- FlicenseNot gradedqualityDmaintenanceA sample MCP server that provides basic arithmetic tools like addition, subtraction, multiplication, and division. It serves as a demonstration for implementing the Model Context Protocol and connecting custom tools to clients like Claude Desktop.-
- AlicenseNot gradedqualityDmaintenanceEnables basic arithmetic operations (add, subtract, multiply, divide, modulo) via natural language, with a FastMCP-based server and client for exploring MCP tool calling.MIT