# mcp-client-java **Repository Path**: bksqmy/mcp-client-java ## Basic Information - **Project Name**: mcp-client-java - **Description**: Spring boot + LangChain4j实现MCP-Server的调用。 Server包含调用Gitee-MCP-Server、Supos-Federated-Query-Engine-MCP-Server的DEMO - **Primary Language**: Java - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 2 - **Created**: 2025-04-23 - **Last Updated**: 2025-04-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # mcp-gitee-client-langchain4j #### 介绍 Spring boot + LangChain4j实现Gitee-MCP-Server的调用 #### Linux环境部署MCP-Server(如WSL) ##### 下载源码 ```bash git clone git@gitee.com:oschina/mcp-gitee.git git checkout v0.1.6 ``` ##### 修改Dockerfile,增加GOPROXY加速编译和设置Gitee的私人密钥 ```bash FROM golang:1.23-bullseye AS builder # Set the working directory WORKDIR /app # Copy go.mod and go.sum files COPY go.mod go.sum ./ # Set GOPROXY to cn RUN go env -w GOPROXY=https://goproxy.cn,direct # Download dependencies RUN go mod download # Copy the source code COPY . . # Build the application RUN go build -o mcp-gitee . # Final stage FROM debian:bullseye-slim #ENV SSE_ADDRESS="" #ENV GITEE_TOKEN="" #ENV GITEE_API_BASE="https://gitee.com/api/v5" # Install ca-certificates for HTTPS requests if you want #RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/* # Create a non-root user RUN useradd -r -u 1000 -m gitee # Set the working directory WORKDIR /app # Copy the binary from the builder stage COPY --from=builder --chown=1000:1000 /app/mcp-gitee /app/ # Use the non-root user USER gitee # Expose the port the app runs on EXPOSE 8000 # Run the application ENTRYPOINT ["/app/mcp-gitee", "--transport", "sse", "--sse-address", "0.0.0.0:8000", "--token", "The private access key from Gitee", "--api-base", "https://gitee.com/api/v5"] ``` ``` 备注: 1、--sse-address:对外暴露的SSE请求地址。参数会通过SSE响应中返回给客户端使用,配置时需保证可访问,如果是远端部署推荐设置为:<远端服务器IP>:8000。 2、--token:访问Gitee的OpenAPI的私有密钥。可到Gitee官网的用户设置中申请。 3、--api-base:访问Gitee的OpenAPI的BaseURL。具体可查看Gitee的帮助中心。 4、如果希望参数更动态化,可以使用Docker的环境变量传参(–env)。 ``` ##### 编译Docker镜像 ```bash cd docker buildx build --platform linux/amd64 -t oschina/mcp-gitee:v0.1.6 . ``` ##### 启动MCP-Server ```bash docker run -d -p 8000:8000 --name mcp-gitee-server oschina/mcp-gitee:v0.1.6 ```