mcp
MCP server from alphaiterations/mcp-server
claude mcp add --transport stdio alphaiterations-mcp-server python mcp_server.py \ --env WTTR_API_KEY="not required or leave empty" \ --env OPENAI_API_KEY="your-openai-api-key" \ --env SERPER_API_KEY="your-serper-api-key"
How to use
This MCP server exposes two reusable tools that can be invoked by an MCP client via JSON-RPC: get_weather and web_search. The get_weather tool fetches current weather data for a specified city using the wttr.in API and returns structured details such as location, temperature, humidity and wind. The web_search tool queries the web using the Serper API and returns a list of top results with titles, links and snippets. Clients route user requests through a LangGraph-driven agent which decides which tool to call and what parameters to extract, then the MCP server executes the tool and returns the results. You can integrate this server with client code that builds JSON-RPC requests to tools/call with the tool name and arguments, and then presents the natural-language response generated from the tool outputs.
How to install
Prerequisites:
- Python 3.8+ installed on your machine
- Access to OpenAI API (for the LangGraph agent and tool orchestration)
- Serper API key for web_search tool
- wttr.in accessible (no key required) for weather tool
-
Clone the repository git clone https://github.com/alphaiterations/mcp-server.git cd mcp-server
-
Create a virtual environment and install dependencies python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate pip install -r requirements.txt
-
Configure environment variables
- Create a .env file or export variables in your shell: OPENAI_API_KEY=your-openai-api-key SERPER_API_KEY=your-serper-api-key WTTR_API_KEY=optional
-
Run the MCP server python mcp_server.py
-
(Optional) Run the MCP client to test the flow python mcp_client.py
-
Verify that the server exposes tools/get_weather and tools/web_search through JSON-RPC calls.
Additional notes
Tips and caveats:
- The web_search tool relies on the Serper API, so ensure your SERPER_API_KEY is valid and has remaining quota.
- The weather tool uses wttr.in; no API key is required, but ensure network access to wttr.in is allowed.
- The LangGraph routing node uses OpenAI models to decide which tool to call and with which parameters; ensure OPENAI_API_KEY is set and has sufficient credits.
- When debugging, inspect the server logs for tool invocation details and error messages returned via JSON-RPC.
- If you need to add more tools, extend the mcp_server.py with additional @mcp.tool functions following the existing pattern.
- Secure your API keys and do not commit .env files to version control.
Related MCP Servers
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP