{"id":30201445,"url":"https://github.com/will8ug/mcpwithspring-server","last_synced_at":"2026-05-14T21:04:04.851Z","repository":{"id":309381916,"uuid":"1035369059","full_name":"will8ug/mcpwithspring-server","owner":"will8ug","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-12T15:26:39.000Z","size":19,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-29T14:15:23.506Z","etag":null,"topics":["mcp","mcp-server","spring-ai"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/will8ug.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-10T08:48:03.000Z","updated_at":"2025-08-12T15:26:43.000Z","dependencies_parsed_at":"2025-08-11T16:16:03.921Z","dependency_job_id":"f9bf1f2f-254a-419d-891a-766df11c4313","html_url":"https://github.com/will8ug/mcpwithspring-server","commit_stats":null,"previous_names":["will8ug/mcpwithspring-server"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/will8ug/mcpwithspring-server","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will8ug%2Fmcpwithspring-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will8ug%2Fmcpwithspring-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will8ug%2Fmcpwithspring-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will8ug%2Fmcpwithspring-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/will8ug","download_url":"https://codeload.github.com/will8ug/mcpwithspring-server/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/will8ug%2Fmcpwithspring-server/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33043249,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-14T02:00:06.663Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["mcp","mcp-server","spring-ai"],"created_at":"2025-08-13T10:23:40.830Z","updated_at":"2026-05-14T21:04:04.846Z","avatar_url":"https://github.com/will8ug.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MCP Weather Server with Spring WebFlux and Spring AI\n\nA simple Model Context Protocol (MCP) server built with Spring WebFlux and Spring AI that provides weather information through a mocked weather API.\n\n## Features\n\n- **Weather Service**: Mock weather data service that returns temperature, condition, humidity, and wind speed\n- **Spring AI MCP Tools**: Two MCP tools available using Spring AI tool annotations:\n  - `get_weather`: Returns detailed weather data for a city\n  - `get_weather_summary`: Returns a human-readable weather summary for a city\n- **REST API**: Standard REST endpoints for direct weather queries\n- **Reactive**: Built with Spring WebFlux for non-blocking, reactive programming\n- **Spring AI Integration**: Uses Spring AI's MCP server WebFlux starter for seamless MCP integration\n\n## Dependencies\n\n- Spring Boot 3.5.4\n- Spring WebFlux\n- Spring AI MCP Server WebFlux Starter\n- Spring AI Model (for tool annotations)\n- MCP SDK 0.10.0\n- Reactor Test (for testing)\n\n## Running the Application\n\n1. **Start the server**:\n   ```bash\n   ./mvnw spring-boot:run\n   ```\n\n2. **Test the REST API**:\n   ```bash\n   # Get weather data for a city\n   curl http://localhost:8080/api/weather/London\n   \n   # Get weather summary for a city\n   curl http://localhost:8080/api/weather/London/summary\n   ```\n\n## MCP Tools\n\nThe application uses Spring AI's `@Tool` annotation to automatically register MCP tools:\n\n### get_weather\nReturns detailed weather information for a specified city.\n\n**Parameters:**\n- `city` (string, required): The name of the city\n\n**Example Response:**\n```json\n{\n  \"city\": \"London\",\n  \"temperature\": \"22°C\",\n  \"condition\": \"Sunny\",\n  \"humidity\": \"65%\",\n  \"windSpeed\": \"10 km/h\",\n  \"description\": \"Clear skies with light breeze\"\n}\n```\n\n### get_weather_summary\nReturns a human-readable weather summary for a specified city.\n\n**Parameters:**\n- `city` (string, required): The name of the city\n\n**Example Response:**\n```\nThe weather in London is Sunny with a temperature of 22°C. Clear skies with light breeze.\n```\n\n## Architecture\n\n- **WeatherService**: Core service with Spring AI `@Tool` annotations for MCP integration\n- **WeatherController**: REST controller for direct API access\n- **Spring AI MCP Server**: Automatically configured MCP server using Spring AI's WebFlux starter\n\n## Code Structure\n\n```java\n@Service\npublic class WeatherService {\n\n    @Tool(name = \"get_weather\", description = \"Get current weather information for a specific city\")\n    public Mono\u003cMap\u003cString, Object\u003e\u003e getWeather(String city) {\n        // Mock weather data implementation\n    }\n\n    @Tool(name = \"get_weather_summary\", description = \"Get a human-readable weather summary for a specific city\")\n    public Mono\u003cString\u003e getWeatherSummary(String city) {\n        // Weather summary implementation\n    }\n}\n```\n\n## Testing\n\nRun the tests with:\n```bash\n./mvnw test\n```\n\nThe test suite includes:\n- Weather service functionality tests\n- Weather data structure validation\n- Weather summary generation tests\n\n## MCP Integration\n\nThe Spring AI MCP server WebFlux starter automatically:\n- Discovers `@Tool` annotated methods\n- Registers them as MCP tools\n- Provides MCP protocol endpoints\n- Handles tool execution and response formatting\n\nThis approach leverages Spring AI's built-in MCP capabilities for a clean, maintainable implementation. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwill8ug%2Fmcpwithspring-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwill8ug%2Fmcpwithspring-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwill8ug%2Fmcpwithspring-server/lists"}