products-mcp-server

products-mcp-server

Exposes 27 product tools (CRUD, search, stats, recommendations) backed by fakestoreapi.com, deployable via stdio, HTTP, or serverless.

Category
访问服务器

README

products-mcp-server

A custom Model Context Protocol (MCP) server exposing 27 product tools backed by fakestoreapi.com.

It runs three ways from the same code:

  • Local (stdio) — for Cursor / Claude Desktop, via src/index.ts → dist/index.js.
  • Render (persistent HTTP) — a long-running Streamable HTTP server, via src/http.ts → dist/http.js.
  • Vercel (serverless HTTP) — a stateless Streamable HTTP function, via api/mcp.ts.

Architecture

src/
  products-api.ts   # Fake Store API client (endpoints + 60s TTL cache)
  tools.ts          # registerTools(server): all 27 tools (shared)
  server.ts         # createServer(): builds a configured server (shared)
  index.ts          # stdio entry point (local)
  http.ts           # persistent HTTP entry point (Render) — listens on $PORT
api/
  mcp.ts            # Vercel serverless entry point (stateless Streamable HTTP)
render.yaml         # Render blueprint (web service)
vercel.json         # Vercel function config

All entry points call createServer(), so the tool set stays identical across transports.

Tools

# Tool Description
1 getProducts All products (optional limit, sort).
2 getProductById One product by id.
3 getCategories List of categories.
4 getProductsByCategory Products in a category (optional limit).
5 searchProducts Keyword search over title + description.
6 getProductsByPriceRange Products within [min, max].
7 getProductsAbovePrice Products costing more than price.
8 getProductsBelowPrice Products costing less than price.
9 getCheapestProduct Single cheapest product.
10 getMostExpensiveProduct Single most expensive product.
11 getTopRatedProducts Sorted by rating (optional limit).
12 getMostReviewedProducts Sorted by review count (optional limit).
13 getProductsByMinRating Products with rating >= minRating.
14 getPriceStats count / min / max / average / median / total.
15 getCategoryStats Per-category price stats.
16 countProducts Total count (optional category).
17 listProductTitles Lightweight id + title list.
18 getRandomProduct A random product.
19 compareProducts Compare 2–10 products by ids.
20 getProductRecommendations Same-category picks for an id.
21 getDiscountedPrice Price after discountPercent.
22 summarizeCatalog High-level catalog summary.
23 getCheapestInCategory Cheapest within a category.
24 getHighestRatedInCategory Highest-rated within a category.
25 createProduct Create a product (simulated by the API).
26 updateProduct Update a product (simulated).
27 deleteProduct Delete a product (simulated).

Note: fakestoreapi.com simulates write operations (create/update/delete) and does not persist them.

Local development

npm install
npm run build       # tsc: src -> dist
npm run typecheck   # type-checks src + api
npm start           # runs the stdio server

Use locally in Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "products": {
      "command": "node",
      "args": ["c:/Users/serch/OneDrive/Desktop/MCP-Servers/products-mcp-server/dist/index.js"]
    }
  }
}

Re-run npm run build after changing the TypeScript, since Cursor runs the compiled dist/index.js.

To run the HTTP server locally (same one Render uses):

npm run build
npm run start:http          # listens on http://localhost:3000/mcp
# health check: curl http://localhost:3000/healthz

Deploy to Render

Render runs a persistent Node process (via src/http.ts), which suits MCP well and avoids serverless cold starts / timeouts.

Option A — Blueprint (recommended)

The repo includes render.yaml:

services:
  - type: web
    name: products-mcp-server
    runtime: node
    plan: free
    buildCommand: npm install && npm run build
    startCommand: npm run start:http
    healthCheckPath: /healthz
  1. Push this folder to a Git repo.
  2. In Render: New → Blueprint, select the repo. Render reads render.yaml and creates the web service.
  3. Deploy. Your endpoint will be:
https://<your-service>.onrender.com/mcp

Option B — Manual web service

New → Web Service → connect the repo, then set:

  • Runtime: Node
  • Build Command: npm install && npm run build
  • Start Command: npm run start:http
  • Health Check Path: /healthz

Connect a client to the Render server

{
  "mcpServers": {
    "products": { "url": "https://<your-service>.onrender.com/mcp" }
  }
}

For stdio-only clients, bridge with mcp-remote:

{
  "mcpServers": {
    "products": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://<your-service>.onrender.com/mcp"]
    }
  }
}

Notes

  • The server binds to process.env.PORT (Render sets this automatically). The MCP path defaults to /mcp and can be overridden with the MCP_PATH env var.
  • Render's free web services sleep after inactivity; the first request after idle may be slow to wake.
  • The deployed URL is public — add authentication before exposing sensitive tools.

Deploy to Vercel

The api/mcp.ts function serves the MCP server over Streamable HTTP in stateless mode (a fresh server per request — no Redis required).

  1. Push this folder to a Git repo and import it in Vercel (or run npx vercel).
  2. Vercel compiles api/mcp.ts automatically; no build step is required for the function.
  3. After deploy, your endpoint is:
https://<your-project>.vercel.app/api/mcp

Connect a client to the deployed server

If the client supports Streamable HTTP (e.g. recent Cursor):

{
  "mcpServers": {
    "products": { "url": "https://<your-project>.vercel.app/api/mcp" }
  }
}

For stdio-only clients, bridge with mcp-remote:

{
  "mcpServers": {
    "products": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://<your-project>.vercel.app/api/mcp"]
    }
  }
}

Notes & limits

  • Stateless: each request is self-contained. If you later need SSE streaming / persistent sessions across instances, add Upstash Redis and enable Vercel Fluid Compute.
  • Timeout: vercel.json sets maxDuration: 60; each tool also has a 10s upstream-fetch abort guard.
  • Auth: the deployed URL is public. Add authentication before exposing sensitive tools.

推荐服务器

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 多个工具。

官方
精选
本地
Kagi MCP Server

Kagi MCP Server

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

官方
精选
Python
graphlit-mcp-server

graphlit-mcp-server

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

官方
精选
TypeScript
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 模型以安全和受控的方式获取实时的网络信息。

官方
精选