Spring AI MCP server for course information

Spring AI MCP server for course information

spring-mcp-server-example•bydanvega

A Spring Boot application that implements an MCP server over STDIO transport, exposing course data through Spring AI tools.

License: Not specified•Runtime: Awaiting documentation review•Category: developer tools

WHAT IT DOES

  • •Registers two MCP tools: dv_get_courses to return all courses and dv_get_course to find a course by title.
  • •Runs as a non-web application using STDIO transport, without opening network ports or a web interface.
  • •Defines course tools in a service class using the Spring AI @Tool annotation and registers them via ToolCallbacks.

BEST FOR

  • •Serving a small in-memory course catalog to AI models that support MCP over STDIO.
  • •Learning how to build MCP servers with Spring AI and the @Tool annotation.

ABOUT SPRING-MCP-SERVER-EXAMPLE

Spring AI MCP server for course information is cataloged as an MCP server attributed to danvega. A Spring Boot application that implements an MCP server over STDIO transport, exposing course data through Spring AI tools. It is categorized under developer tools. See the capability inspector for recorded interfaces and their independent review status; consult upstream documentation for the current interface.

HOW TO INSTALL

Installation configuration is not reviewed. No executable setup is offered for this entry; inspect the source repository before proceeding.

LICENSE

Catalog license label: Not specified. Check the source repository's current license and terms before using, modifying or distributing this software.

能力检查器

能力定义尚未审核。未核验的采集内容不会作为可信接口展示。

Tools (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Resources (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

Prompts (0)

暂无可展示的已审核记录。这不表示上游不支持此能力。

NEWSLETTER - COMING LATER

Newsletter subscriptions are not open yet

Email delivery is not connected. This page does not collect email addresses or create subscriptions.

Browse the registry for current listings instead.

Community Reviews

Coming later

Reviews for Spring AI MCP server for course information are not available yet

Review publishing and storage are not connected. This page does not collect or publish ratings or comments, including after sign-in.

FREQUENTLY ASKED QUESTIONS

What data does the server expose?

It exposes a list of courses, each with a title and URL, held in an in-memory list.

上游原版 README

在 GitHub 查看同一版本原文

README.md · 418c3982b884 · 采集于 2026-11-13 11:59:52 UTC

保留上游原文,不做 AI 改写。为安全起见过滤脚本、表单和不安全链接。

当前显示最后一次成功采集的文档快照,请以来源页面为准。

Spring AI MCP Server for Course Information

Overview

This repository contains a Spring Boot application that implements the Model Control Protocol (MCP) server for providing course information. The application creates a lightweight server that can expose course data through the Spring AI MCP framework, allowing AI models to interact with your custom data services using standardized tooling.

The server exposes two main tools:

  • A tool to retrieve all available courses
  • A tool to search for specific courses by title

This implementation serves as an excellent starting point for creating your own Model Control Protocol servers or for integrating external data sources with AI models through Spring AI.

Project Requirements

  • Java 24
  • Maven 3.8+
  • Spring Boot 3.4.4
  • Spring AI 1.0.0-M6

Dependencies

The project relies on the following key dependencies:

  • Spring AI MCP Server: Provides the foundation for creating MCP-compatible servers

    <dependency>
        <groupId>org.springframework.ai</groupId>
        <artifactId>spring-ai-mcp-server-spring-boot-starter</artifactId>
    </dependency>
    
  • Spring Boot Test: For testing the application

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    

Getting Started

Prerequisites

Before running the application, make sure you have:

  • Java 24 installed on your system
  • Maven installed for dependency management
  • Basic understanding of Spring Boot applications

Setting Up the Project

  1. Review the project structure to understand the components:

    • Course.java: A simple record representing course data
    • CourseService.java: Service with MCP tool annotations
    • CoursesApplication.java: Main application class with tool registration
    • application.properties: Configuration for the MCP server
  2. The application is configured to run as a non-web application using STDIO transport for MCP communication:

    spring.main.web-application-type=none
    spring.ai.mcp.server.name=dan-vega-mcp
    spring.ai.mcp.server.version=0.0.1
    
    # These settings are critical for STDIO transport
    spring.main.banner-mode=off
    logging.pattern.console=
    

How to Run the Application

Running the application is straightforward with Maven:

mvn spring-boot:run

The application will start as a Model Control Protocol server accessible via standard input/output. It doesn't open any network ports or provide a web interface, as indicated by the spring.main.web-application-type=none configuration.

When running, the server registers two tools with the MCP:

  • dv_get_courses: Returns all available courses
  • dv_get_course: Returns a specific course by title

Understanding the Code

Defining Data Models

The application uses a simple record to represent course data:

public record Course(String title, String url) {
}

This immutable data structure provides a clean way to represent course information with title and URL attributes.

Implementing Tool Functions

The CourseService class demonstrates how to create MCP tools using the @Tool annotation:

@Service
public class CourseService {
    private List<Course> courses = new ArrayList<>();

    @Tool(name = "dv_get_courses", description = "Get a list of courses from Dan Vega")
    public List<Course> getCourses() {
        return courses;
    }

    @Tool(name = "dv_get_course", description = "Get a single courses from Dan Vega by title")
    public Course getCourse(String title) {
        return courses.stream()
                .filter(course -> course.title().equals(title))
                .findFirst()
                .orElse(null);
    }

    @PostConstruct
    public void init() {
        courses.addAll(List.of(
                new Course("Building Web Applications with Spring Boot (FreeCodeCamp)", 
                          "https://youtu.be/31KTdfRH6nY"),
                new Course("Spring Boot Tutorial for Beginners - 2023 Crash Course using Spring Boot 3",
                          "https://youtu.be/UgX5lgv4uVM")
        ));
    }
}

The @Tool annotation transforms regular methods into MCP-compatible tools with:

  • A unique name for identification
  • A description that helps AI models understand the tool's purpose

Registering Tools with MCP

In the main application class, tools are registered with the MCP framework:

@SpringBootApplication
public class CoursesApplication {

    public static void main(String[] args) {
        SpringApplication.run(CoursesApplication.class, args);
    }

    @Bean
    public List<ToolCallback> danTools(CourseService courseService) {
        return List.of(ToolCallbacks.from(courseService));
    }
}

The ToolCallbacks.from() method scans the service class for @Tool annotations and registers them with the MCP framework.

Extending the Project

You can extend this project in several ways:

  1. Add more courses: Modify the init() method in CourseService to include additional courses.

  2. Create new tool functions: Add more methods with the @Tool annotation to expose additional functionality.

  3. Implement database storage: Replace the in-memory list with a database connection to store course information persistently.

  4. Add search capabilities: Implement more advanced search functions beyond exact title matching.

Example of adding a search function:

@Tool(name = "dv_search_courses", description = "Search courses containing a keyword")
public List<Course> searchCourses(String keyword) {
    return courses.stream()
            .filter(course -> course.title().toLowerCase().contains(keyword.toLowerCase()))
            .collect(Collectors.toList());
}

Using the MCP Server with AI Models

To utilize this MCP server with AI models:

  1. Ensure your AI framework supports the Model Control Protocol
  2. Connect the AI model to the MCP server using STDIO transport
  3. The AI model can then invoke the exposed tools:
    • Request a list of all courses
    • Retrieve details about a specific course by title

This allows AI models to access real-time course information and provide it in responses to user queries.

Configuration for Claude Desktop Client

To use this MCP server with the Claude Desktop client, you need to add configuration to tell Claude where to find the server. Add the following configuration to your Claude Desktop setup:

{
  "dan-vega-mcp": {
    "command": "/Users/vega/.sdkman/candidates/java/current/bin/java",
    "args": [
      "-jar",
      "/Users/vega/Downloads/courses/target/courses-0.0.1-SNAPSHOT.jar"
    ]
  }
}

This configuration:

  • Creates a tool named "dan-vega-mcp" in Claude Desktop
  • Specifies the path to your Java executable
  • Provides arguments to run the compiled JAR file

Make sure to adjust the paths to match your specific environment:

  • Update the Java path to match your installation
  • Update the JAR file path to where your compiled application is located

Conclusion

This Spring AI MCP Server provides a clean, extensible framework for exposing course data through the Model Control Protocol. By following the Spring AI conventions and leveraging the tool annotation system, you can create powerful integrations between AI models and your data services.

The project demonstrates how to structure your code for MCP compatibility while maintaining good software design practices. With this foundation, you can build more complex data providers that enhance AI capabilities with access to custom, domain-specific information.

For more information about Spring AI and the Model Control Protocol, refer to the official documentation.

Install configuration

Are you the maintainer?

Claim this server with your GitHub account to request manual ownership verification.

README Embed Badge
Markdown

Link to the catalog listing for Spring AI MCP server for course information from your README. This badge does not certify ownership, compatibility or security.

[![MCP catalog listing](https://img.shields.io/badge/MCP-awesome--mcp-orange?style=flat-square)](https://awesome-mcp.com/servers/spring-mcp-server-example)

REPOSITORY STATS

GitHub StarsUnavailable
ForksUnavailable

Public repository statistics could not be verified. Check the configured source address; unavailable counts are not zero.

下载与拉取统计

来源、范围和时段分别列出;不相加,不代表安装人数、活跃用户或安全审核。

尚无已审核的包 / 镜像标识,暂不展示下载统计。

Related developer tools MCP Servers

Alternative and complementary servers in the same category

View all in developer tools →
Postbye
postbye-mcp•postbye-team

A directory listing describing a cancellation-letter and mailing-address service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools
Singapore Proxy MCP
singapore-proxy-mcp•Xavierfok

A hosted MCP service for browsing and searching through Singapore mobile-network proxies.

0
Developer Tools

A directory listing describing a Markdown-to-PDF service. The configured public GitHub repository returned 404 during source verification.

Repository stats unavailable
Developer Tools