Provides comprehensive access to Xero accounting data including invoices, contacts, accounts, payments, and transactions. Enables AI assistants to query financial information, generate reports, create invoices and contacts, and perform accounting operations through Xero's API with OAuth 2.0 authentication.
Xero MCP Integration Server
Connect AI assistants to Xero accounting data seamlessly
Transform your Xero workflow with AI-powered insights and automation. This server enables AI assistants like Claude, ChatGPT, or any Model Context Protocol (MCP) compatible AI to securely access and analyze your Xero accounting data.
Features
Secure OAuth 2.0 Integration - Enterprise-grade authentication with Xero
AI Assistant Compatible - Works with Claude, ChatGPT, and other MCP clients
Real-time Data Access - Live synchronization with Xero accounting data
Enterprise Security - Encrypted tokens, CSRF protection, and audit logging
Comprehensive API Coverage - Invoices, contacts, accounts, payments, and more
Production Ready - Optimized for Vercel deployment with monitoring
What You Can Do
Instant Financial Insights - Ask "What's my cash flow trend this quarter?" Automated Reporting - Generate reports with natural language requests Smart Data Entry - AI-assisted invoice and transaction management Real-time Alerts - Get notified about important financial events Multi-tenant Support - Connect multiple Xero organizations
Quick Start
Get up and running in 3 minutes:
1. Clone & Install
2. Configure Environment
3. Start Development Server
Visit http://localhost:3000
and follow the OAuth flow to connect your Xero account!
📋 Table of Contents
Prerequisites
Before you begin, ensure you have:
Node.js 18+ - Download here
Xero Developer Account - Sign up
PostgreSQL Database - Local or cloud (Supabase, Railway, etc.)
Vercel Account (optional) - For deployment
Installation
Option 1: Local Development (Recommended)
Option 2: Using Docker
Option 3: Vercel One-Click Deploy
Configuration
Environment Variables
Create a .env.local
file in the project root:
Xero Developer Setup
Create Xero App
Go to Xero Developer Portal
Click "New App" and select "Web app"
Enter your app details
Configure OAuth 2.0
Set redirect URI to:
http://localhost:3000/api/auth/callback
Copy Client ID and Client Secret to your
.env.local
Set Permissions
Enable required scopes:
accounting.transactions
,accounting.contacts
, etc.
Database Setup
Usage
Connecting AI Assistants
Claude Desktop Integration
Add to your claude_desktop_config.json
:
ChatGPT Integration
Configure the MCP server URL in your ChatGPT settings:
Example Queries
Once connected, you can ask your AI assistant:
"Show me my outstanding invoices over $500"
"What's my total revenue for Q1 2024?"
"List all customers who haven't paid in 30 days"
"Create a summary of my cash flow this month"
"Find transactions with 'Office Supplies' in the description"
API Endpoints
Authentication
MCP Server
Health & Monitoring
Webhooks
📚 API Reference
MCP Tools Available
Tool | Description | Parameters |
| Chart of accounts |
,
,
|
| Customer/supplier contacts |
,
,
,
|
| Sales invoices |
,
,
,
|
| Inventory items |
,
|
| Payment records |
,
,
,
|
| New contact |
,
,
,
|
| New invoice |
,
,
,
|
| Update contact |
,
,
,
|
Response Format
Testing
Test Coverage
Unit Tests: Core functions and utilities
API Tests: HTTP endpoints and responses
Integration Tests: End-to-end OAuth and MCP flows
Component Tests: React component testing
Deployment
Vercel Deployment
Connect Repository
# Vercel will automatically detect Next.js vercel --prodEnvironment Variables
Add all environment variables in Vercel dashboard
Enable "Fluid Compute" for better performance
Set function timeout to 30 seconds for MCP operations
Database
Use Vercel Postgres or connect external PostgreSQL
Run migrations:
npx prisma migrate deploy
Docker Deployment
Production Checklist
Environment variables configured
Database migrations run
SSL certificates enabled
Monitoring and alerting set up
Backup procedures documented
Load testing completed
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
Fork & Clone
git clone https://github.com/your-username/xero-mcp-with-next-js.git cd xero-mcp-with-next-jsInstall Dependencies
npm installRun Tests
npm testStart Development
npm run dev
Code Standards
TypeScript: Strict type checking enabled
ESLint: Code linting with Next.js rules
Prettier: Automated code formatting
Testing: Minimum 80% code coverage required
Pull Request Process
Create a feature branch:
git checkout -b feature/amazing-feature
Write tests for your changes
Ensure all tests pass:
npm test
Update documentation if needed
Submit a pull request with a clear description
Commit Message Format
Troubleshooting
Common Issues
OAuth Connection Failed
Database Connection Error
MCP Tool Not Working
Build Errors
Debug Mode
Getting Help
Documentation: Full API Docs
Discussions: GitHub Discussions
Issues: GitHub Issues
Email: support@example.com
Security
Data Protection
Encrypted Tokens: All sensitive data encrypted with AES-256
Secure Sessions: JWT-based authentication with expiration
CSRF Protection: OAuth state parameter validation
Input Validation: Comprehensive request sanitization
Best Practices
Environment Variables: Never commit secrets to version control
HTTPS Only: Always use HTTPS in production
Regular Updates: Keep dependencies updated for security patches
Access Control: Implement proper authorization checks
Security Reporting
If you discover a security vulnerability, please email security@example.com instead of creating a public issue.
Roadmap
Version 2.0 (Coming Soon)
Advanced reporting tools
Bulk operations support
Real-time webhook notifications
Multi-organization support
Advanced analytics dashboard
Version 1.5 (Current)
Basic MCP tool implementation
OAuth 2.0 integration
Webhook support
Comprehensive testing suite
Production deployment ready
Acknowledgments
Xero API - For providing excellent accounting APIs
Model Context Protocol - For the AI assistant integration standard
Next.js Community - For the amazing React framework
Vercel - For the best deployment platform
License
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for Accountants, Bookkeepers and AI enthusiasts
⭐ Star us on GitHub • [📖 Documentation](Still to do) • 🐛 Report Issues
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A template for building MCP servers in Next.js applications using the Vercel MCP Adapter. Provides a foundation for adding custom tools, prompts, and resources to any Next.js project with deployment support on Vercel.