An advanced MCP (Model Context Protocol) server that brings powerful agentic capabilities to AI assistants, implemented as a Spring Boot application. It exposes a comprehensive set of system-, terminal-, file-, notes-, todo-, git-, and history-related tools via MCP so compatible clients can invoke them safely and efficiently.
- π§ Terminal Operations - Execute commands, manage processes, and track history
- π File Management - Complete file system operations with safety checks
- π Notes Management - Create, organize, and persist notes
- β Todo List - Advanced task management with priorities, states, and due dates
- π Git Integration - Comprehensive Git operations for version control
- π Tool History - Track and reverse tool executions with timestamps
- π‘οΈ Thread Safety - All operations are fully thread-safe for concurrent use
- π System Monitoring - Real-time system resources and environment information
- Java 21 - Modern Java with latest language features
- Spring Boot 3.5.7 - Enterprise-grade application framework
- Spring AI MCP Server Starter (
org.springframework.ai:spring-ai-starter-mcp-server) - Gradle 8.14.3 - Build system with wrapper included
- Concurrent Programming - Thread-safe design with synchronized operations
- JDK 21 installed and available on PATH
- Internet access to download dependencies on first build
- Git (for Git operations tools)
# Clean build with tests
./gradlew clean build
# Build without tests
./gradlew clean build -x testBuild Artifacts:
- Runnable Boot jar:
build/libs/AgentMode-0.0.1-SNAPSHOT.jar - Test reports:
build/reports/tests/test/index.html - Code coverage:
build/reports/jacoco/test/html/index.html
./gradlew bootRunjava -jar build/libs/AgentMode-0.0.1-SNAPSHOT.jarjava -jar build/libs/AgentMode-0.0.1-SNAPSHOT.jar --spring.config.location=classpath:/application.propertiesWhen the app starts, the MCP server auto-configures and registers all available tools. Check the startup logs to see how many tools were registered and configuration details.
# Run all tests
./gradlew test
# Run tests with coverage report
./gradlew test jacocoTestReport
# Run specific test class
./gradlew test --tests TodoListTest
# Run tests with continuous mode
./gradlew test --continuousTest report will be written to build/reports/tests/test/index.html.
The server discovers tools from Spring services using @Tool annotations. All tools are thread-safe and include comprehensive error handling.
File: terminal/Terminal.java
- execute-command: Execute a command array (each arg is a separate array element). Records successful commands to history.
File: terminal/AsyncProcessManager.java
- start-command-async: Start background processes and track them with unique IDs
- check-command-status: Check the status of running background processes
- get-command-output: Get output from completed background processes
- stop-command: Stop running background processes
- list-running-commands: List all currently running background processes
File: terminal/CommandHistory.java
- clear-command-history: Clear all command history
- get-command-history: Get command history list (thread-safe copy)
- history-save-to-file: Save history to a file (set
overwrite=trueto replace) - history-load-from-file: Load history from a file
Files: terminal/OsInfo.java, terminal/EnvironmentTools.java
- get-os, get-os-architecture, get-os-version, get-os-family, is-64-bit
- get-shell-type, get-username, get-java-version, get-java-home
- get-working-directory, get-home-directory, get-temp-directory
- get-environment-variable, get-all-environment-variables
- get-system-property, get-all-system-properties
File: terminal/SystemResources.java
- get-available-processors, get-max-memory, get-total-memory, get-free-memory
- get-system-load-average, get-disk-space-info (for a given path)
- get-memory-info, get-system-info
File: files/FileOperations.java
- file-read: Read UTF-8 text files
- file-write: Write UTF-8 content (with overwrite control)
- file-append: Append content to files
- file-copy: Copy files and directories
- file-move: Move/rename files and directories
- file-delete: Delete files and directories (recursive option)
- dir-list: List directory contents
- dir-mkdir: Create directories (recursive option)
- file-stat: Get file metadata (size, type, modified time)
- file-exists: Check if paths exist
File: git/GitTools.java
- git-clone: Clone repositories
- git-status: Get repository status
- git-branch: List and manage branches
- git-add: Add files to staging
- git-commit: Create commits
- git-push: Push to remote repositories
- git-pull: Pull from remote repositories
- git-log: View commit history
- git-checkout: Switch branches or checkout files
- git-merge: Merge branches
File: notes/Notes.java
- add-note, add-note-bulk: Add single or multiple notes
- remove-note, remove-note-bulk: Remove single or multiple notes
- clear-notes: Clear all notes
- get-notes: Get all notes (thread-safe copy)
- notes-save-to-file: Save notes to file
- notes-load-from-file: Load notes from file
File: todoList/TodoList.java
- Task Creation:
add-to-todo-list,add-to-todo-list-simpleadd-to-todo-list-bulk,add-to-todo-list-bulk-simple
- Task Removal:
remove-from-todo-list,remove-from-todo-list-bulk
- Priority Management:
add-to-priority-list,add-to-priority-list-bulkremove-from-priority-list,remove-from-priority-list-bulkget-priority-map,clear-priority-list
- State Management:
add-to-state-list,add-to-state-list-bulkremove-from-state-list,remove-from-state-list-bulkget-state-map,clear-state-list
- Due Date Management:
add-due-date,add-due-date-bulkremove-due-date,remove-due-date-bulkget-due-date-map,clear-due-date-list
- Data Access:
get-todo-map,get-todo-titlesclear-todo-list,reset
File: history/ToolHistory.java
- get-tool-history: Get complete tool execution history with timestamps
- get-tool-history-by-tool: Filter history by specific tool name
- get-tool-usage-stats: Get usage statistics for all tools
- get-tool-history-size: Get current history size
- clear-tool-history: Clear all tool history
- reverse-tools: Reverse the effects of the last N tool executions
The MCP server starter auto-configures sensible defaults. For custom configuration, create application.properties:
# MCP Server Configuration
spring.ai.mcp.server.port=8080
spring.ai.mcp.server.path=/mcp
# Logging Configuration
logging.level.me.touchie771.agentMode=INFO
logging.pattern.console=%d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%nConsult Spring AI MCP Server Starter documentation for advanced configuration options.
- Start the application (see Run section above)
- Connect an MCP-compatible client (IDE integrations, Claude Desktop, etc.)
- Configure the client to connect to
http://localhost:8080/mcp - Invoke tools by name with the expected parameters
# Start the server
./gradlew bootRun
# In your MCP client, you can now:
# - Execute commands: execute-command(["ls", "-la"])
# - Manage files: file-read("/path/to/file.txt")
# - Track history: get-tool-history()
# - Reverse operations: reverse-tools(3)- Build fails with duplicate tool names: Ensure each
@Tool(name = ...)across services is unique - Java version issues: Verify
java -versionreports 21. The Gradle toolchain is configured for Java 21 - Dependency download failures: Check network connectivity and proxy settings
- Mockito agent warning during tests: Non-fatal warning on newer JDKs; tests should still pass
- Thread safety violations: All tools are synchronized, but report any concurrency issues found
Enable debug logging:
./gradlew bootRun --args='--logging.level.me.touchie771.agentMode=DEBUG'The application exposes health endpoints:
http://localhost:8080/actuator/health- Application healthhttp://localhost:8080/actuator/info- Application information
AgentMode/
βββ src/main/java/me/touchie771/agentMode/
β βββ AgentModeApplication.java # Main application class
β βββ files/
β β βββ FileOperations.java # File system operations
β βββ git/
β β βββ GitTools.java # Git operations
β βββ history/
β β βββ ToolHistory.java # Tool execution history
β β βββ ToolExecutionRecord.java # History record model
β βββ notes/
β β βββ Notes.java # Notes management
β βββ terminal/
β β βββ AsyncProcessManager.java # Background process management
β β βββ CommandHistory.java # Command history tracking
β β βββ EnvironmentTools.java # Environment variables
β β βββ OsInfo.java # Operating system info
β β βββ SystemResources.java # System resource monitoring
β β βββ Terminal.java # Command execution
β βββ todoList/
β βββ Task.java # Task model
β βββ TaskPriority.java # Priority enum
β βββ TaskState.java # State enum
β βββ TodoList.java # Todo list management
βββ src/test/ # Test classes
βββ build.gradle # Build configuration
βββ gradle/ # Gradle wrapper
βββ README.md # This file
βββ CONTRIBUTING.md # Contribution guidelines
βββ LICENSE # License file
We welcome contributions! Please see CONTRIBUTING.md for detailed guidelines:
- Development setup
- Code style and standards
- Adding new tools
- Testing requirements
- Submission process
This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ for the AI community