joke-mcp

joke-mcp

A simple MCP server that generates random jokes with setup and punchline

Category
Visit Server

README

šŸŽ­ Joke MCP Server

A simple yet powerful Model Context Protocol (MCP) server that brings humor to AI interactions. This MCP exposes random joke generation as tools that can be seamlessly integrated with Claude and other MCP-compatible clients.

✨ Features

  • get_random_joke - Get a random joke with setup and punchline
  • count_jokes - Get the total number of available jokes in the database
  • Simple & Lightweight - Minimal dependencies, fast execution
  • Easy Integration - Works with Claude Desktop and other MCP clients
  • Well-Documented - Clear schemas and usage examples

šŸš€ Quick Start

Prerequisites

  • Python 3.11 or higher
  • pip package manager

Installation

# Clone the repository
git clone https://github.com/tehrimaly/mcp-joke.git
cd mcp-joke

# Create virtual environment
python -m venv venv

# Activate virtual environment
# On Windows:
venv\Scripts\Activate.ps1
# On macOS/Linux:
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Running the Server

python joke-mcp.py

You should see:

šŸš€ Joke MCP Server starting...

šŸ“– Usage

With Claude Desktop

Add this to your Claude Desktop configuration file:

macOS/Linux: ~/.config/Claude/claude_desktop_config.json Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "joke-mcp": {
      "command": "python",
      "args": ["/path/to/joke-mcp.py"]
    }
  }
}

Then restart Claude Desktop and you can ask Claude to tell jokes!

API Reference

get_random_joke

Returns a random joke with setup and punchline.

Input: None

Output:

Setup: Why don't scientists trust atoms?

Punchline: Because they make up everything!

count_jokes

Returns the total number of jokes available in the database.

Input: None

Output:

Total jokes: 5

šŸ—ļø Project Structure

mcp-joke/
ā”œā”€ā”€ joke-mcp.py          # Main MCP server implementation
ā”œā”€ā”€ requirements.txt      # Python dependencies
ā”œā”€ā”€ README.md            # This file
ā”œā”€ā”€ .gitignore           # Git configuration
└── LICENSE              # MIT License

šŸ”§ Technical Details

Built With

  • Python 3.11+ - Programming language
  • MCP SDK v1.0.0 - Model Context Protocol library
  • Asyncio - Asynchronous programming

How It Works

The Joke MCP Server:

  1. Starts an MCP server listening on stdio
  2. Registers available tools with their schemas
  3. Handles incoming requests from MCP clients
  4. Returns formatted responses with joke data
# Tool registration example
@server.list_tools()
async def list_tools():
    return [
        Tool(
            name="get_random_joke",
            description="Get a random joke",
            inputSchema={...}
        )
    ]

# Tool execution
@server.call_tool()
async def call_tool(name: str, arguments: dict):
    if name == "get_random_joke":
        # Return random joke

šŸ“¦ Dependencies

  • mcp==1.0.0 - Model Context Protocol SDK

See requirements.txt for complete dependency list.

šŸŽÆ Current Features

āœ… 5 built-in jokes āœ… Async/await support āœ… Clean error handling āœ… Simple schema-based tool definition āœ… Stdout logging

šŸ”® Future Enhancements

  • [ ] Add joke categories (dad jokes, puns, dark humor)
  • [ ] Implement difficulty levels
  • [ ] Add joke ratings/feedback
  • [ ] Connect to external joke APIs
  • [ ] Persist user favorites
  • [ ] Multi-language support
  • [ ] Web UI for joke management

šŸ¤ Contributing

Feel free to:

  • Add more jokes to the database
  • Improve documentation
  • Report bugs
  • Suggest new features

šŸ“ License

This project is licensed under the MIT License - see LICENSE file for details.

šŸ”— Links

  • GitHub: https://github.com/tehrimaly/mcp-joke
  • MCP Specification: https://spec.modelcontextprotocol.io/
  • Anthropic MCP Docs: https://modelcontextprotocol.io/

šŸ’” Example Use Cases

  1. AI Assistant Integration - Add humor to Claude interactions
  2. Slack Bot - Integrate jokes into team communication
  3. Learning Tool - Understand MCP implementation basics
  4. Template - Use as a starting point for your own MCP servers

šŸ› Troubleshooting

Issue: Module not found error

pip install -r requirements.txt

Issue: Port already in use The server uses stdio, not a port. This shouldn't occur.

Issue: Server won't start

  • Check Python version (3.11+)
  • Verify all dependencies installed
  • Check for syntax errors

šŸ“§ Support

For issues, questions, or suggestions, please open a GitHub issue.


Made with ā¤ļø as part of the MCP learning journey

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured