YNAB MCP Starter
A production-ready TypeScript starter for building read-only YNAB MCP servers. It provides secure, validated access to YNAB financial data including budgets, accounts, categories, and transactions through structured tools.
README
YNAB MCP Starter
Production-style TypeScript starter repo for a read-only YNAB MCP server.
This starter is intentionally small and explicit:
- Node.js 18+
- TypeScript with strict compiler settings
- Zod-validated tool inputs and outputs
- Read-only YNAB API client with retries and timeout handling
- Unit tests with mocked YNAB responses
- Clear TODO markers where MCP transport wiring should be connected
What This Repo Includes
src/
clients/ YNAB API client, environment config, and error types
schemas/ strict Zod schemas for tool contracts
server/ MCP server composition and transport TODO placeholders
tools/ read-only business logic for each YNAB capability
types/ shared API and service types
tests/ unit tests with mocked API responses
Implemented read-only capabilities:
- list budgets
- list accounts
- list categories
- list recent transactions
- find uncategorized transactions
- monthly spend by category
Write access is intentionally not implemented.
Setup
- Install dependencies:
npm install
- Copy the example environment file:
cp .env.example .env
- Set your YNAB token in
.env:
YNAB_TOKEN=your-token-here
- Run local development mode:
npm run dev
Scripts
npm run buildcompiles TypeScript intodist/npm run devruns the starter entrypoint with file watchingnpm run lintruns ESLintnpm run testruns unit tests with Vitestnpm run typecheckruns TypeScript in no-emit mode
MCP Wiring
The repo includes the server composition layer, but it does not lock you into one transport yet.
Look for TODO comments in:
That is where you should:
- Instantiate the MCP server
- Register tool definitions and schemas
- Connect stdio, SSE, or another transport
- Add structured logging and operational hooks
Security Notes
- This starter expects a
YNAB_TOKENpersonal access token in environment variables. - Never hardcode the token in source files, tests, prompts, or logs.
- Keep the token scoped to read-only operational use and rotate it if it is exposed.
- Avoid logging raw YNAB API responses in production because they may contain transaction memos or other sensitive financial metadata.
- This starter only performs
GETrequests to the YNAB API. No write endpoints are implemented.
Design Notes
- The YNAB client centralizes retries, timeout handling, and error normalization.
- Tool modules are isolated from HTTP details and operate on a small service interface.
- Zod schemas validate both tool inputs and tool outputs to catch drift early.
- Money amounts are exposed in both YNAB milliunits and human-friendly decimal amounts.
- Monthly category spend only counts outflows for the requested month.
Example Prompts
- "List my YNAB budgets."
- "Show the accounts in budget
budget-id-123." - "List categories for budget
budget-id-123." - "Show the most recent 20 transactions in budget
budget-id-123." - "Find uncategorized transactions in budget
budget-id-123since2026-04-01." - "Summarize monthly spend by category for budget
budget-id-123in2026-04."
Testing
The tests mock YNAB API responses so you can validate behavior without a live token:
npm run test
Production Hardening Ideas
- Add request correlation IDs and structured logs
- Add metrics around retries, rate limiting, and latency
- Add integration tests against a mocked HTTP layer
- Add result pagination controls if your MCP client expects larger result sets
- Add a secrets manager integration instead of local
.envfiles for deployment
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.