MCP Joke Server with Authentication
Play around with mcp-servers and their mcp-client authentication options
flowsoft-org
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
- Open this folder in VS Code
- When prompted, click "Reopen in Container" to use the devcontainer configuration
- 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:
- Implements a single MCP tool called
tell_joke
- Returns a different programming joke on each invocation
- 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:
- Start the MCP server using
python server.py
- The VS Code settings are already configured in
.vscode/settings.json
to use this server - 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:
- Use proper token validation
- Store secrets securely
- Implement proper token issuance and management
- Use HTTPS
- Add rate limiting and other security measures
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.
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.
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.
@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.
Linear MCP Server
Enables interaction with Linear's API for managing issues, teams, and projects programmatically through the Model Context Protocol.
mermaid-mcp-server
A Model Context Protocol (MCP) server that converts Mermaid diagrams to PNG images.
Jira-Context-MCP
MCP server to provide Jira Tickets information to AI coding agents like Cursor

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.

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.