freshbooks-mcp-server

CryptoJym/freshbooks-mcp-server

3.2

If you are the rightful owner of freshbooks-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The FreshBooks Inventory MCP Server is a robust solution designed for seamless integration of FreshBooks inventory management with AI assistants, utilizing the Model Context Protocol.

Tools
8
Resources
0
Prompts
0

๐Ÿš€ FreshBooks Inventory MCP Server

Python MCP License Status

A powerful Model Context Protocol server for FreshBooks inventory management

Built for developers who want seamless FreshBooks integration with AI assistants

Features โ€ข Quick Start โ€ข Documentation โ€ข Examples


โœจ Features

๐Ÿ” OAuth 2.0 Authentication - Secure FreshBooks API integration with automatic token refresh
๐Ÿ“ฆ Full CRUD Operations - Create, read, update, delete inventory items
๐Ÿ” Advanced Search - Find items by SKU, description, or inventory levels
โšก Bulk Operations - Update multiple items simultaneously
๐Ÿ›ก๏ธ Robust Error Handling - Comprehensive validation and clear error messages
๐Ÿ“Š Inventory Management - Track stock levels, costs, and product details
๐Ÿงช Production Ready - Tested, documented, and ready for deployment

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10+
  • A FreshBooks account with developer access
  • An MCP-compatible client (like Claude Desktop)

1๏ธโƒฃ Clone & Install

# Clone the repository
git clone https://github.com/h3ro-dev/freshbooks-mcp-server.git
cd freshbooks-mcp-server

# Install dependencies
pip install -r requirements.txt

2๏ธโƒฃ FreshBooks App Setup

  1. Go to FreshBooks Developer Portal
  2. Create a new application
  3. Set redirect URI to: http://localhost:8080/callback
  4. Save your Client ID and Client Secret

3๏ธโƒฃ Environment Configuration

# Copy the example environment file
cp .env.example .env

# Edit with your credentials
nano .env

Add your FreshBooks credentials:

FRESHBOOKS_CLIENT_ID=your_client_id_here
FRESHBOOKS_CLIENT_SECRET=your_client_secret_here
FRESHBOOKS_REDIRECT_URI=http://localhost:8080/callback

4๏ธโƒฃ Authentication Flow

# Start the server
python freshbooks_server.py

# In another terminal, get authorization URL
mcp call get_authorization_url

# Visit the URL, authorize, then exchange the code
mcp call exchange_authorization_code '{"authorization_code": "your_code_here"}'

Add the returned tokens to your .env:

FRESHBOOKS_ACCESS_TOKEN=your_access_token_here
FRESHBOOKS_REFRESH_TOKEN=your_refresh_token_here
FRESHBOOKS_ACCOUNT_ID=your_account_id_here

5๏ธโƒฃ Test Your Setup

# List your inventory items
mcp call list_items

# Create a test item
mcp call create_item '{
  "item_data": {
    "name": "Test Product",
    "sku": "TEST-001",
    "inventory": "100"
  }
}'

๐Ÿ› ๏ธ Available Tools

ToolDescriptionExample
list_itemsList inventory with filtersmcp call list_items
get_itemGet item by IDmcp call get_item '{"item_id": 123}'
create_itemCreate new itemmcp call create_item '{"item_data": {...}}'
update_itemUpdate existing itemmcp call update_item '{"item_id": 123, "updates": {...}}'
delete_itemDelete itemmcp call delete_item '{"item_id": 123}'
search_items_by_skuFind by SKUmcp call search_items_by_sku '{"sku": "ABC-123"}'
get_low_inventory_itemsFind low stockmcp call get_low_inventory_items '{"threshold": 10}'
bulk_update_inventoryUpdate multiple itemsmcp call bulk_update_inventory '{"updates": [...]}'

๐Ÿ“š Documentation

  • - Detailed tool documentation
  • - Comprehensive examples and workflows
  • - Validation and error management

๐ŸŽฏ Common Use Cases

Inventory Restock Workflow

# Check low inventory
mcp call get_low_inventory_items '{"threshold": 20}'

# Bulk update restocked items
mcp call bulk_update_inventory '{
  "updates": [
    {"item_id": 123, "inventory": "100"},
    {"item_id": 124, "inventory": "75"}
  ]
}'

Product Search & Update

# Find product by SKU
mcp call search_items_by_sku '{"sku": "LAPTOP-001"}'

# Update inventory count
mcp call update_inventory_count '{"item_id": 123, "new_count": "85"}'

๐Ÿ”ง Development

Run Tests

python test_server.py

Code Quality

# Format code
black freshbooks_server.py error_handling.py

# Type checking
mypy freshbooks_server.py

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

๐Ÿ“„ License

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

๐Ÿ†˜ Support


Built with โค๏ธ by h3ro-dev

Making FreshBooks inventory management effortless for developers