Pocketsmith MCP Server

Pocketsmith MCP Server

Enables AI assistants to interact with the Pocketsmith personal finance API to manage accounts, budgets, and transactions through natural language. It supports comprehensive financial tasks including spending analysis, category management, and tracking recurring bills.

Category
访问服务器

README

Pocketsmith MCP Server

A comprehensive Model Context Protocol (MCP) server for the Pocketsmith personal finance API. Transform your AI assistant into a powerful financial management tool with access to accounts, budgets, transactions, and more.

PyPI version Python 3.11+ License: MIT

✨ Features

💰 Account Management

  • View all account balances (checking, savings, credit cards, investments)
  • Get detailed account information with transaction history
  • Track net worth across multiple accounts

📊 Budget & Analysis

  • Get budget summaries for any time period
  • Analyze per-category spending vs. budgets
  • View spending trends across categories
  • Compare actual vs. forecasted amounts

💳 Transaction Management

  • List, search, and filter transactions
  • Create new transactions (log cash purchases, manual entries)
  • Update transaction details (categorize, add notes, set labels)
  • Delete duplicate or incorrect transactions
  • Filter by account, category, date range, or review status

📁 Category Management

  • List all categories with hierarchical structure
  • Create new categories and subcategories
  • Set up automatic categorization rules
  • Organize spending into custom categories

🔄 Recurring Transactions

  • View upcoming bills and recurring expenses
  • Create recurring events (rent, subscriptions, paychecks)
  • Forecast future cash flow
  • Manage budget scenarios

🏷️ Labels & Organization

  • List and manage transaction labels
  • Tag transactions for easy filtering
  • Track tax-deductible expenses, business spending, etc.

📦 Installation

Quick Start with uvx (Recommended)

The fastest way to try it out:

uvx pocketsmith-mcp

Install via pip

pip install pocketsmith-mcp

Install from source

git clone https://github.com/dannyshaw/pocketsmith-mcp.git
cd pocketsmith-mcp
pip install -e .

🔑 Configuration

Get Your API Key

  1. Log in to Pocketsmith
  2. Go to Settings → API & Developers
  3. Click Generate New API Key
  4. Copy your API key

⚠️ Security: Treat your API key like a password. It has full access to your financial data.

Set Environment Variable

export POCKETSMITH_API_KEY=your_api_key_here

Or create a .env file:

echo "POCKETSMITH_API_KEY=your_api_key_here" > .env

🚀 Usage

With Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

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

With Claude Code

Add to ~/.claude/claude_desktop_config.json:

{
  "mcpServers": {
    "pocketsmith": {
      "command": "pocketsmith-mcp",
      "env": {
        "POCKETSMITH_API_KEY": "your_api_key_here"
      }
    }
  }
}

Standalone

Run the server directly:

pocketsmith-mcp

💬 Example Conversations

Once configured, you can ask your AI assistant:

Account & Budget Queries

  • "What are my account balances?"
  • "Show me my credit card balance"
  • "Am I over budget this month?"
  • "What's my spending trend for groceries over the last 3 months?"

Transaction Management

  • "List transactions from my checking account this week"
  • "Log a $50 cash purchase at the grocery store"
  • "Categorize that Amazon transaction as Household"
  • "Delete transaction #12345"

Bills & Recurring Expenses

  • "What bills are coming up this month?"
  • "Create a recurring monthly rent payment of $2000"
  • "Show me all my subscriptions"

Categories & Organization

  • "Create a new category called 'Pet Expenses'"
  • "Show me all transactions in the Dining Out category"
  • "Set up a rule to auto-categorize Starbucks as Coffee"

🛠️ Available Tools (23 total)

Account Tools

Tool Description
pocketsmith_list_accounts List all accounts with balances
pocketsmith_get_account Get detailed account information
pocketsmith_list_transaction_accounts List transaction accounts with details

Budget & Analysis Tools

Tool Description
pocketsmith_get_budget_summary Get budget summary for a date range
pocketsmith_list_budget Per-category budget analysis
pocketsmith_get_trend_analysis Spending trends across categories

Transaction Tools

Tool Description
pocketsmith_list_transactions List transactions with filters
pocketsmith_list_transactions_by_account Filter transactions by account
pocketsmith_list_transactions_by_category Filter transactions by category
pocketsmith_get_transaction Get transaction details
pocketsmith_create_transaction Create new transaction
pocketsmith_update_transaction Update transaction details
pocketsmith_delete_transaction Delete a transaction
pocketsmith_search_transactions Search by keyword
pocketsmith_categorize_transaction Quick categorization

Category Tools

Tool Description
pocketsmith_list_categories List all categories
pocketsmith_create_category Create new category
pocketsmith_list_category_rules List auto-categorization rules
pocketsmith_create_category_rule Create categorization rule

Event Tools (Recurring Transactions)

Tool Description
pocketsmith_list_events List recurring transactions
pocketsmith_create_event Create recurring transaction

Other Tools

Tool Description
pocketsmith_list_labels List all transaction labels
pocketsmith_get_status Check connection status

🔒 Security

This Server Can

  • ✅ Read all your financial data (transactions, accounts, balances)
  • ✅ Create, update, and delete transactions
  • ✅ Modify categories and create rules
  • ✅ Access budget and forecast data

Security Best Practices

  • ✅ Store API keys in environment variables (never in code)
  • ✅ Use different API keys for development vs. production
  • ✅ Rotate API keys periodically
  • ✅ Only use with trusted AI assistants on secure machines
  • ❌ Never commit API keys to version control
  • ❌ Never share API keys publicly

See SECURITY.md for detailed security information.

📊 API Coverage

20 out of 44 Pocketsmith API endpoints (45%)

Focused on the most useful endpoints for personal finance management:

  • ✅ User & account management
  • ✅ Transaction CRUD operations
  • ✅ Budget & trend analysis
  • ✅ Category management
  • ✅ Recurring events/bills
  • ✅ Labels & organization

🧪 Development

Setup

# Clone repository
git clone https://github.com/dannyshaw/pocketsmith-mcp.git
cd pocketsmith-mcp

# Install dependencies
uv sync

# Run tests
pytest

# Run tests with coverage
pytest --cov=src/pocketsmith_mcp

# Lint and format
ruff check .
ruff format .

# Type check
mypy src

Testing

# Run all tests
pytest -v

# Run specific test file
pytest tests/test_client.py -v

# Run with coverage report
pytest --cov=src/pocketsmith_mcp --cov-report=html

Project Structure

pocketsmith-mcp/
├── src/pocketsmith_mcp/
│   ├── __init__.py      # Package initialization
│   ├── client.py        # Pocketsmith API client
│   ├── config.py        # Configuration settings
│   └── server.py        # MCP server implementation
├── tests/
│   ├── conftest.py      # Test fixtures
│   └── test_client.py   # Client tests
├── pyproject.toml       # Project configuration
├── README.md            # This file
└── SECURITY.md          # Security documentation

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Write tests for your changes
  4. Ensure all tests pass (pytest)
  5. Commit your changes (git commit -m 'Add amazing feature')
  6. Push to the branch (git push origin feature/amazing-feature)
  7. Open a Pull Request

See CONTRIBUTING.md for detailed guidelines.

📝 License

MIT License - see LICENSE for details.

🙏 Acknowledgments

📞 Support

🗺️ Roadmap

Future enhancements:

  • [ ] Attachment management
  • [ ] Institution connections management
  • [ ] Budget calendar export
  • [ ] Spending analytics and insights
  • [ ] Multi-currency support enhancements
  • [ ] Batch transaction operations

Made with ❤️ for personal finance management

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选