Notes Taker MCP Server
A Model Context Protocol (MCP) Server built with Spring Boot and Spring AI that provides AI assistants with the ability to manage notes through file-based storage.
๐ Overview
This application implements an MCP server that exposes tools for creating, reading, updating, and deleting notes. It integrates with AI assistants (like Claude, Gemini, etc.) via the Model Context Protocol, enabling them to manage notes on behalf of users.
๐ ๏ธ Tech Stack
๐ Available MCP Tools
The server exposes the following tools for AI assistants:
๐๏ธ Project Structure
notes-taker-mcp-server-app/
โโโ src/
โ โโโ main/
โ โ โโโ java/com/mcp_server/notes/
โ โ โ โโโ NotesApplication.java # Main application entry point
โ โ โ โโโ service/
โ โ โ โโโ NotesService.java # Service interface
โ โ โ โโโ impl/
โ โ โ โโโ NotesServiceImpl.java # MCP tool implementations
โ โ โโโ resources/
โ โ โโโ application.properties # Configuration
โ โโโ test/
โ โโโ java/com/mcp_server/notes/
โ โโโ NotesApplicationTests.java # Context loading test
โ โโโ service/impl/
โ โโโ NotesServiceImplTest.java # Unit tests
โโโ pom.xml
โโโ README.md
๐ Security Features
- Path Traversal Protection: Validates all file paths stay within the notes directory
- Input Sanitization: Filenames are sanitized to only allow alphanumeric characters, hyphens, and underscores
- File Size Limits: Maximum note size of 1MB to prevent abuse
โ๏ธ Configuration
Configure the application in src/main/resources/application.properties:
spring.application.name=notes
spring.main.web-application-type=none
spring.ai.mcp.server.name=notes-taker-app
spring.ai.mcp.server.version=0.0.1
# Notes storage path - defaults to ${user.home}/notes
# Override using: NOTES_PATH environment variable or -Dnotes.path=<path>
notes.path=${NOTES_PATH:${user.home}/notes}
Configuration Options
๐ Getting Started
Prerequisites
- Java 17 or higher
- Maven 3.6+
Build
./mvnw clean package
Run Tests
./mvnw test
Run the Server
java -jar target/notes-taker-app.jar
Or with a custom notes path:
NOTES_PATH=/path/to/notes java -jar target/notes-taker-app.jar
The server will start and listen for MCP STDIO communication.
๐ Integration with AI Clients
Claude Desktop Configuration
Add to your Claude Desktop config file (claude_desktop_config.json):
{
"mcpServers": {
"notes-taker": {
"command": "java",
"args": ["-jar", "/path/to/notes-taker-app.jar"],
"env": {
"NOTES_PATH": "/path/to/your/notes"
}
}
}
}
VS Code / Gemini Configuration
For VS Code with Gemini, configure in your MCP settings:
{
"servers": {
"notes-taker": {
"command": "java",
"args": ["-jar", "/path/to/notes-taker-app.jar"],
"env": {
"NOTES_PATH": "/path/to/your/notes"
}
}
}
}
๐ Tool Usage Examples
Once connected, AI assistants can use commands like:
- "List all my notes" โ Uses
list_notes - "Create a note called 'meeting-notes' with today's discussion" โ Uses
create_note - "Read the content of my project-ideas note" โ Uses
read_note - "Search for notes about project" โ Uses
search_notes - "Add an action item to my meeting-notes" โ Uses
append_to_note - "Delete the old-draft note" โ Uses
delete_note
๐ License
This project is open source.
๐ค Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues.