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
