spring-ai
스프링부트와 AI를 활용한 엑셀, PPT 생성 서버
claude mcp add --transport stdio haeseoky-spring-ai-mcp-server java -jar build/libs/spring-ai-mcp-server-0.0.1-SNAPSHOT.jar \ --env OPENAI_API_KEY="your_openai_api_key_here"
How to use
Spring AI MCP Server exposes REST endpoints to generate Excel and PowerPoint documents using AI capabilities. Built with Java 17 and Spring Boot, it leverages Spring AI to interact with OpenAI for content generation and Apache POI for document creation. You can request an Excel document by posting a JSON payload that describes the desired report structure, and you can request a PowerPoint presentation similarly by detailing sections and content. The server processes requests asynchronously via RESTful APIs and returns document references and statuses that you can poll for completion.
To use the API, first ensure you have your OpenAI API key set as an environment variable (OPENAI_API_KEY). Then send a POST request to /api/documents with a payload specifying documentType (EXCEL or POWERPOINT), a title, content summary, and an array of sections. You can later check the status of a generated document at /api/documents/{documentId} and download completed files from the respective endpoints /api/documents/excel/download/{fileName} or /api/documents/ppt/download/{fileName}.
How to install
Prerequisites:
- Java 17 or higher
- Gradle (wrapper is used in the project)
- OpenAI API key
Installation steps:
- Clone the repository
- Navigate to the project root
- Build the application with Gradle:
./gradlew clean build
- Run the built JAR:
java -jar build/libs/spring-ai-mcp-server-0.0.1-SNAPSHOT.jar
- Ensure the server starts up and is reachable at http://localhost:8080. Set the OpenAI API key in your environment before starting the server, e.g.:
export OPENAI_API_KEY=your_api_key
Additional notes
Environment variables and configuration:
- OPENAI_API_KEY: required for AI content generation using OpenAI.
- app.document.temp-dir (in application.yml): optional path for temporary files created during generation (defaults to system tmp dir).
Common issues:
- If the server cannot reach OpenAI, verify the API key and network access.
- Ensure Java 17+ is installed and the application has permission to bind to port 8080.
- For large documents, monitor the asynchronous processing status via /api/documents/{documentId}.