Local Fintech MCP Server
Provides tools for querying a local PostgreSQL financial database, exposing a transactions table (id, user_id, amount, merchant, timestamp) via MCP tools such as get_user_transactions to retrieve a user's recent mock transactions and flag_anomalies to surface transactions exceeding a given threshold.
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., "@Local Fintech MCP Serverget user456's recent transactions and flag anything over $50"
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.
Project 1: The Local Fintech MCP Server
The Scenario You need to build a local backend service that exposes a mock financial database to an AI agent. The agent must be able to securely query this server to retrieve a user's transaction history and flag potential anomalies (e.g., unusually high spending).
The Requirements
Core Stack: TypeScript with Node.js (or NestJS/Go if you prefer to prompt for that) and PostgreSQL.
Infrastructure: The database must be spun up locally using Docker.
The Interface: The service must implement the Model Context Protocol (MCP).
The Tools: Expose exactly two MCP tools to the agent:
get_user_transactions(userId): Returns a JSON array of recent mock transactions.flag_anomalies(userId, threshold): Returns transactions for a user that exceed the provided threshold amount.
Your Agentic Practice Step
Your task is to craft the overarching instructions for your local AI agent to scaffold this entire setup. You want the agent to generate the docker-compose.yml, the database schema, the mock data seed script, and the MCP server code.
Starter Prompt (Feed this to your local AI tool):
Act as a senior backend engineer. I need to build a local Model Context Protocol (MCP) server in TypeScript/Node.js that interacts with a PostgreSQL database.
Please perform the following steps sequentially:
1. Create a docker-compose.yml for a PostgreSQL database.
2. Write a script to initialize a 'transactions' table (id, user_id, amount, merchant, timestamp) and seed it with 20 mock financial records.
3. Scaffold an MCP server using the official SDK that connects to this database.
4. Implement two MCP tools: 'get_user_transactions' and 'flag_anomalies'.
Ask me to review the Docker setup before proceeding to the Node.js implementation.Related MCP server: ExpenseTracker MCP Server
🚀 How to Run and Test
1. Prerequisites
Docker: Must be installed and running (e.g., Docker Desktop).
Node.js: Ensure Node is installed (v18+ recommended).
2. Setup & Build
Install dependencies and build the TypeScript code:
npm install
npm run build3. Start the Database
Spin up the local PostgreSQL database using Docker. This will automatically run the seed script to populate mock transactions.
docker-compose up -d4. Test via MCP Inspector (Recommended)
You can use the official MCP Inspector to test the server directly from your browser:
npx @modelcontextprotocol/inspector node dist/index.jsOpen the provided URL (typically http://localhost:5173) in your browser to interactively test the get_user_transactions and flag_anomalies tools.
5. Install as a Plugin in Claude Desktop
To use this server as a true AI plugin, you can connect it to an MCP-compatible client like the Claude Desktop app.
Step 1: Open Claude's configuration file Open your terminal and run this command (for Mac):
nano ~/Library/Application\ Support/Claude/claude_desktop_config.jsonStep 2: Add your server
Paste the following JSON, ensuring it points to the absolute path of your dist/index.js file:
{
"mcpServers": {
"local-fintech-db": {
"command": "node",
"args": [
"/Users/wutchararachadach/Documents/HAM/ai-agent-local/problem-practices/The Local Fintech MCP Server/dist/index.js"
]
}
}
}Step 3: Restart and Chat!
Completely quit Claude Desktop (
Cmd + Q) and reopen it.Look for the plug/hammer icon 🔌 in the Claude interface, indicating the plugin loaded successfully.
Try asking it natural questions like:
"Can you get the transaction history for user456 from my fintech database?"
"Are there any anomalies for user123 over a threshold of $50?"
Available Tools
2 toolsflag_anomaliesB
Returns transactions for a user that exceed the provided threshold amount.
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | The ID of the user | |
| threshold | Yes | The threshold amount to flag transactions above |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It signals a read-only operation via 'Returns', but gives no information about permissions, error handling, pagination, rate limits, or the format of the returned transactions.
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, front-loaded sentence that conveys the essential action and filter condition without any filler or redundancy. It is appropriately sized for a simple tool.
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 and fully documented parameters, the description is minimally adequate. However, with no annotations and no output schema, it should ideally describe the return format or behavior more fully; the current text leaves the agent guessing about what 'transactions' includes.
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%, meaning both parameters are already well-documented in the schema. The description adds no new semantic detail beyond restating the threshold condition, so the baseline score 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 states a specific verb (Returns), resource (transactions), scope (for a user), and filtering condition (exceed threshold). This clearly distinguishes it from a generic transaction list tool, though it never explicitly names the sibling 'get_user_transactions' as an alternative.
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 explicit guidance on when to use this tool versus the sibling tool 'get_user_transactions'. The threshold condition implies a filtered view, but the description neither states use cases nor mentions alternatives or exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_user_transactionsB
Returns a JSON array of recent mock transactions for a given user.
| Name | Required | Description | Default |
|---|---|---|---|
| userId | Yes | The ID of the user to get transactions for |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full behavioral burden. It discloses only that the return is a JSON array of recent mock transactions; it omits whether the operation is read-only, what 'recent' means, pagination behavior, error handling, and permission requirements.
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?
A single front-loaded sentence with no filler. Every word contributes to identifying the resource and return format.
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 simple one-parameter getter, the description gives the return type and data nature ('mock', 'recent'), which is useful since no output schema exists. However, it leaves out usage context relative to its sibling and behavioral details like pagination or permissions.
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 already fully documents the single userId parameter (100% coverage), and the description adds no extra semantic detail beyond restating that transactions are for a given user. Baseline 3 is appropriate when the schema does the heavy lifting.
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?
States a specific verb ('Returns'), resource ('JSON array of recent mock transactions'), and target ('for a given user'). It is clear what the tool does, but it does not differentiate itself from the sibling tool flag_anomalies.
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?
Provides no when-to-use guidance, prerequisites, or comparison to the sibling tool flag_anomalies. The implied usage is only that it fetches transactions for a user, but no conditions or alternatives are stated.
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.
2 tool updates
v1.0.0- First observed
flag_anomalies - First observed
get_user_transactions
TDQS
Scored across 2 tools
Both tools return transactions for a user, so they overlap substantially in output shape; only the threshold filter distinguishes flag_anomalies. Descriptions clarify the difference somewhat, but an agent could reasonably confuse the two.
Both names use a consistent snake_case verb_noun style (get_user_transactions, flag_anomalies). The only minor deviation is that flag_anomalies omits an explicit resource noun, but the pattern is still readable and predictable.
Two tools is thin for a fintech domain that implies accounts, transactions, and anomaly workflows. The surface feels like a stub rather than a scoped toolset.
There is read-only coverage of transactions plus a single filtered view, with no create/update/delete, no account or user management, and no way to act on flagged anomalies. Major lifecycle gaps would block most realistic fintech workflows.
Maintenance
Related MCP Connectors
Deterministic safety, correctness & cost gate that vets Postgres SQL before your AI agent runs it.
- Era ContextOAuthapp.era
Personal finance, bank account, and shared memory connector for Claude, ChatGPT, Gemini Spark & more
Query PostgreSQL databases in plain English — LLM-generated, safety-validated SQL.
- BankSyncOAuthio.banksync
Connect AI agents to bank accounts, transactions, balances, and investments.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to analyze personal financial data from Open Banking sources stored in PostgreSQL database. Provides educational financial analysis tools with intelligent formatting for learning about spending patterns, account balances, and transaction history.2ISC
- FlicenseCqualityDmaintenanceEnables AI assistants to manage personal finances by storing, analyzing, and exporting expense data using a persistent PostgreSQL database. Supports adding/editing expenses, generating spending summaries, detecting top categories, and creating monthly reports.12-
- FlicenseNot gradedqualityDmaintenanceExposes PostgreSQL database operations as tools for AI assistants, allowing SQL queries and schema inspection.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with PostgreSQL databases through natural language queries, schema inspection, and safe SQL execution.91-