VTEX MCP Server
by Volve-Tech
README.md
# VTEX MCP Server
A comprehensive Model Context Protocol (MCP) server for VTEX APIs, enabling AI assistants to interact with the VTEX e-commerce platform through 163+ API endpoints.
## š Features
- **Complete VTEX API Coverage**: Access to 163+ VTEX API endpoints
- **Type-Safe**: Built with TypeScript following SOLID principles
- **MCP Protocol**: Fully compliant with Model Context Protocol specifications
- **Easy Configuration**: Simple environment-based configuration
- **Category Organization**: APIs organized by functional categories (SKU Service, Catalog, Orders, etc.)
- **Comprehensive Error Handling**: Robust error handling and logging
## š¦ Installation
### From npm (when published)
```bash
npm install -g vtex-mcp-server
```
### From source
```bash
git clone https://github.com/Volve-Tech/vtex-mcp-server.git
cd vtex-mcp-server
npm install
npm run build
```
## āļø Configuration
Create a `.env` file in the project root or set environment variables:
```env
VTEX_ACCOUNT_NAME=your-account-name
VTEX_API_KEY=your-api-key
VTEX_API_TOKEN=your-api-token
VTEX_ENVIRONMENT=vtexcommercestable
```
### Getting VTEX API Credentials
1. **Account Name**: Your VTEX store account name (e.g., if your store is `mystore.vtexcommercestable.com.br`, the account name is `mystore`)
2. **API Key and Token**:
- Access your VTEX Admin panel
- Navigate to **Account Settings** > **Account** > **Security**
- Go to **Application Keys**
- Click **Generate New Key**
- Save both the **App Key** (API Key) and **App Token** (API Token)
## š§ Usage
### As a Standalone Server
```bash
npm start
```
### With MCP Clients
#### Claude Desktop Configuration
Add to your Claude Desktop configuration file:
**macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
**Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
```json
{
"mcpServers": {
"vtex": {
"command": "node",
"args": ["/path/to/vtex-mcp-server/dist/index.js"],
"env": {
"VTEX_ACCOUNT_NAME": "your-account-name",
"VTEX_API_KEY": "your-api-key",
"VTEX_API_TOKEN": "your-api-token",
"VTEX_ENVIRONMENT": "vtexcommercestable"
}
}
}
}
```
#### Using npx (after publishing)
```json
{
"mcpServers": {
"vtex": {
"command": "npx",
"args": ["vtex-mcp-server"],
"env": {
"VTEX_ACCOUNT_NAME": "your-account-name",
"VTEX_API_KEY": "your-api-key",
"VTEX_API_TOKEN": "your-api-token"
}
}
}
}
```
## š Available API Categories
The server provides access to the following VTEX API categories:
- **SKU Service**: Manage SKU services, types, values, and attachments
- **Catalog**:
- Categories (tree, CRUD operations)
- Brands (list, paginated list, CRUD operations)
- Attachments (CRUD operations)
- Products (CRUD, specifications, reviews, trade policies)
- SKUs (variations, specifications)
- **Orders**: Order management and fulfillment
- **Pricing**: Price management and rules
- **Logistics**: Shipping, inventory, and docks
- **Promotions**: Discount and promotion management
- **Customer**: Customer data and segmentation
- **Payments**: Payment methods and transactions
- **And many more...**
## š ļø Development
### Project Structure
```
vtex-mcp-server/
āāā src/
ā āāā config/ # Configuration management
ā ā āāā VtexConfig.ts
ā āāā interfaces/ # TypeScript interfaces
ā ā āāā IVtexConfig.ts
ā ā āāā IVtexRequest.ts
ā ā āāā IApiClient.ts
ā āāā models/ # Domain models
ā ā āāā VtexEndpoint.ts
ā āāā services/ # API client services
ā ā āāā VtexApiClient.ts
ā āāā tools/ # MCP tool implementation
ā ā āāā VtexToolFactory.ts
ā ā āāā VtexToolHandler.ts
ā āāā utils/ # Utility functions
ā ā āāā postmanParser.ts
ā āāā data/ # Generated endpoint definitions
ā ā āāā endpoints.ts
ā āāā index.ts # Main server entry point
āāā dist/ # Compiled JavaScript
āāā postman-collection (1).json # Source API definitions
āāā package.json
āāā tsconfig.json
āāā README.md
```
### Building
```bash
npm run build
```
### Development Mode (watch)
```bash
npm run dev
```
### Regenerating Endpoints
If you update the Postman collection, regenerate the endpoints:
```bash
node -e "require('./dist/utils/postmanParser.js').regenerateEndpoints()"
```
## šļø Architecture
This project follows SOLID principles:
- **Single Responsibility**: Each class has a single, well-defined purpose
- **Open/Closed**: Extensible through interfaces without modifying existing code
- **Liskov Substitution**: Interfaces define clear contracts
- **Interface Segregation**: Focused, minimal interfaces
- **Dependency Inversion**: Dependencies on abstractions, not concrete implementations
### Key Components
1. **VtexConfig**: Manages configuration and environment variables
2. **VtexApiClient**: Handles HTTP communication with VTEX APIs
3. **VtexEndpoint**: Represents API endpoint metadata
4. **VtexToolFactory**: Creates MCP tools from endpoints
5. **VtexToolHandler**: Executes tool calls and manages requests
6. **MCP Server**: Coordinates all components and handles MCP protocol
## š Security
- **API Credentials**: Never commit `.env` file or expose credentials
- **Environment Variables**: All sensitive data should be in environment variables
- **HTTPS**: All API requests use HTTPS
- **Token Rotation**: Regularly rotate your API keys and tokens
## š Example Tool Calls
Once configured, you can interact with VTEX APIs through your MCP client:
```
"Get product by ID 123"
"List all brands"
"Get SKU service 5"
"Update category 10"
"Create a new product"
```
The AI assistant will automatically map these requests to the appropriate VTEX API tools.
## š¤ Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md) for details on:
- Code style and standards
- Pull request process
- Development workflow
## š License
MIT License - see [LICENSE](LICENSE) file for details
## š Support
- **Issues**: [GitHub Issues](https://github.com/Volve-Tech/vtex-mcp-server/issues)
- **Documentation**: [VTEX Developer Portal](https://developers.vtex.com/)
- **MCP Protocol**: [Model Context Protocol Docs](https://modelcontextprotocol.io/)
## šÆ Roadmap
- [ ] Add response caching
- [ ] Implement rate limiting
- [ ] Add webhook support
- [ ] Create CLI for testing tools
- [ ] Add more detailed logging options
- [ ] Support for multiple VTEX accounts
## ā Acknowledgments
- Built on the [Model Context Protocol SDK](https://github.com/modelcontextprotocol/sdk)
- VTEX API definitions from [VTEX Developer Portal](https://developers.vtex.com/)
- Inspired by the VTEX developer community
---
Made with ā¤ļø for the VTEX ecosystem
This server cannot be deployed
Maintenance
ActivityInactive
ResponsivenessNo recent community issues