Skip to main content
Glama
Dictionary Lookup MCP Server

Dictionary Lookup MCP Server

词典查询 MCP 服务器

一个基于官方 Python SDK 构建的极简 模型上下文协议 服务器。它暴露了一个工具 define,用于通过免费的 dictionaryapi.dev API 查询英文单词的定义。

本项目是作为学习练习而构建的,旨在理解 MCP 服务器是如何构建的、如何与客户端通信,以及如何公开部署。

功能

  • 暴露一个工具:define(word: str) -> str

  • 给定一个单词,返回其词性和定义

  • 无需 API 密钥或身份验证

Related MCP server: yifanli-mcp-add-demo

环境要求

  • Python 3.10+

  • uv(推荐)或 pip

本地设置

# 1. Clone this repo
git clone <your-repo-url>
cd my-mcp-server

# 2. Install dependencies
uv sync

本地运行

选项 A — MCP Inspector(可视化测试工具,最适合初学者):

uv run mcp dev server.py

这会打开一个基于浏览器的检查器,您可以直接调用 define 工具并查看请求/响应,而无需完整的 AI 客户端。

选项 B — 连接到 Claude Desktop:

将以下内容添加到您的 Claude Desktop 配置文件(claude_desktop_config.json)中:

{
  "mcpServers": {
    "dictionary-lookup": {
      "command": "uv",
      "args": [
        "--directory",
        "/absolute/path/to/my-mcp-server",
        "run",
        "server.py"
      ]
    }
  }
}

重启 Claude Desktop,然后询问类似这样的问题: "使用词典工具查询 'ephemeral' 的定义。"

使用示例

输入: define("ephemeral") 输出: ephemeral (形容词):持续很短的时间。

部署

此服务器已发布在 Smithery 上:<部署后添加链接>

要部署您自己的副本:

  1. 将此仓库推送到 GitHub。

  2. 确保 server.py 支持 streamable-http 传输以进行远程托管。

  3. 托管它(例如 Render/Railway),或使用 Smithery 的发布流程。

  4. 在 Smithery 上,选择"通过 URL 发布",并将其指向您托管的服务器端点。

为什么做这个项目

为了学习 MCP 的基础知识:客户端如何发现服务器的工具、工具调用如何被发起和响应,以及一个可用的服务器如何通过像 Smithery 这样的市场公开分享。

Available Tools

1 tool
defineA

Look up the definition of an English word and return it as text.

Inputs: word (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    There is only one tool, so there is no possibility of confusing it with another tool. Its purpose is immediately clear and unambiguous.

    Naming Consistency5/5

    The single tool name 'define' is a clear imperative verb that matches its action. With only one tool, there are no mixed naming conventions or inconsistencies.

    Tool Count3/5

    One tool feels thin for a server labeled as a dictionary lookup service, though it does cover the core definition lookup need. It is borderline rather than extreme.

    Completeness4/5

    The core lookup functionality is covered well, but a dictionary server might reasonably include related operations like synonyms, usage examples, or pronunciation. These are minor gaps rather than fatal omissions.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      A minimal Model Context Protocol server built with FastAPI that provides a basic "Hello World" resource and tool. Serves as a starting point for building and validating MCP client integrations with richer resources and tools.
      -
    • F
      license
      B
      quality
      Not graded
      maintenance
      A minimal Model Context Protocol server that provides a simple tool for adding two integers. It serves as a demonstration of the official Python MCP SDK and is designed for local execution via stdio.
      1
      -
    • A
      license
      A
      quality
      D
      maintenance
      A minimal starting point for a Model Context Protocol server with stdio transport and one tool, enabling quick setup and custom tool addition.
      1
      ISC