# MCP VTEX - Project Summary
## ๐ Overview
**MCP VTEX Server** is a comprehensive Model Context Protocol server that provides complete integration with VTEX e-commerce APIs. It enables AI assistants like Claude and Cursor to manage your entire VTEX store through natural language conversations.
## ๐๏ธ Architecture
### Core Components
1. **MCP Server (`src/index.ts`)**
- Implements the Model Context Protocol
- Registers 70+ tools for VTEX operations
- Handles tool invocations and responses
- Manages server lifecycle
2. **VTEX API Client (`src/vtex-client.ts`)**
- Abstraction layer over VTEX REST APIs
- Handles authentication and request formatting
- Implements error handling and retry logic
- Supports multiple API endpoints (Catalog, Pricing, Inventory, etc.)
3. **Type Definitions (`src/types.ts`)**
- Complete TypeScript interfaces for VTEX entities
- Type-safe API contracts
- Request/response type definitions
## ๐ API Coverage
### Catalog API (30 tools)
- **Products**: CRUD operations, search, activation
- **SKUs**: Management, variants, specifications
- **Categories**: Hierarchical management
- **Brands**: Brand operations
- **Specifications**: Field creation, Product attributes, SKU assignment, Category specs
### Pricing API (5 tools)
- Base price management
- List and cost prices
- Computed prices (with promotions)
- Fixed prices per trade policy
- Bulk price operations
### Inventory & Logistics API (13 tools)
- Real-time inventory tracking
- Multi-warehouse management
- Dock configuration
- Shipping policies
- Stock updates and reservations
### Promotions & Taxes API (10 tools)
- All promotion types
- Coupon management
- Promotion scheduling
- Archive/unarchive
- Multiple discount types
### Orders Management API (5 tools)
- Order retrieval and search
- Status management
- Invoice generation
- Tracking updates
- Order cancellation
### Marketplace API (7 tools)
- Seller management
- Commission configuration
- SKU approval workflow
- Seller invitations
- Multi-seller operations
### Checkout API (7 tools) ๐
- Order form (cart) management
- Shipping simulation
- Add/remove items
- Update quantities
- Coupon application
- Cart clearing
### Master Data API (6 tools) ๐
- Document CRUD operations
- Advanced search and filters
- Client management
- Custom entity support
- Email-based lookup
### Search API (5 tools) ๐
- Product search with filters
- Multiple identifier lookup
- Bulk ID retrieval
- Facets and filters
- Autocomplete suggestions
### Reviews and Ratings API (7 tools) ๐
- Review CRUD operations
- Approval workflow
- Rating statistics
- Review filtering
- Social proof management
### Payment Gateway API (7 tools) ๐
- Payment provider configuration
- Payment methods management
- Transaction tracking
- Gateway setup
- Provider operations
## ๐ Statistics
- **Total Tools**: 159
- **API Endpoints**: 17 major VTEX APIs
- **Type Definitions**: 120+ interfaces
- **Lines of Code**: ~5,800
- **Dependencies**: Minimal (axios, MCP SDK, zod)
## ๐ Authentication
Uses VTEX's standard authentication:
- **App Key**: Public identifier
- **App Token**: Secret credential
- **Headers**: `X-VTEX-API-AppKey` and `X-VTEX-API-AppToken`
## ๐ Features
### For Developers
- โ
TypeScript with full type safety
- โ
Modular architecture
- โ
Comprehensive error handling
- โ
Easy local development
- โ
Auto-rebuild with watch mode
### For Users
- โ
Natural language interface
- โ
70+ operations via AI
- โ
Real-time data access
- โ
Batch operations support
- โ
Complex workflow automation
## ๐ฆ Distribution
- **Package Manager**: npm
- **Package Name**: `mcp-vtex`
- **Entry Point**: `dist/index.js`
- **Binary**: `mcp-vtex` (after global install)
## ๐ Development Workflow
```bash
# 1. Install dependencies
npm install
# 2. Build project
npm run build
# 3. Watch mode (auto-rebuild)
npm run watch
```
## ๐ File Structure
```
mcp-vtex/
โโโ src/
โ โโโ index.ts # MCP server implementation (1,810 lines)
โ โโโ vtex-client.ts # API client (1,436 lines)
โ โโโ types.ts # Type definitions (974 lines)
โโโ dist/ # Compiled JavaScript + declarations
โโโ node_modules/ # Dependencies
โโโ README.md # Main documentation
โโโ QUICKSTART.md # Setup guide
โโโ EXAMPLES.md # Usage examples
โโโ CHANGELOG.md # Version history
โโโ LICENSE # MIT License
โโโ package.json # Package configuration
โโโ tsconfig.json # TypeScript config
โโโ env.example # Environment template
โโโ .gitignore # Git ignore rules
```
## ๐ฏ Design Decisions
### Why TypeScript?
- Type safety prevents runtime errors
- Better IDE support and autocomplete
- Self-documenting code
- Easier refactoring
### Why Modular Architecture?
- Separation of concerns
- Easier testing
- Better maintainability
- Scalability for future APIs
### Why Minimal Dependencies?
- Reduced security surface
- Faster installation
- Easier auditing
- Better long-term stability
## ๐ฎ Future Enhancements
### Planned for v1.1.0
- [ ] Checkout API integration
- [ ] Master Data (Customer Data) API
- [ ] Search API integration
- [ ] Batch operations optimization
### Planned for v1.2.0
- [ ] CMS API integration
- [ ] Payment Gateway API
- [ ] Subscriptions API
- [ ] Webhook management
### Planned for v2.0.0
- [ ] GraphQL API support
- [ ] Real-time sync capabilities
- [ ] Advanced analytics
- [ ] Multi-account management
## ๐ Performance Considerations
- **Rate Limiting**: Respects VTEX API limits
- **Pagination**: Supports large datasets
- **Error Handling**: Graceful degradation
- **Caching**: Potential for future implementation
## ๐ Security
- Environment-based configuration
- No credentials in code
- Secure token transmission
- Permission-based access control
## ๐ค Contributing
Project follows standard Git workflow:
1. Fork repository
2. Create feature branch
3. Make changes
4. Submit pull request
## ๐ Support Channels
- GitHub Issues
- GitHub Discussions
- VTEX Community Forum
## ๐ License
MIT License - Free for commercial and personal use
---
## ๐ Learning Resources
For developers working on this project:
- [VTEX Developer Portal](https://developers.vtex.com/)
- [Model Context Protocol Docs](https://modelcontextprotocol.io/)
- [TypeScript Handbook](https://www.typescriptlang.org/docs/)
---
**Project Status**: โ
Production Ready (v1.4.0)
**Maintained by**: Leonardo Sepรบlveda
**Created**: December 2024
**Last Updated**: December 9, 2024
**Latest Version**: v1.4.0 - Added Specification Field Creation Tool