CryptoJym/freshbooks-mcp-server
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.
๐ FreshBooks Inventory MCP Server
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
- Go to FreshBooks Developer Portal
- Create a new application
- Set redirect URI to:
http://localhost:8080/callback
- 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
Tool | Description | Example |
---|---|---|
list_items | List inventory with filters | mcp call list_items |
get_item | Get item by ID | mcp call get_item '{"item_id": 123}' |
create_item | Create new item | mcp call create_item '{"item_data": {...}}' |
update_item | Update existing item | mcp call update_item '{"item_id": 123, "updates": {...}}' |
delete_item | Delete item | mcp call delete_item '{"item_id": 123}' |
search_items_by_sku | Find by SKU | mcp call search_items_by_sku '{"sku": "ABC-123"}' |
get_low_inventory_items | Find low stock | mcp call get_low_inventory_items '{"threshold": 10}' |
bulk_update_inventory | Update multiple items | mcp 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
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit changes:
git commit -m 'Add amazing feature'
- Push to branch:
git push origin feature/amazing-feature
- Open a Pull Request
๐ License
This project is licensed under the MIT License - see the file for details.
๐ Support
- ๐ Check the first
- ๐ Report bugs
- ๐ก Request features
- ๐ฌ Discussions
Built with โค๏ธ by h3ro-dev
Making FreshBooks inventory management effortless for developers