liveBook · Manning

MCP Filesystem server

As explained in Spring AI in Action

The Filesystem MCP Server is an MCP server that exposes filesystem operations to connected AI applications.

The Filesystem MCP Server exposes filesystem operations to AI applications through an MCP client. A Spring AI application can connect to it and make its tools available to a conversational controller. section 7.2

A practical Spring Boot integration requires:

  • Create a project with Spring Web, OpenAI, and MCP Client dependencies. section 7.2
  • Configure a stdio server reference using Spring properties or Claude Desktop-compatible JSON. section 7.2
  • Register the resulting ToolCallbackProvider with ChatClient so prompts can invoke filesystem tools. section 7.2
Listing 7.1 Configuring an MCP Server reference in a client’s application.yml
spring:
  ai:
    mcp:
      client:
        stdio:
          connections:
            filesystem:   #1
              command: 'npx'  #2
              args:  #3
                - '-y'
                - '@modelcontextprotocol/server-filesystem'
                - '/Users/habuma/mcp-playground'

        toolcallback:
          enabled: true

Shows the YAML configuration that launches the filesystem server with npx, passes a directory path, and enables tool callbacks. section 7.2

Ask the filesystem server

An /ask endpoint can answer requests to list files, create penguins.txt with generated content, and read the file afterward. section 7.2

How Spring AI in Action covers it

How deep it goes
Demonstrates project setup, stdio configuration, tool registration, and endpoint usage without detailing server internals.
Examples
Uses YAML, JSON, an /ask controller, file listing, file creation, and file reading.
What it assumes
Assumes Spring Boot familiarity while specifying Spring Web, OpenAI, and MCP Client project dependencies.
What you can do after
Operate filesystem tools through a Spring AI endpoint that answers natural-language requests.
How it connects
Links MCP clients, Spring Boot, Spring AI, ChatClient, tool callbacks, and Claude Desktop configuration.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring AI in Action. The section links point to the parts of the book it draws on.