Stock API MCP Server
A Model Context Protocol server that provides discovery-first vehicle inventory search through the Stock API. Enables users to explore inventory with overviews, sample vehicles, and intelligent refinement suggestions.
README
Stock API MCP Server
A Model Context Protocol server that provides discovery-first vehicle inventory search through the Stock API. Instead of simple vehicle listings, it offers comprehensive inventory insights with sample vehicles and intelligent refinement suggestions.
šÆ What Makes This Different
This POC implements a discovery-first approach that transforms vehicle search from a simple list into an informative inventory exploration:
- š Inventory Overview: See total counts by make, fuel type, condition, and body type
- š Representative Sample: View 10-15 example vehicles from available inventory
- š” Smart Suggestions: Get refinement ideas based on actual inventory
- š Transparent Sampling: Understand you're seeing examples, not exhaustive results
Quick Start
-
Install dependencies:
npm install -
Configure API access:
# .env file is already configured with: # STOCK_API_KEY=<replace with your API key> # STOCK_API_COUNTRY=it # STOCK_API_BASE_URL=https://stock-api.dealerk.com -
Run the server:
npm start -
Test manually:
npm test
Available Tools
š search_vehicles
Discover vehicle inventory with comprehensive overview and sample listings. Shows total counts by make, fuel, condition plus representative vehicle examples with refinement suggestions.
Example Response Format:
š INVENTORY OVERVIEW
Found 123 vehicles total across all dealers
š·ļø BY CONDITION: USED (115), NEW (7), KM0 (1)
ā½ BY FUEL TYPE: Diesel (68), Petrol (20), Hybrid (17)
š BY MAKE: Peugeot (11), Audi (9), BMW (8), Fiat (8)
š BY BODY TYPE: SUV (75), Sedan (29), Hatchback (7)
š SAMPLE VEHICLES (showing 15 of 123)
1. 2022 Volvo XC40 ⢠Diesel ⢠32,000km ⢠ā¬23,900
2. 2025 Dfsk Glory 500 ⢠Petrol ⢠5,000km ⢠ā¬16,500
3. 2021 Mercedes-Benz Classe A ⢠Hybrid ⢠28,000km ⢠ā¬19,900
š” REFINE YOUR SEARCH
⢠Try "Peugeot" for 11+ Peugeot vehicles
⢠Filter by "Diesel" for 68 diesel vehicles
⢠Add "under 25000" for budget-friendly options
Parameters:
make- Vehicle brand filter (BMW, Audi, Fiat, etc.)fuel- Fuel type (DIESEL, PETROL, HYBRID, ELECTRIC)maxPrice- Maximum price in EURminPrice- Minimum price in EURcondition- Vehicle condition (NEW, USED, KM0)limit- Sample size (default 10, max 15)
š get_vehicle_details (Coming Soon)
Get complete information about a specific vehicle by ID.
Usage with Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"stock-api-mcp": {
"command": "node",
"args": ["/path/to/stock-api-mcp/src/index.js"]
}
}
}
Recent Updates
ā Discovery-First Implementation Complete (September 2025)
- Fixed API Response Parsing: Now combines
promoResults+searchResults(38 vehicles vs 12 previously) - Added Inventory Overview: Shows total counts with breakdowns by condition, fuel, make, body type
- Smart Refinement Suggestions: Provides intelligent next steps based on available inventory
- Transparent Sampling: Clear indication when showing sample vs total available vehicles
Technical Improvements
- Proper deduplication of vehicle results by ID
- Enhanced error handling and logging
- User-friendly response formatting with emojis and structure
- Discovery-first approach optimized for POC constraints
Testing the Server
Option 1: MCP Inspector (Recommended)
npx @modelcontextprotocol/inspector src/index.js
Then test with queries like:
{"make": "BMW", "limit": 5}{"fuel": "DIESEL", "maxPrice": 30000}{"limit": 10}(for full inventory overview)
Option 2: Direct API Testing
node test.js
Option 3: Claude Desktop Integration
Works seamlessly with Claude Desktop - just ask natural language queries like:
- "Show me the available inventory"
- "What BMWs are available?"
- "Find diesel cars under 25000 euros"
Development Status
ā Phase 1-2 Complete: Core search functionality with discovery-first approach š Phase 3-6 Next: Vehicle details tool, natural language parsing, enhanced testing
Architecture Notes
The server implements a discovery-first design pattern that:
- Embraces API pagination limitations transparently
- Maximizes value from facet data for inventory insights
- Provides actionable refinement suggestions
- Sets clear expectations about sample vs comprehensive results
Perfect for POCs where comprehensive search isn't feasible but inventory discovery is valuable.
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.