spring-boot-ai
MCP server from dpolishuk/spring-boot-ai-mcp-server
claude mcp add --transport stdio dpolishuk-spring-boot-ai-mcp-server docker run -i spring-boot-ai-mcp-server \ --env JAVA_OPTS="Optional Java options for the container"
How to use
This MCP server provides a Spring Boot implementation of the Model Context Protocol to query and analyze cryptocurrency news. It exposes an MCP-compatible interface over HTTP and Server-Sent Events (SSE) and backs its tools with a SQLite data store and a simple token tracking service. Available tools include: search_news to fetch crypto news by keyword, get_latest_news to retrieve recent headlines, analyze_sentiment to gauge sentiment for a given token, track_token to start monitoring a specific cryptocurrency symbol, and get_tracked_tokens to list currently tracked tokens. Clients connect via the HTTP transport at /mcp/messages or via the SSE transport at /mcp/v1/sse and subscribe to events for responses and tool results. For Cursor, you typically configure a JSON mcp.json that points to the HTTP endpoint; for Cline, you configure an SSE URL to /mcp/v1/sse and the messages endpoint as needed. The server also provides a REST API surface for direct access to news and token data if you prefer non-MCP interactions.
How to install
Prerequisites:
- Docker installed and running, or a compatible container runtime
- Java 17+ and Maven if you choose to build from source
Option A: Run via Docker (recommended for MCP server)
- Ensure Docker is running on your machine.
- Pull and run the server image: docker run -i spring-boot-ai-mcp-server
- The server exposes HTTP and SSE endpoints on the container's default port. If you need to map ports, modify the docker run command to include -p 8080:8080.
Option B: Build from source (Java/Spring Boot)
- Prerequisites: Java 17+ and Maven 3.6+
- Clone the repository: git clone https://github.com/dpolishuk/spring-boot-ai-mcp-server.git cd spring-boot-ai-mcp-server
- Build the project: mvn clean install
- Run the application: mvn spring-boot:run The server will start on port 8080 by default. Verify with: curl http://localhost:8080/actuator/health
Notes:
- If you run via Docker, ensure the image name matches the one referenced in the docker run command above or build your own image from the Dockerfile if provided in the repo.
- The application uses SQLite for persistence and a lightweight cache; ensure the container or host has sufficient disk space.
Additional notes
Tips:
- The MCP endpoints are designed to be compatible with Cursor and Cline. If you see connectivity issues, verify that the transport endpoint (HTTP or SSE) is reachable and that the correct URL is configured in your client settings.
- The NewsService stores results in SQLite; if you experience startup errors, check the database file (crypto_news.db) permissions.
- For production, consider mapping a persistent volume for the SQLite database and enabling appropriate logging levels in application.yml.
- Common issues include port conflicts on 8080; use port mapping with Docker or configure Spring to listen on a different port if needed. If SSE streams fail to initialize, ensure the client subscribes to /mcp/v1/sse and the messages endpoint with a valid session.
- Environment variables can be used to tweak Java options or database paths; see the container/env docs for the chosen runtime.