Skip to main content
Glama
wutchara

Local Fintech MCP Server

by wutchara

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 build

3. 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 -d

You can use the official MCP Inspector to test the server directly from your browser:

npx @modelcontextprotocol/inspector node dist/index.js

Open 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.json

Step 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!

  1. Completely quit Claude Desktop (Cmd + Q) and reopen it.

  2. Look for the plug/hammer icon 🔌 in the Claude interface, indicating the plugin loaded successfully.

  3. 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 tools
flag_anomaliesB

Returns transactions for a user that exceed the provided threshold amount.

ParametersJSON Schema
NameRequiredDescriptionDefault
userIdYesThe ID of the user
thresholdYesThe threshold amount to flag transactions above

TDQS

B3.1/5.0
Behavior2/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 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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
userIdYesThe ID of the user to get transactions for

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 2 tool updatesv1.0.0
    • First observedflag_anomalies
    • First observedget_user_transactions

TDQS

B3/5.0

Scored across 2 tools

Disambiguation3/5

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.

Naming Consistency4/5

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.

Tool Count2/5

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.

Completeness2/5

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

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    2
    ISC
  • F
    license
    C
    quality
    D
    maintenance
    Enables 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
    -