Joke MCP Server
Enables developers to retrieve short jokes in multiple categories and languages during task processing. Provides fast offline fallbacks and configurable joke providers for entertainment during development workflows.
README
Joke MCP Server
A lightweight Model Context Protocol (MCP) companion that serves short jokes to developers while tasks are processed. Designed for Node.js 18+ with airtight offline defaults and fast fallbacks.
Quick Start
npm install– install dependencies (Mitigated footprint: vitest only).npm test– run offline unit + e2e suites (no network requests).node src/jokes-mcp.js– launch the server; typehealthorgetJoke {"category":"programming"}on stdin.
Environment Variables
| Variable | Description | Default |
|---|---|---|
JOKE_API |
Primary provider (jokeapi or official). |
jokeapi |
JOKE_DEFAULT_CATEGORY |
Fallback category when input omits one. | programming |
JOKE_LANG |
Default language (currently en or zh). |
en |
TIMEOUT_MS |
Per-request HTTP timeout in ms. | 2000 |
RETRIES |
Retry attempts with exponential backoff. | 2 |
ALLOW_NET |
Opt-in for live HTTP calls (true to enable). |
false |
LOG_VERBOSE |
Emit provider diagnostics to stderr. |
false |
Usage Examples
# Health check
printf 'health\n' | node src/jokes-mcp.js
# Category + language request
printf 'getJoke {"category":"programming","lang":"en"}\n' | node src/jokes-mcp.js
# Development helper
./scripts/dev.sh 'getJoke {"lang":"zh"}'
Testing
- Offline suite:
npm test - Live integration (opt-in):
npm run test:onlinewithALLOW_NET=true - Tests mock network providers by default; local fallback is validated in
tests/e2e/offline.test.js.
Codex MCP Configuration
[mcp_servers.jokes]
command = "node"
args = ["./src/jokes-mcp.js"]
env = { JOKE_API = "jokeapi", JOKE_DEFAULT_CATEGORY = "programming", JOKE_LANG = "en", TIMEOUT_MS = "2000", RETRIES = "2" }
startup_timeout_ms = 20000
Project Layout
src/jokes-mcp.js– MCP stdin loop, provider orchestration, structured logging.src/providers/– Joke providers (jokeapi,official,local) plus shared fetch helper.local-jokes.json– curated bilingual fallback pool (20 jokes, categorized).tests/– unit, offline e2e, and opt-in integration coverage.docs/integration-guide.md– playbook for wiring jokes into wait-period workflows.
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.