MCP Joke Server with Authentication

MCP Joke Server with Authentication

Play around with mcp-servers and their mcp-client authentication options

flowsoft-org

Developer Tools
Visit Server

README

MCP Joke Server with Authentication

This is a sample implementation of a Model Context Protocol (MCP) server that serves programming jokes with token-based authentication using FastAPI.

Setup

  1. Open this folder in VS Code
  2. When prompted, click "Reopen in Container" to use the devcontainer configuration
  3. The container will automatically install all dependencies from requirements.txt

Running the Server

python server.py

The server will start on http://localhost:8000

Server Functionality

This MCP server provides a simple joke-telling capability. It cycles through a collection of programming-related jokes each time it's called. The server:

  1. Implements a single MCP tool called tell_joke
  2. Returns a different programming joke on each invocation
  3. Requires authentication for accessing the SSE endpoint

Authentication

The server implements a simple token-based authentication for the SSE endpoint (/sse). To make requests, you need to include a Bearer token in your HTTP headers.

For this demo, use the token: valid_token

Example curl request:

curl http://localhost:8000/sse \
  -H "Authorization: Bearer valid_token"

Any requests to the SSE endpoint without a valid token will receive a 401 Unauthorized response.

VS Code Copilot Integration

This server can be used as a custom joke-telling agent for GitHub Copilot in VS Code. To use it:

  1. Start the MCP server using python server.py
  2. The VS Code settings are already configured in .vscode/settings.json to use this server
  3. The server will respond to requests for jokes through the MCP protocol

Supported Capabilities

  • Joke telling via MCP tool
  • Token-based authentication for SSE endpoint
  • FastAPI-based HTTP server

Security Note

This is a demonstration implementation. In a production environment, you should:

  1. Use proper token validation
  2. Store secrets securely
  3. Implement proper token issuance and management
  4. Use HTTPS
  5. Add rate limiting and other security measures

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
MCP Package Docs Server

MCP Package Docs Server

Facilitates LLMs to efficiently access and fetch structured documentation for packages in Go, Python, and NPM, enhancing software development with multi-language support and performance optimization.

Featured
Local
TypeScript
Claude Code MCP

Claude Code MCP

An implementation of Claude Code as a Model Context Protocol server that enables using Claude's software engineering capabilities (code generation, editing, reviewing, and file operations) through the standardized MCP interface.

Featured
Local
JavaScript
@kazuph/mcp-taskmanager

@kazuph/mcp-taskmanager

Model Context Protocol server for Task Management. This allows Claude Desktop (or any MCP client) to manage and execute tasks in a queue-based system.

Featured
Local
JavaScript
Linear MCP Server

Linear MCP Server

Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.

Featured
JavaScript
mermaid-mcp-server

mermaid-mcp-server

A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.

Featured
JavaScript
Jira-Context-MCP

Jira-Context-MCP

MCP server to provide Jira Tickets information to AI coding agents like Cursor

Featured
TypeScript
Linear MCP Server

Linear MCP Server

A Model Context Protocol server that integrates with Linear's issue tracking system, allowing LLMs to create, update, search, and comment on Linear issues through natural language interactions.

Featured
JavaScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python