MCP Servers

A collection of Model Context Protocol servers, templates, tools and more.

S
Spring Ai MCP Demo

spring ai mcp demo

Created 12/30/2025
Updated about 10 hours ago
Repository documentation and setup instructions

spring-ai-mcp-demo

基于 AI + mcp server + mcp client + 飞书机器人实现的简单 AI 聊天示例

1. 准备工作

1.1 大模型 API key

我用的是智谱 AI,可以自行注册账号获取 API key https://bigmodel.cn/usercenter/proj-mgmt/apikeys

1.2 飞书应用机器人创建

没有飞书的可以自己注册个账号创建

  1. 前往 https://open.feishu.cn/app 创建应用
  2. 配置事件与回调、权限管理
  3. 最后发布应用,获取 App ID 和 App Secret

larkConfig1 - Spring Ai MCP Demo by kings1990

larkConfig2 - Spring Ai MCP Demo by kings1990

2. 启动步骤

  1. 打包mcp-server
cd mcp-server
mvn clean install
  1. 替换mcp-client 下 的 application.yml 中的飞书应用相关配置以及mcp-server-0.0.1-SNAPSHOT.jar的路径

lark:
  bot:
    app-id: [你的飞书应用 App ID]
    app-secret: [你的飞书应用 App Secret]

spring:
  ai:
    zhipuai:
      api-key: [你的智谱AI API key]
    mcp:
      client:
        stdio:
          connections:
            spring-ai-mcp-weather:
              command: java
              args:
                  - -Dspring.ai.mcp.server.stdio=true
                  - -jar
                  - /path/to/mcp-server-0.0.1-SNAPSHOT.jar
  1. 直接启动 mcp-client spring boot 应用,不需要额外启动 mcp-server
  2. 检查是否连接飞书应用机器人成功

日志里面可以搜到说明飞书机器人连接成功的字样

connected to wss://msg-frontier.feishu.cn/
  1. 在飞书应用中给机器人发送消息,例如北京,等待回复

3. Screenshots

sample - Spring Ai MCP Demo by kings1990

Quick Setup
Installation guide for this server

Installation Command (package not published)

git clone https://github.com/kings1990/spring-ai-mcp-demo
Manual Installation: Please check the README for detailed setup instructions and any additional dependencies required.

Cursor configuration (mcp.json)

{ "mcpServers": { "kings1990-spring-ai-mcp-demo": { "command": "git", "args": [ "clone", "https://github.com/kings1990/spring-ai-mcp-demo" ] } } }