@dealx/mcp-server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
This is a Model Context Protocol (MCP) server for the DealX platform. It allows LLMs to interact with the DealX platform, specifically to search for ads.
Table of Contents
- Overview
- Installation
- Usage
- Available Tools
- Extending the Server
- Development
- Troubleshooting
Hosted deployment
A hosted deployment is available on Fronteir AI.
Overview
The DealX MCP Server implements the Model Context Protocol to provide a standardized way for LLMs to interact with the DealX platform. Currently, it supports searching for ads, with plans to add more functionality in the future.
What is MCP?
The Model Context Protocol (MCP) is a standardized way for LLMs to interact with external systems. It provides a structured interface for LLMs to access data and perform actions in the real world. This server implements the MCP specification to allow LLMs to interact with the DealX platform.
Installation
Prerequisites
- Node.js (v20 or later)
- npm (v11 or later)
MCP Configuration
To use this server with an LLM like Claude, you need to add it to your LLM's MCP configuration:
1. Open your LLM's MCP configuration file:
- **Claude Desktop App**:
- macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
- Windows: %APPDATA%\Claude\claude_desktop_config.json
- Linux: ~/.config/Claude/claude_desktop_config.json
- **Cline (VS Code Extension)**:
- ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
2. Add the DealX MCP server to the mcpServers section:
Installation via npm
The easiest way to install the DealX MCP Server is via npm:
Installation for Development
If you want to modify the server or contribute to its development:
1. Clone the repository:
2. Install dependencies:
3. Create a .env file based on the .env.example file:
4. Edit the .env file to set the appropriate values:
5. Build the server:
Usage
Starting the Server
You can run the server in several ways:
1. If installed globally:
2. Using npx without installation:
3. With environment variables:
4. For development:
Using with an LLM
Once configured in your LLM's MCP settings, you can use natural language to interact with the DealX platform.
Example prompts:
- "Search for ads on DealX with the query 'laptop'"
- "Find the newest 5 ads for 'iPhone' on DealX"
- "Search DealX for apartments in Kyiv"
Available Tools
search_ads
Search for ads on the DealX platform.
**Parameters:**
- query (string, optional): Search query string
- sort (string, optional): Sort order (e.g., "-created" for newest first)
- offset (number, optional): Pagination offset (starts at 1, default: 1)
- limit (number, optional): Number of results per page (max 100, default: 30)
**Example Usage:**
Extending the Server
The server is designed to be easily extended with additional tools. Here's how to add a new tool:
- Define the tool in the TOOLS object in src/index.ts:
- Create a new file in the src/tools directory for your tool implementation:
- Add the tool to the ListToolsRequestSchema handler in src/index.ts: