pocketsmith-mcp

pocketsmith-mcp

Enables interaction with the PocketSmith personal finance API through 43 MCP tools for managing accounts, transactions, budgets, categories, and more.

Category
访问服务器

README

<p align="center"> <h1 align="center">PocketSmith MCP Server</h1> <p align="center"> <strong>A production-ready MCP server for the PocketSmith personal finance API</strong> </p> </p>

<p align="center"> <img src="assets/demo.gif" alt="PocketSmith MCP Demo" width="700"> </p>

<p align="center"> <a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/python-3.10%2B-blue.svg" alt="Python 3.10+"></a> <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License: MIT"></a> <a href="https://pypi.org/project/pocketsmith-mcp/"><img src="https://img.shields.io/pypi/v/pocketsmith-mcp?color=blue" alt="PyPI"></a> <img src="https://img.shields.io/badge/tests-180%20passed-brightgreen" alt="Tests: 180 passed"> <img src="https://img.shields.io/badge/coverage-86%25-brightgreen" alt="Coverage: 86%"> </p>

<p align="center"> <a href="#features">Features</a> • <a href="#quick-start">Quick Start</a> • <a href="#available-tools">Tools</a> • <a href="#testing">Testing</a> • <a href="#development">Development</a> </p>


Features

  • 43 MCP Tools - Complete coverage of PocketSmith API v2 endpoints
  • Production Ready - Rate limiting, retry with exponential backoff, circuit breaker
  • Universal Compatibility - Works with Claude Desktop, Cursor, and any MCP-compatible client
  • Type Safe - Pydantic models for all API entities

Quick Start

Installation

# Run directly with uvx (recommended)
uvx pocketsmith-mcp

# Or install with pip
pip install pocketsmith-mcp

Getting Your API Key

  1. Navigate to Security & Integrations - Click your profile icon, then select "Security & integrations"

<p align="center"> <img src="assets/api-key-step1-security-integrations.png" alt="Navigate to Security & Integrations" width="500"> </p>

  1. Create a Developer Key - Go to "Manage developer keys" and click "Create Key"

<p align="center"> <img src="assets/api-key-step2-create-key.png" alt="Create Developer Key" width="500"> </p>

Configuration

  1. Set your environment variable:
export POCKETSMITH_API_KEY=your_api_key_here
  1. Run the server:
uvx pocketsmith-mcp

Claude Desktop Integration

Add to your Claude Desktop config:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "pocketsmith": {
      "command": "uvx",
      "args": ["pocketsmith-mcp"],
      "env": {
        "POCKETSMITH_API_KEY": "your_api_key_here"
      }
    }
  }
}

Available Tools

<details> <summary><strong>User Management</strong></summary>

Tool Description
get_current_user Get authenticated user info
get_user Get user by ID
update_user Update user settings

</details>

<details> <summary><strong>Account Management</strong></summary>

Tool Description
list_accounts List all accounts
get_account Get account details
update_account Update account
delete_account Delete account

</details>

<details> <summary><strong>Transaction Accounts</strong></summary>

Tool Description
list_transaction_accounts List transaction accounts
get_transaction_account Get transaction account details
update_transaction_account Update transaction account

</details>

<details> <summary><strong>Transactions</strong></summary>

Tool Description
list_transactions List transactions with filters
get_transaction Get transaction details
create_transaction Create new transaction
update_transaction Update transaction
delete_transaction Delete transaction

</details>

<details> <summary><strong>Categories</strong></summary>

Tool Description
list_categories List all categories
get_category Get category details
create_category Create new category
update_category Update category
delete_category Delete category

</details>

<details> <summary><strong>Budgeting</strong></summary>

Tool Description
get_budget Get budget data
get_budget_summary Get budget summary
get_trend_analysis Get spending trends
clear_forecast_cache Clear forecast cache

</details>

<details> <summary><strong>Institutions</strong></summary>

Tool Description
list_institutions List financial institutions
get_institution Get institution details
create_institution Create institution
update_institution Update institution
delete_institution Delete institution

</details>

<details> <summary><strong>Events (Budget Calendar)</strong></summary>

Tool Description
list_events List budget events
get_event Get event details
create_event Create budget event
update_event Update event
delete_event Delete event

</details>

<details> <summary><strong>Attachments</strong></summary>

Tool Description
list_attachments List attachments
get_attachment Get attachment details
create_attachment Upload attachment
update_attachment Update attachment
delete_attachment Delete attachment

</details>

<details> <summary><strong>Labels & Searches</strong></summary>

Tool Description
list_labels List all labels
list_saved_searches List saved searches

</details>

<details> <summary><strong>Utilities</strong></summary>

Tool Description
list_currencies List supported currencies
list_time_zones List supported time zones

</details>


Testing

Running Tests

# Run all tests
uv run pytest

# Run with coverage report
uv run pytest --cov=src/pocketsmith_mcp --cov-report=term-missing

# Run specific test file
uv run pytest tests/unit/tools/test_transactions.py

# Run tests by marker
uv run pytest -m unit          # Unit tests only
uv run pytest -m integration   # Integration tests only
uv run pytest -m e2e           # End-to-end tests (requires API key)

Test Structure

tests/
├── unit/                 # Fast, isolated tests with mocked API
│   ├── test_api_client.py
│   ├── test_errors.py
│   ├── test_rate_limiter.py
│   ├── test_circuit_breaker.py
│   ├── test_user_context.py
│   └── tools/            # Tool-specific unit tests
├── integration/          # Tests with mocked HTTP responses
│   ├── test_server.py
│   └── test_tools.py
└── conftest.py           # Shared fixtures

Coverage

The project maintains a 70% coverage threshold. Coverage reports are generated automatically:

uv run pytest --cov=src/pocketsmith_mcp --cov-report=html
open htmlcov/index.html

Development

Setup

# Clone the repository
git clone https://github.com/ajanderson1/mcp_pocketsmith.git
cd pocketsmith-mcp

# Install dependencies (including dev)
uv sync --dev

# Copy environment template
cp .env.example .env
# Edit .env and add your API key

Architecture

pocketsmith-mcp/
├── src/pocketsmith_mcp/
│   ├── __main__.py       # Entry point
│   ├── server.py         # FastMCP server setup
│   ├── config.py         # Environment configuration
│   ├── client/           # API client with resilience patterns
│   │   ├── api_client.py     # HTTP client wrapper
│   │   ├── rate_limiter.py   # Token bucket algorithm
│   │   ├── circuit_breaker.py # Fault tolerance
│   │   └── retry.py          # Exponential backoff
│   ├── models/           # Pydantic data models
│   └── tools/            # MCP tool implementations
└── tests/                # Unit and integration tests

API Resilience

The client includes production-grade resilience:

  • Rate Limiting - Token bucket algorithm (60 req/min default)
  • Retry Logic - Exponential backoff with jitter for transient failures
  • Circuit Breaker - Prevents cascade failures during outages

Environment Variables

Variable Required Default Description
POCKETSMITH_API_KEY Yes - Your PocketSmith API key
DEBUG No false Enable debug logging
API_TIMEOUT No 30 Request timeout (seconds)
MAX_RETRIES No 3 Retry attempts for failed requests
RATE_LIMIT_PER_MINUTE No 60 API rate limit

License

This project is licensed under the MIT License - see the LICENSE file for details.


<p align="center"> Made with Python and FastMCP </p>

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选