# mcp-learn **Repository Path**: dongrv/mcp-learn ## Basic Information - **Project Name**: mcp-learn - **Description**: 用Golang实现MCP Server - **Primary Language**: Go - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-11-13 - **Last Updated**: 2025-11-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mcp-learn This is an open-source project hosted on Gitee, designed to demonstrate how to build and use an MCP (Model Control Protocol) server. The project includes multiple components: an LLM (Large Language Model) client, an MCP server, and several utility tools. ## Project Structure - `llm/llm.go`: Provides a client implementation for interacting with LLMs. - `main.go`: The main entry point of the project. - `mcp-servers/writer/main.go`: Implements an MCP server for handling write operations. - `utils/utils.go`: Contains utility functions for registering and invoking MCP tools. ## Key Features - Provides an integrated client for DeepSeek LLM. - Implements an MCP server supporting tool registration and invocation. - Offers a simple write function as an example MCP tool. ## Installation and Usage ### Dependencies - Go 1.21 or higher - Required dependencies (automatically managed via `go mod`) ### Build and Run 1. Clone the project repository. 2. Navigate to the project directory and run `go run main.go` to start the main program. 3. For the MCP server, go to the `mcp-servers/writer` directory and run `go run main.go`. ## Usage Example Here is a simple example of how to use an MCP tool: ```go result, err := utils.InvokeMCPTool("write", map[string]interface{}{ "content": "Hello, MCP!", }) if err != nil { log.Fatalf("Failed to invoke MCP tool: %v", err) } fmt.Println("Result:", result) ``` ## Contribution Guidelines Contributions to code and documentation are welcome. Please submit a Pull Request to this project repository. ## License This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.