StockSpark MCP Server
A production-ready Model Context Protocol (MCP) server that provides AI agents with 36 specialized tools for complete vehicle dealership management through the StockSpark/Carspark API platform.
π Quick Start
1. Install
2. Configure
Create .env file with your credentials:
3. Test Connection
4. Connect to Claude Desktop
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
π Available Tools (36 Total)
π’ Organization Management (5 tools)
get_user_context- View current company/dealer selectionlist_user_companies- List accessible companiesselect_company- Choose working companylist_company_dealers- List company's dealersselect_dealer- Choose working dealer
π Vehicle Reference Data (10 tools)
search_vehicle_versions- Progressive search for vehicle specificationscompare_vehicle_versions- Compare similar trims/versionsget_vehicle_version_template- Get complete vehicle data templateget_vehicle_makes- List available manufacturersget_vehicle_models- Get models for a makeget_vehicle_trims- Get trim levels with specificationsget_vehicle_transmissions- Available transmission typesget_vehicle_bodies- Body style optionsget_vehicle_fuels- Fuel type optionsget_vehicle_colors- Available colors
π Vehicle Management (6 tools)
add_vehicle- Create new vehicle (template or manual)get_vehicle- Retrieve vehicle detailslist_vehicles- Search/filter inventory with sortingupdate_vehicle- Modify vehicle dataupdate_vehicle_price- Quick price updatesdelete_vehicle- Remove vehicle (with confirmation)
πΈ Image Management (4 tools)
upload_vehicle_images- Bulk upload from files/URLsget_vehicle_images- List vehicle imagesset_vehicle_main_image- Set primary display imagedelete_vehicle_image- Remove specific images
π Analytics & Intelligence (4 tools)
get_underperforming_vehicles- Identify slow-moving inventoryanalyze_inventory_health- Overall stock metricsapply_bulk_discount- Strategic bulk pricingget_pricing_recommendations- AI-powered pricing suggestions
π Publishing (4 tools)
publish_vehicle- Push to portals (MyPortal, Automobile.it)unpublish_vehicle- Remove from portalsget_publication_status- Check publishing statuslist_available_portals- Show configured channels
π Lead Analysis (2 tools)
get_vehicle_leads- Customer inquiry trackinganalyze_lead_trends- Lead performance insights
β‘ Performance (1 tool)
get_mcp_performance- System performance metrics
π‘ Common Workflows
Create a Vehicle (3 Steps)
Analyze & Optimize Inventory
Upload Images
π§ Advanced Features
Enhanced Vehicle Search
Natural Language Examples
π Documentation
AI Agent Guide (CLAUDE.md) - For AI agents working with the codebase
Documentation Index - Complete documentation guide
Known Issues - Current limitations and fixes
π§ͺ Testing
ποΈ Architecture
36 MCP Tools across 8 specialized modules
OAuth2 Authentication with auto-refresh
Multi-tenant Support for companies/dealers
Error Recovery with retry logic
Structured Logging for debugging
70%+ Test Coverage with real API testing
βοΈ Environment Variables
Required
STOCKSPARK_USERNAME- Your login emailSTOCKSPARK_PASSWORD- Your password
Optional
STOCKSPARK_COUNTRY- Market (it/fr/de/es), default: itLOG_LEVEL- Logging detail (debug/info/warn/error)MYPORTAL_ACTIVATION_CODE- For MyPortal publishingAUTOMOBILE_IT_ACTIVATION_CODE- For Automobile.itSTOCKSPARK_API_KEY- For lead tracking features
API Endpoints (Hardcoded Defaults)
The following are built into the code and rarely need override:
Auth URL:
https://auth.motork.io/realms/prod/protocol/openid-connect/tokenAPI URL:
https://carspark-api.dealerk.comClient ID:
carspark-api
π Recent Updates
β Completed
Tool consolidation: 41 β 36 tools (12% reduction)
Enhanced vehicle search with sorting and smart filtering
Fixed date field mapping for proper creation dates
Vehicle deletion with safety confirmation
Hardcoded API defaults (only username/password required)
π§ Known Issues
Auto-main image not setting correctly on upload
hasImagesflag showing false even with images
π Support
Check test output:
npm run test:verboseReview logs with
LOG_LEVEL=debugSee KNOWN_ISSUES.md for solutions
Verify credentials in
.envfile
Production-ready MCP server providing complete vehicle dealership management for AI agents.