Skip to main content
Glama
Joke Generator MCP

Joke Generator MCP

by aidevshakil

Joke Generator MCP

一个使用 Python 构建的简单 Model Context Protocol (MCP) 服务器,提供开发者和编程笑话。

目标

本项目是 MCP 学习工作流的一部分,旨在理解 MCP 服务器如何构建、测试和部署。

Related MCP server: Jokes MCP Server

功能

  • 工具:

    • get_random_joke:返回一个随机的开发者笑话。

    • get_joke_by_topic:根据特定的编程主题(例如 Python、JavaScript、CSS)返回一个笑话。

设置与安装

  1. 克隆或下载仓库

  2. 安装依赖: 确保已安装 Python 3.10+。在本地安装该包:

    pip install -e .

使用(本地测试)

您可以使用 stdio 直接运行 MCP 服务器:

python -m joke_mcp

使用 MCP Inspector 进行测试

要以交互方式测试服务器,请使用官方的 MCP Inspector:

npx @modelcontextprotocol/inspector python -m joke_mcp

这将启动一个本地 Web 界面,您可以在其中调用此服务器提供的工具。

部署到 Smithery

本项目包含一个 smithery.yaml 配置文件,便于部署到 Smithery 市场。

  1. 确保您的代码托管在公共 GitHub 仓库中。

  2. 前往 Smithery 并点击"添加服务器"。

  3. 提供您的仓库 URL。Smithery 将读取 smithery.yaml 并自动配置构建。

学习成果

  • 演示了如何使用 mcp Python SDK 创建工具。

  • 设置了标准的 Python 包结构。

  • 为通过 MCP 市场进行公开分享做好了准备。

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to fetch jokes from various categories including Chuck Norris and dad jokes through a standardized MCP interface. Demonstrates integration between Microsoft Copilot Studio and MCP servers for humor-based interactions.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to fetch various types of jokes including Chuck Norris and Dad jokes through an MCP server that integrates with Microsoft Copilot Studio and GitHub Copilot.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables users to fetch jokes from various categories including Chuck Norris jokes and Dad jokes through a standardized MCP interface. Provides integration with Microsoft Copilot Studio and GitHub Copilot for AI-powered humor delivery.
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Fetches jokes from multiple APIs including Chuck Norris, Dad jokes, and Yo Mama jokes, providing humor-focused content through standardized MCP tools.
    MIT