# mcp-demo **Repository Path**: liu_zy_developer/mcp-demo ## Basic Information - **Project Name**: mcp-demo - **Description**: mcp-demo,快速实现mcp服务端,提供sse端点 - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-07-21 - **Last Updated**: 2025-07-21 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # gohook [![Go Reference](https://pkg.go.dev/badge/github.com/lunny/gohook.svg)](https://pkg.go.dev/github.com/lunny/gohook) A simple and useful golang hook library. ## Features * Supports multiple hook types: HTTP, Shell, Docker, Kubernetes, Slack, Telegram, DingTalk, FeiShu, WeChat, etc. * Provides a simple configuration interface that allows users to easily define hook tasks. * Offers flexible execution methods: synchronous, asynchronous, or periodic execution. * Includes built-in support for commonly used hooks to reduce repetitive development work. ## Installation ```bash go get github.com/lunny/gohook ``` ## Usage ### Basic Usage ```go package main import ( "fmt" "github.com/lunny/gohook" ) func main() { hook := gohook.NewHook() // Add a shell hook hook.AddHook(&gohook.ShellHook{ Name: "test", Cmd: "echo 'hello world'", }) // Execute all hooks synchronously results := hook.RunAll() for _, result := range results { fmt.Printf("Hook %s executed, error: %v\n", result.Name, result.Error) } } ``` ### Advanced Usage ```go package main import ( "fmt" "github.com/lunny/gohook" ) func main() { hook := gohook.NewHook() // Add a periodic HTTP hook httpHook := &gohook.HTTPHook{ Name: "http", URL: "https://example.com", Method: "GET", Headers: map[string]string{"Content-Type": "application/json"}, Interval: 10, // Run every 10 seconds } hook.AddHook(httpHook) // Add a Docker hook dockerHook := &gohook.DockerHook{ Name: "docker", Image: "nginx", ContainerOptions: map[string]string{ "HostConfig.Memory": "268435456", }, } hook.AddHook(dockerHook) // Execute all hooks asynchronously hook.RunAsyncAll() // Wait for user input to exit fmt.Scanln() } ``` ## Supported Hook Types | Type | Description | |------------|----------------------------------------| | HTTP | Sends HTTP requests | | Shell | Executes shell commands | | Docker | Manages Docker containers | | Kubernetes | Interacts with Kubernetes clusters | | Slack | Sends messages to Slack | | Telegram | Sends messages via Telegram bot | | DingTalk | Sends messages to DingTalk | | FeiShu | Sends messages to FeiShu (Lark) | | WeChat | Sends messages to WeChat Work | ## License MIT License ## Author lunny