Get the FREE Ultimate OpenClaw Setup Guide →

mcp

一个集成了实时获取天气信息和整理谷歌搜索功能的mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio badb-lee-mcp-server java -Dspring.ai.mcp.server.stdio=true -jar path/to/weather-mcp-server.jar --weather.api.key=YOUR_WEATHER_API_KEY --serper.api.key=YOUR_SERPER_API_KEY \
  --env SERPER_API_KEY="Your Serper API key" \
  --env WEATHER_API_KEY="Your real weather API key"

How to use

This MCP server package provides two MCP endpoints: a real-time weather service and a Google-search based query tool. The weather service fetches current conditions using a weather provider API, while the search service leverages Serper (Google results) to perform queries and return structured results that can be consumed by an MCP client. The project demonstrates integration with LangChain4J, enabling you to compose AI workflows that can ask for weather updates or perform web search summarization via MCP tools. To use, run the two MCP servers, configure your API keys in application.yml or through the command-line arguments, and then connect via an MCP client as shown in the LangChain4J example: constructing an MCP transport over stdio and feeding it the server jar along with the necessary API keys. You can then call the weather endpoint to get current conditions for a city, or call the search endpoint to retrieve Google search results for a query and feed them into your AI assistant for reasoning or summarization.

How to install

Prerequisites:

  • Java JDK 8+ (for running the MCP servers)
  • Maven (optional, for building jars)
  • Access keys for the weather provider and Serper API

Step-by-step:

  1. Clone the repository to your local machine.
  2. Configure API keys in your configuration file (application.yml) or provide them via command-line arguments as shown in the mcp_config:
    • WEATHER_API_KEY: your weather provider key
    • SERPER_API_KEY: your Serper API key
  3. If you build from source, run Maven to produce the jar files, e.g.: mvn clean package -Dmaven.test.skip=true
  4. Start the MCP servers using the provided command lines, for example: java -Dspring.ai.mcp.server.stdio=true -jar path/to/weather-mcp-server.jar --weather.api.key=YOUR_WEATHER_API_KEY --serper.api.key=YOUR_SERPER_API_KEY java -Dspring.ai.mcp.server.stdio=true -jar path/to/serper-mcp-server.jar --serper.api.key=YOUR_SERPER_API_KEY
  5. Verify the servers start and are listening on the configured ports. Connect an MCP client to interact with the tools.

Notes:

  • If you adapt the server jars, ensure the keys are passed in consistently with your configuration to avoid runtime failures.
  • The example also demonstrates integrating with LangChain4J for building AI assistants that can invoke MCP tools.

Additional notes

Tips and caveats:

  • Ensure your API keys are kept secure and not checked into version control.
  • The weather service requires a valid weather provider key; without it, the weather endpoint will fail.
  • The Serper-based search endpoint relies on Serper API quotas; monitor usage to avoid hitting limits.
  • When using LangChain4J, you can enable verbose logging to inspect the MCP transport traffic for debugging.
  • If you modify the host URLs in WeatherService, keep the endpoints stable and reachable from the MCP server runtime environment.
  • If running via Docker or other container runtimes, map environment variables and mount the jars/paths accordingly.

Related MCP Servers

Sponsor this space

Reach thousands of developers