Skip to main content
Glama
miqui

yelp-mcp-sdk

by miqui

yelp-mcp-sdk

基于 官方 MCP Python SDK 构建的 Yelp Fusion MCP 服务器。 功能上与 yelp-mcp-min (FastMCP) 完全相同,但直接使用了底层的 Server 类 —— 没有框架抽象。

先决条件

Related MCP server: Yelp Fusion MCP Server

安装

uv sync
cp .env.example .env
# Edit .env and set YELP_API_KEY

运行

# stdio transport (for use with Claude Desktop or an MCP client)
uv run python -m server.main

# Docker
docker build -t yelp-mcp-sdk .
docker buildx build -t yelp-mcp-sdk .
docker run --env-file .env yelp-mcp-sdk

环境变量

变量

必需

默认值

描述

YELP_API_KEY

Yelp Fusion API 持有者令牌

YELP_BASE_URL

https://api.yelp.com/v3

API 基础 URL

HTTP_TIMEOUT

10.0

请求超时时间(秒)

HTTP_MAX_RETRIES

3

429/5xx 错误时的最大重试次数

HTTP_RETRY_WAIT_MIN

1.0

最小退避等待时间(秒)

HTTP_RETRY_WAIT_MAX

10.0

最大退避等待时间(秒)

LOG_LEVEL

INFO

structlog 日志级别

JSON_LOGS

false

输出 JSON 格式日志

工具

工具

Yelp 端点

描述

search_businesses

GET /v3/businesses/search

支持分页的全文 + 地理位置搜索

find_business_by_phone

GET /v3/businesses/search/phone

通过 E.164 电话号码查找商家

match_business

GET /v3/businesses/matches

将结构化的名称+地址与 Yelp 列表进行匹配

get_business

GET /v3/businesses/{id}

通过 Yelp ID 或别名获取完整的商家资料

get_business_reviews

GET /v3/businesses/{id}/reviews

支持分页的客户评论

资源

yelp://business/{id} — 完整的 Yelp 商家资料,格式为 application/json。 通过 list_resource_templates 声明;通过 read_resource 获取。

项目结构

yelp-mcp-sdk/
  server/
    main.py              # Server("yelp-mcp", lifespan=...) + stdio run
    core/
      config.py          # pydantic-settings
      logging.py         # structlog → stderr
      client.py          # async httpx + tenacity retry
      models.py          # Pydantic output models
    handlers/
      params.py          # Pydantic input models (also generate inputSchema)
      tools.py           # list_tools() + call_tool() dispatcher
      resources.py       # list_resource_templates() + read_resource()
  tests/
    conftest.py
    test_client.py
    test_models.py
    test_handlers.py
  Dockerfile
  pyproject.toml
  .env.example

运行测试

uv run pytest -v

与 yelp-mcp-min (FastMCP) 的比较

方面

yelp-mcp-min (FastMCP)

yelp-mcp-sdk (官方 SDK)

工具注册

@mcp.tool() 装饰器

list_tools + call_tool 分发器

输入模式

从函数签名自动生成

显式使用 model.model_json_schema()

输出类型

直接返回 Pydantic 模型

带有 JSON 字符串的 list[TextContent]

资源

@mcp.resource("uri://...") 装饰器

list_resource_templates + read_resource

依赖注入

无(通过闭包捕获)

lifespan 上下文 → request_context

传输

mcp.run()

asyncio.run() + stdio_server()

服务器代码行数

~350

~450

Install Server
F
license - not found
A
quality
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    D
    maintenance
    Enables conversational interactions with Yelp's business data through an MCP server, allowing natural language queries about local businesses, multi-turn conversations, and direct business inquiries powered by Yelp Fusion AI.
    1
    26
    Apache 2.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides access to Yelp's business database for searching local businesses, retrieving detailed ratings and reviews, and performing market research through business counts. It enables users to look up businesses by location, category, or phone number using the Yelp Fusion API.
    1
  • F
    license
    A
    quality
    D
    maintenance
    Minimal MCP server for the Yelp Fusion API v3, enabling business search, phone lookup, match, details, and reviews via FastMCP.
    5

View all related MCP servers

Related MCP Connectors

  • Live Google Maps business search, review, and photo data for AI agents over MCP.

  • Recreation.gov MCP — wraps the Recreation Information Database (RIDB) API v1

  • Recipes MCP — wraps TheMealDB API (free tier, no auth)

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/miqui/yelp-mcp-sdk'

If you have feedback or need assistance with the MCP directory API, please join our Discord server