letgo-mcp
The letgo-mcp server provides a programmatic interface to search, browse, and retrieve listings from Letgo.com (Turkey) via browser automation (Playwright), with no API key required.
Set search location (
letgo_set_location): Set a Turkish city (e.g., İstanbul, Ankara, İzmir) and optionally a district — required before performing any search.Get autocomplete suggestions (
letgo_search_suggestions): Retrieve search suggestions from Letgo for a given query string.Search listings (
letgo_search_listings): Find listings with filters for price range (in TRY), sorting (by price, date, or distance), category, and pagination.View listing details (
letgo_get_listing_details): Fetch full details for a specific listing, including description, seller info, all images, and attributes.Refresh session (
letgo_refresh_session): Renew Akamai anti-bot session cookies when searches return errors or empty results.Debug network requests (
letgo_debug_network): Capture and inspect all API/network calls made by Letgo.com for a given search query, useful for discovering internal endpoints.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@letgo-mcp search for iPhone in Istanbul"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
letgo-mcp
A Model Context Protocol (MCP) server for searching listings, viewing listing details, and applying filters on Letgo.com. It uses Playwright browser automation to bypass Letgo's Akamai anti-bot protection and accesses data in a way that closely mimics real user behavior.
Features
City and district-level location setting
Autocomplete search suggestions
Listing search (with price range, sorting, category, and pagination support)
Individual listing details (description, seller info, images)
Infinite scroll — automatically clicks "Load More" to collect all results
Session refresh against Akamai anti-bot protection
Network request debugging via interception
No API keys required
Related MCP server: OLX MCP Server
Requirements
Node.js v22 or higher
npm (ships with Node.js)
Playwright browser engine (downloaded automatically during setup)
Installation
# Clone the repository
git clone <repo-url>
cd letgo-mcp
# Install dependencies
npm install
# Download the Playwright browser
npx playwright install chromium
# Build the project
npm run buildAfter building, executable JavaScript files will be available under the dist/ directory.
MCP Configuration
letgo-mcp runs as a stdio MCP server. Add it to any MCP-compatible client (Claude Desktop, OpenCode, etc.) as follows:
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"letgo-mcp": {
"command": "node",
"args": ["/path/to/letgo-mcp/dist/index.js"]
}
}
}OpenCode
Add to .opencode.json:
{
"mcpServers": {
"letgo-mcp": {
"command": "node",
"args": ["/path/to/letgo-mcp/dist/index.js"]
}
}
}Replace the path with the full path to your project.
Usage
The tools must be called in the correct order. Follow this flow:
Set location — Use
letgo_set_locationto set the target city for searches. This must be called before every search.Search — Use
letgo_search_listingsto search listings. Optionally, useletgo_search_suggestionsto get autocomplete suggestions.Details — Use
letgo_get_listing_detailsto view the full details of a listing.Maintenance — If session issues arise, call
letgo_refresh_session. Useletgo_debug_networkto inspect network requests.
Running from the Command Line
# Build
npm run build
# Run (as stdio MCP server)
npm start
# Development mode (build + run)
npm run devTools Reference
Tool | Description | Parameters |
| Sets the search location. Must be called before any search. |
|
| Returns autocomplete suggestions for a given query. |
|
| Searches listings on Letgo. Supports filtering, sorting, and pagination. |
|
| Returns full details of a listing including title, description, seller info, images, and attributes. |
|
| Refreshes Akamai anti-bot cookies. Use when search results return empty or errors occur. | No parameters |
| Navigates to a search page and captures all API/network calls made by the page. Useful for discovering which endpoints are used. |
|
Architecture
The project consists of two main components:
Session Management (session.ts): Spawns a Chromium browser instance via Playwright. The browser runs in headless: false (visible) mode. Several measures are taken to bypass Letgo's Akamai bot detection:
Realistic user agent and viewport configuration
Hiding the
navigator.webdriverflagTurkish language and Istanbul timezone settings
API calls are made using
page.evaluate(fetch)so the browser's existing cookies and session data are usedIf the browser crashes or an error occurs, it is automatically restarted
API Client (api-client.ts): Accesses Letgo's internal API endpoints (/api/suggestions) and listing pages through the DOM. Search results are collected via DOM scraping: the "Load More" button is automatically clicked to simulate infinite scroll, then listing cards are extracted using the a[href*="/item/"] selector.
Tool Handler (index.ts): Defines 6 tools via the MCP SDK. Routes incoming requests to functions in api-client.ts and session.ts. Input and output schemas are defined according to MCP standards.
Data Flow
MCP Client -> stdio -> index.ts (handler) ->
api-client.ts -> session.ts (Playwright) -> Letgo.comAll HTTP requests are made from within the browser context, ensuring Letgo's session and cookie mechanisms work seamlessly.
Important Notes
No API key required. It works through Letgo's own web interface — no official API is used.
Browser runs visible (
headless: false). Letgo's Akamai anti-bot may block headless browsers, so the browser window stays open.Location is required. No search can be performed without calling
letgo_set_location. City names must be entered with Turkish characters (e.g., "İzmir", "İstanbul", "Ankara").Session durations are limited. Letgo's Akamai cookies remain valid for a limited time. Use
letgo_refresh_sessionto renew the session.Rate limiting. Sending too many requests in quick succession may cause Letgo to temporarily restrict access. Session refresh usually resolves this.
DOM scraping. Search results are extracted from Letgo's HTML DOM. If Letgo changes their UI, the scraping selectors may need to be updated.
Turkey only. Designed for the Letgo Turkey platform. Location data covers Turkish cities.
Available Tools
6 toolsletgo_debug_networkB
Navigate to a search URL and capture all API/network calls made by the page. Useful for discovering which API endpoints Letgo uses.
Inputs: query.
letgo_get_listing_detailsA
Get full details of a specific listing including description, seller info, all images, and attributes.
Inputs: listing_id (required).
letgo_refresh_sessionA
Refresh the anti-bot session cookies. Call this if searches start returning errors or empty results.
Inputs: no named parameters.
letgo_search_listingsB
Search listings on Letgo with filters for price, sorting, and pagination. Returns listing cards with ID, title, price, location, and thumbnail.
Inputs: query (required), page, minPrice, maxPrice, +2 more.
letgo_search_suggestionsB
Get autocomplete search suggestions from Letgo for a given query.
Inputs: query (required).
letgo_set_locationA
Set the search location for Letgo. Must be called before any search. Provide a Turkish city name (e.g. 'İzmir', 'İstanbul', 'Ankara').
Inputs: city (required), district.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct function: network debugging, listing details, session management, search, suggestions, and location setting. No overlap in purpose, making it clear which tool to use for each task.
All tools follow a consistent 'letgo_verb_noun' pattern in snake_case, e.g., 'letgo_search_listings', 'letgo_set_location'. This uniformity makes the tool set predictable and easy to navigate.
With 6 tools, the server is well-scoped for a classifieds search and details service. Each tool serves a necessary role without redundancy, and the count feels appropriate for the domain.
The tool set covers the core workflow: setting location, searching, getting suggestions, and viewing details. Missing listing management (create/update/delete) or user operations, but for a read-heavy use case (scraping/searching) it is largely complete.
Maintenance
Related MCP Connectors
Search and browse global classifieds across 80 markets. No auth required for read-only access.
Crawl, scrape, search the web, and automate browsers at scale with anti-bot bypass.
Stealth scraping & search. Bypasses Cloudflare, DataDome & LinkedIn via Cyborg HITL approach.
Fetch web pages and APIs past anti-bot walls, with reusable browser sessions.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables searching and monitoring of Goofish (闲鱼) items via Playwright automation, providing structured item details and keyword-based monitoring.48ISC
- AlicenseAqualityCmaintenanceEnables searching and retrieving details from OLX classifieds across multiple domains (Portugal, Poland, Bulgaria, Romania, Ukraine) using browser automation.257 npm29MIT
- AlicenseAqualityDmaintenanceProvides tools for searching LinkedIn profiles and extracting names, URLs, and headlines via Playwright-based web scraping. Supports location and network filters with automatic login and cookie persistence.22MIT
- AlicenseAqualityDmaintenanceEnables AI agents to search products, view item details, track and place bids, make Buy It Now purchases, view order history, and track shipments on eBay via browser automation with Playwright.7MIT