MCP客户端模板

一个基于Spring Boot和ollama的MCP客户端模板,用于与MCP服务器进行交互。

  • by ross-stockman
  • Java
  • 本地部署
  • 更新于
在 GitHub 查看 ross-stockman/mcp-client-ollama-spring

使用说明

mcp客户端olama spring

这个项目是一个使用Spring Boot和ollama的模板MCP客户端。

克隆 [mcp-server-sse-spring](https://github.com/ross-stockman/mcp-server-sse-spring) 项目并让它在后台运行。

git clone https://github.com/ross-stockman/mcp-server-sse-spring
cd mcp-server-sse-spring

mvn spring-boot:run

使用单独的终端在此目录中使用Maven运行mcp客户端项目。

mvn spring-boot:run

这将在端口8081上启动客户端。使用curl向服务器发送聊天消息。

示例:

curl -G http://localhost:8081/chat --data-urlencode "message=Register a new service: 'foobar-service' the description is 'This is a sample service' and the status is 'INACTIVE'"
curl -G http://localhost:8081/chat --data-urlencode "message=List all available services"
curl -G http://localhost:8081/chat --data-urlencode "message=Update the status of 'foobar-service' to 'CANCELED'"
curl -G http://localhost:8081/chat --data-urlencode "message=Lookup the details of 'foobar-service' service"
curl -G http://localhost:8081/chat --data-urlencode "message=Remove the 'foobar-service' from the catalog"