This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Neo4j read-only MCP (Model Context Protocol) server built with Spring Boot 3.5.0 and Spring AI 1.0.0. The server provides AI assistants with tools to query and explore Neo4j graph databases through standardized MCP protocol.
# Build the project
./mvnw clean compile
# Run tests
./mvnw test
# Run the application
./mvnw spring-boot:run
# Package the application
./mvnw clean package
# Run a single test class
./mvnw test -Dtest=Neo4jmcpApplicationTests
# Run with specific profile
./mvnw spring-boot:run -Dspring-boot.run.profiles=dev- Neo4jmcpApplication: Main Spring Boot application class
- MCP Server: Auto-configured by Spring AI MCP starter
- Tool Components: Service classes annotated with
@Toolfor Neo4j operations
- Java 21
- Spring Boot 3.5.0
- Spring AI 1.0.0 with MCP Server starter
- Maven for build management
The project uses Spring AI's MCP server starter which auto-configures:
- Tool registration for methods annotated with
@Tool - STDIO transport for command-line integration
- SSE transport for web-based clients
spring.application.name=neo4jmcp- Application identifier- Additional MCP server configuration should be added with
spring.ai.mcp.server.*prefix
Use Spring profiles to manage different environments (dev, test, prod) with corresponding application-{profile}.properties files.
- Create service classes with
@Toolannotated methods for Neo4j operations - Focus on read-only operations (queries, schema exploration, data visualization)
- Use proper parameter validation and error handling
- Follow the patterns established in
Java_MCP_Server_Development_Guide.md
- Add Neo4j driver dependencies when implementing
- Implement connection pooling and proper resource management
- Provide tools for Cypher query execution, graph traversal, and schema inspection
- Ensure all operations are read-only for security
- Unit tests for tool logic
- Integration tests for MCP protocol compliance
- Neo4j test containers for database integration testing