MCP LLaMA
An MCP server with weather tools and LLaMA integration.
MCP LLaMA
A Model Context Protocol (MCP) implementation with weather tools and LLaMA integration.
Components
- Server:
weather_mcp_server.py- Weather MCP server (MCP Server Guide) - Client:
mcp_client.py- Generic MCP client (MCP Client Guide) - Agent:
mcp_llama_agent.py- LLaMA-powered MCP agent
Quick Start
1. Run Weather Server
uv --directory src run weather_mcp_server.py
2. Run MCP Client
python src/mcp_client.py src/weather_mcp_server.py
3. Run LLaMA Agent
python src/mcp_llama_agent.py
Claude Desktop Integration
Add to claude_desktop_config.json:
{
"mcpServers": {
"weather": {
"command": "uv",
"args": [
"--directory",
"D:/prj/mcp_llama/src",
"run",
"weather_mcp_server.py"
]
}
}
}
Development
MCP Inspector
npx @modelcontextprotocol/inspector
transport: STDIO
command: uv
args: --directory D:/prj/mcp_llama/src run weather_mcp_server.py
Browser Tools tab
Example Usage
python src/mcp_client.py src/weather_mcp_server.py
Query: "with coordinates for new york, find what is the weather"
Response: Weather forecast with current conditions, tonight's forecast, and upcoming days with temperature and precipitation details.
Claude API Call log
Query: with coordinates for new york, find what is the weather
2025-06-29 19:37:42,473 - __main__ - INFO - Sending query to claude-3-5-sonnet-20241022 wiih message: [{'role': 'user', 'content': 'with coordinates for new york, find what is the weather'}] and available tools: [{'name': 'get_alerts', 'description': 'Get weather alerts for a US state.\n\n Args:\n state: Two-letter US state code (e.g. CA, NY)\n ', 'input_schema': {'properties': {'state': {'title': 'State', 'type':Query: with coordinates for new york, find what is the weather
2025-06-29 19:37:42,473 - __main__ - INFO - Sending query to claude-3-5-sonnet-20241022 wiih message: [{'role': 'user', 'content': 'with coordinates for new york, find what is the weather'}] and available tools: [{'name': 'get_alerts', 'description': 'Get weather alerts for a US state.\n\n Args:\n state: Two-letter US state code (e.g. CA, NY)\n ', 'input_schema': {'properties': {'state': {'title': 'State', 'type': 'string'}}, 'required': ['state'], 'title': 'get_alertsArguments', 'type': 'object'}}, {'name': 'get_forecast', 'description': 'Get weather forecast for a location.\n\n Args:\n latitude: Latitude of the location\n longitude: Longitude of the location\n ', 'input_schema': {'properties': {'latitude': {'title': 'Latitude', 'type': 'number'}, 'longitude': {'title': 'Longitude', 'type': 'number'}}, 'required': ['latitude', 'longitude'], 'title': 'get_forecastArguments', 'type': 'object'}}]
2025-06-29 19:37:46,287 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2025-06-29 19:37:50,164 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
Response: I'll help you get the weather forecast for New York City using its approximate coordinates.
New York City's coordinates are approximately latitude 40.7128° N and longitude 74.0060° W (negative for western hemisphere).
[Calling tool get_forecast with args {'latitude': 40.7128, 'longitude': -74.006}]
Here's a summary of the weather forecast for New York City:
- Currently this afternoon it's mostly sunny with a temperature of 88°F and light westerly winds
- Tonight will be mostly clear with a low of 72°F
- Tomorrow (Monday) will be partly sunny with a high of 82°F and a slight chance of showers/thunderstorms in the late afternoon
- Tuesday brings a higher chance of showers and thunderstorms with a high of 85°F
Would you like me to check if there are any weather alerts for New York state as well?
Query: with coordinates for new york, find what is the weather
2025-06-29 19:37:42,473 - __main__ - INFO - Sending query to claude-3-5-sonnet-20241022 wiih message: [{'role': 'user', 'content': 'with coordinates for new york, find what is the weather'}] and available tools: [{'name': 'get_alerts', 'description': 'Get weather alerts for a US state.\n\n Args:\n state: Two-letter US state code (e.g. CA, NY)\n ', 'input_schema': {'properties': {'state': {'title': 'State', 'type': 'string'}}, 'required': ['state'], 'title': 'get_alertsArguments', 'type': 'object'}}, {'name': 'get_forecast', 'description': 'Get weather forecast for a location.\n\n Args:\n latitude: Latitude of the location\n longitude: Longitude of the location\n ', 'input_schema': {'properties': {'latitude': {'title': 'Latitude', 'type': 'number'}, 'longitude': {'title': 'Longitude', 'type': 'number'}}, 'required': ['latitude', 'longitude'], 'title': 'get_forecastArguments', 'type': 'object'}}]
2025-06-29 19:37:46,287 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2025-06-29 19:37:50,164 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
Response: I'll help you get the weather forecast for New York City using its approximate coordinates.
New York City's coordinates are approximately latitude 40.7128° N and longitude 74.0060° W (negative for western hemisphere).
[Calling tool get_forecast with args {'latitude': 40.7128, 'longitude': -74.006}]
Here's a summary of the weather forecast for New York City:
- Currently this afternoon it's mostly sunny with a temperature of 88°F and light westerly winds
- Tonight will be mostly clear with a low of 72°F
- Tomorrow (Monday) will be partly sunny with a high of 82°F and a slight chance of showers/thunderstorms in the late afternoon
- Tuesday brings a higher chance of showers and thunderstorms with a high of 85°F
Would you like me to check if there are any weather alerts for New York state as well?
'string'}}, 'required': ['state'], 'title': 'get_alertsArguments', 'type': 'object'}}, {'name': 'get_forecast', 'description': 'Get weather forecast for a location.\n\n Args:\n latitude: Latitude of the location\n longitude: Longitude of the location\n ', 'input_schema': {'properties': {'latitude': {'title': 'Latitude', 'type': 'number'}, 'longitude': {'title': 'Longitude', 'type': 'number'}}, 'required': ['latitude', 'longitude'], 'title': 'get_forecastArguments', 'type': 'object'}}]
2025-06-29 19:37:46,287 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
2025-06-29 19:37:50,164 - httpx - INFO - HTTP Request: POST https://api.anthropic.com/v1/messages "HTTP/1.1 200 OK"
Response: I'll help you get the weather forecast for New York City using its approximate coordinates.
New York City's coordinates are approximately latitude 40.7128° N and longitude 74.0060° W (negative for western hemisphere).
[Calling tool get_forecast with args {'latitude': 40.7128, 'longitude': -74.006}]
Here's a summary of the weather forecast for New York City:
- Currently this afternoon it's mostly sunny with a temperature of 88°F and light westerly winds
- Tonight will be mostly clear with a low of 72°F
- Tomorrow (Monday) will be partly sunny with a high of 82°F and a slight chance of showers/thunderstorms in the late afternoon
- Tuesday brings a higher chance of showers and thunderstorms with a high of 85°F
Would you like me to check if there are any weather alerts for New York state as well?
Llama API Call log
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Agent Skill Loader
MCP server to dynamically load Claude Code skills into AI agents
MCP Music Analysis
Analyze audio from local files, YouTube, or direct links using librosa.
MCP Aggregator
A universal aggregator that combines multiple MCP servers into a single endpoint.
Hello World MCP Server
A simple Hello World MCP server built with FastMCP, serving as a basic example.
Kite Trading MCP Server
An MCP server for the Zerodha Kite Connect API, featuring fully automated authentication without manual token handling.
MLflow MCP Server
Integrates with MLflow, enabling AI assistants to interact with experiments, runs, and registered models.
Replicate Recraft V3
Generate high-quality images using the Recraft V3 model via the Replicate API.
Claude-FAF-MCP
Only Persistent Project Context MCP Server - Official Anthropic Registry
MCP Servers
A collection of reference implementations for the Model Context Protocol (MCP), demonstrating how to give LLMs secure access to tools and data using Typescript and Python SDKs.
Credential Manager
A server for securely managing API credentials locally through the Model Context Protocol (MCP).