Stock API MCP Server

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.

Category
访问服务器

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

  1. Install dependencies:

    npm install
    
  2. 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
    
  3. Run the server:

    npm start
    
  4. 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 EUR
  • minPrice - Minimum price in EUR
  • condition - 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:

  1. Embraces API pagination limitations transparently
  2. Maximizes value from facet data for inventory insights
  3. Provides actionable refinement suggestions
  4. Sets clear expectations about sample vs comprehensive results

Perfect for POCs where comprehensive search isn't feasible but inventory discovery is valuable.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选