Cover image
Try Now
2025-04-04

部署:使用C#SDK的MCP服务器用Jokeapi的笑话来增强注释。

3 years

Works with Finder

1

Github Watches

0

Github Forks

0

Github Stars

Comedy MCP Server

A Model Context Protocol (MCP) server implementation that provides comedy-related tools and services for AI assistants. This server integrates with Cursor IDE and offers various comedy-related functionalities through MCP tools.

Overview

The Comedy MCP Server is built using ASP.NET Core and implements the Model Context Protocol (MCP) to provide AI assistants with tools for generating programming jokes and funny code comments. It serves as a bridge between AI models and comedy-related functionalities.

MCP Server Integration Proof

Features

  • Programming Jokes: Generates random programming-related jokes
  • Code Comments: Creates humorous comments based on code context and topics
  • Echo Service: Demonstration service showing logging capabilities
  • Swagger Integration: API documentation and testing interface
  • Health Check Endpoint: Basic server status monitoring

Architecture

The server is built with the following components:

  • MCP Server Integration: Uses ModelContextProtocol.Server for MCP implementation
  • Comedy Services: Implements IComedyService for joke and comment generation
  • HTTP Communication: Uses stdio for communication with Cursor IDE
  • Logging: Comprehensive logging with configurable levels
  • CORS Support: Configured for MCP inspector tool

Tools

The server provides the following MCP tools:

  1. GetProgrammingJoke

    • Description: Retrieves a random programming-related joke
    • Parameters: None
    • Returns: A string containing the joke
  2. GetCodeComment

    • Description: Generates a funny comment related to specific code context
    • Parameters:
      • codeContext: The code snippet or context
      • topic: The topic for the comment
    • Returns: A humorous comment related to the code
  3. EchoWithLog

    • Description: Demonstration tool that echoes messages with logging
    • Parameters:
      • message: The message to echo
    • Returns: The echoed message

Setup and Configuration

Prerequisites

  • .NET 8.0 SDK or later
  • Node.js 14+ (for MCP inspector tool)
  • A code editor (preferably Cursor IDE for best integration)
  • Git (for version control)

Installation Steps

  1. Clone the repository:
git clone [your-repository-url]
cd ComedyMcpServer
  1. Set up environment:

    • Copy the example environment file:
      copy .env.example .env    # On Windows
      # OR
      cp .env.example .env     # On Unix-based systems
      
    • Update the .env file with your settings if needed
  2. Install dependencies:

dotnet restore
  1. Build the project:
dotnet build

Running the Server

You have several options to run the server:

  1. Development Mode:
dotnet run --environment Development
  1. With MCP Inspector (recommended for debugging MCP tools):
npx @modelcontextprotocol/inspector dotnet run
  1. Production Mode:
dotnet run --environment Production

Verifying Installation

  1. Check the server is running:

    • Open your browser to http://localhost:5000 or the configured port
    • You should see the message "Comedy MCP Server is running!"
  2. Access Swagger Documentation:

    • Navigate to http://localhost:5000/swagger
    • You should see the API documentation
  3. Test MCP Tools:

    • Use the included test script:
      node test-mcp.js
      
    • Or use the MCP inspector interface if running with inspector

Troubleshooting

Common issues and solutions:

  1. Port already in use:

    • Change the port in appsettings.json
    • Or stop the process using the current port
  2. Dependencies missing:

    • Run dotnet restore again
    • Check your .NET SDK version matches the project requirements
  3. Environment variables not loading:

    • Ensure .env file exists and is properly formatted
    • Restart the application after modifying environment files

For more detailed issues, check the application logs in the console output.

Development

The project follows standard ASP.NET Core practices with additional MCP-specific components:

  • Services are registered in the DI container
  • Tools are automatically discovered from the assembly
  • Logging is configured for development and debugging
  • Swagger is available for API documentation

Deployment

The project includes:

  • Procfile: For platform deployment
  • nixpacks.toml: Build configuration
  • Standard ASP.NET Core deployment options

Testing

A test script (test-mcp.js) is included for verifying MCP functionality.

Health Check

Access the root endpoint (/) to verify server status:

GET / -> "Comedy MCP Server is running!"

API Documentation

When running, access Swagger UI at:

/swagger

Contributing

Feel free to contribute by:

  1. Implementing new comedy-related tools
  2. Enhancing existing joke generation
  3. Improving error handling and logging
  4. Adding new comedy services

License

[Your license information here]

相关推荐

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Lists Tailwind CSS classes in monospaced font

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • https://appia.in
  • Siri Shortcut Finder – your go-to place for discovering amazing Siri Shortcuts with ease

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • tomoyoshi hirata
  • Sony α7IIIマニュアルアシスタント

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

  • HiveNexus
  • 一个适用于中小型团队的AI聊天机器人,支持DeepSeek,Open AI,Claude和Gemini等车型。 专为中小团队设计的ai聊天应用,支持deepSeek,打开ai,claude,双子座等模型。

  • ravitemer
  • 一个功能强大的Neovim插件,用于管理MCP(模型上下文协议)服务器

  • patruff
  • Ollama和MCP服务器之间的桥梁,使本地LLMS可以使用模型上下文协议工具

  • pontusab
  • 光标与风浪冲浪社区,查找规则和MCP

  • JackKuo666
  • 🔍使AI助手可以通过简单的MCP接口搜索和访问PYPI软件包信息。

    Reviews

    5 (1)
    Avatar
    user_jaTu1eeZ
    2025-04-17

    As a devoted user of ComedyMcpServer, I can't recommend it enough. Tanner253 has crafted an incredibly reliable and user-friendly product that just works. The seamless integration and straightforward setup make it a go-to for anyone in need of a comedic touch to their MCP applications. Be sure to check it out at https://github.com/Tanner253/ComedyMcpServer!