spring-ai-mcp-demos

toedter/spring-ai-mcp-demos

3.3

If you are the rightful owner of spring-ai-mcp-demos and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Model Context Protocol (MCP) server is a Java-based application built with Spring Boot and Spring AI, designed to facilitate interaction with model context protocols through a user-friendly interface.

Spring AI MCP Demos

Several MCP demos (like an mcp server) written in Java with Spring Boot 3.5.x and Spring AI.

How to run the mcp server

  1. Build the MCP server

    ./gradlew build
    
  2. Download and install Claude Desktop

    • Go to https://claude.ai/download
    • Download the latest release for your operating system and extract it.
    • Make sure to disable Web access in the settings of Claude Desktop.
  3. Configure Claude Desktop

    • Edit the claude_desktop_config.json file.

    • Add or update the mcpServers section to include:

      {
        "mcpServers": {
          "demo-local": {
            "command": "java",
            "args": [
              "-jar",
              "D:\\dev\\git\\spring-ai-mcp-demos\\mcp-server\\build\\libs\\mcp-server-0.0.1-SNAPSHOT.jar",
              "--spring.profiles.active=stdio"
            ]
          }
        }
      }
      

      Adjust the path to the JAR file as needed. The example shows a Windows config. Then copy the file to the appropriate claude-desktop directory. Where to put in using different operating systems, you find at https://modelcontextprotocol.io/quickstart/user.

  4. Start Claude Desktop

    • Launch Claude Desktop.
    • Click on the "Search and Tools" icon and check if you see "mcp-demo-stdio".
  5. Use the demo

    • Interact with the MCP server through Claude Desktop’s UI.

    • In Claude Desktop you can ask questions like:

      • From which movies is Kai's favorite quote?
    • To integrate with a movie demo server, follow the steps below.

      • Clone the movie demo repository:
        git clone https://github.com/toedter/spring-hateoas-jsonapi.git
        cd spring-hateoas-jsonapi
        ./gradlew bootRun
        
      • The movie demo server will start on http://localhost:8080.
      • In Claude Desktop you can now ask questions like:
        • How many movies directed by Quentin Tarantino are in the top 100?
        • Which movies directed by Christopher Nolan are in the top ten?

License

Apache 2.0