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; typehealth
orgetJoke {"category":"programming"}
on stdin.
Environment Variables
Variable | Description | Default |
| Primary provider (
or
). |
|
| Fallback category when input omits one. |
|
| Default language (currently
or
). |
|
| Per-request HTTP timeout in ms. |
|
| Retry attempts with exponential backoff. |
|
| Opt-in for live HTTP calls (
to enable). |
|
| Emit provider diagnostics to
. |
|
Usage Examples
Testing
Offline suite:
npm test
Live integration (opt-in):
npm run test:online
withALLOW_NET=true
Tests mock network providers by default; local fallback is validated in
tests/e2e/offline.test.js
.
Codex MCP Configuration
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.
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
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.