MCP-servers-with-Strands-framworks-for-Agents

itsmethahseer/MCP-servers-with-Strands-framworks-for-Agents

3.2

If you are the rightful owner of MCP-servers-with-Strands-framworks-for-Agents and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

This project demonstrates a simple MCP (Model Context Protocol) server and agent system built using Strands and MCP frameworks.

Tools
3
Resources
0
Prompts
0

🧠 README.md

# 🧩 Strands Agentic MCP

This project demonstrates a simple **MCP (Model Context Protocol)** server and agent system built using **Strands** and **MCP** frameworks.  
It showcases how to define, expose, and use tools (like calculator, time, or weather retrieval) through a local MCP server that can be accessed by an agent client.

---

## šŸš€ Features

- āœ… MCP server running locally on `localhost:8000`
- āœ… Built using `Strands` and `mcp` frameworks
- āœ… Example tools:
  - **Calculator** – evaluate math expressions
  - **Current Time** – get system time in ISO format
  - **Weather API** – fetch forecast using latitude & longitude
- āœ… Environment variable management using `.env`
- āœ… Modular design (`agent.py`, `llm_client.py`, `mcp_server.py`)

---

## šŸ“‚ Project Structure

strands_agentic_mcp/ │ ā”œā”€ā”€ agent.py # Handles agent logic and MCP tool integration ā”œā”€ā”€ llm_client.py # Example LLM client interface (e.g., OpenAI) ā”œā”€ā”€ mcp_server.py # Main MCP server with multiple tools ā”œā”€ā”€ .env # Environment variables (e.g., API keys) ā”œā”€ā”€ .gitignore ā”œā”€ā”€ requirements.txt # Python dependencies └── README.md


---

## āš™ļø Setup Instructions

### 1. Clone the Repository
```bash
git clone https://github.com/<your-username>/strands_agentic_mcp.git
cd strands_agentic_mcp

2. Create a Virtual Environment

python3 -m venv env
source env/bin/activate

3. Install Dependencies

pip install -r requirements.txt

4. Add Environment Variables

Create a .env file in the project root:

OPENAI_API_KEY=your_openai_key_here

🧠 Running the MCP Server

To start your MCP server locally:

python mcp_server.py

Once running, the server will be available at:

http://localhost:8000

Example Tools

āž• Calculator
POST /tools/calculator
{
  "expression": "5 + 10 * 2"
}
ā° Current Time
POST /tools/current_time
🌦 Get Weather
POST /tools/get_weather
{
  "lat": 37.7749,
  "lon": -122.4194
}

🧩 Running the Agent

To interact with the MCP server via an agent:

python agent.py

šŸ“¦ Dependencies

List of core dependencies:

mcp
strands
httpx
python-dotenv

šŸ§‘ā€šŸ’» Author

Thahseer CK AI Developer | LLMs | MCP | Strands | FastAPI šŸ“« Connect on GitHub


🪪 License

This project is licensed under the MIT License. Feel free to use, modify, and distribute it for your own MCP/Agentic projects.