demo_mcp_server

yeabwang/demo_mcp_server

3.2

If you are the rightful owner of demo_mcp_server 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 is a boilerplate for running a local MCP server integrated with the Groq LLM API, designed for testing and orchestrating LLM workflows.

Tools
1
Resources
0
Prompts
0

Demo MCP Server with Groq LLM Integration

This is a simple boilerplate project for running a local MCP (Model-Context Protocol) server and interacting with it using the Groq API (Llama 3, Gemma, etc.). Useful for testing tool integration, agent workflows, and LLM orchestration.

Contents

FileDescription
weather.pyDefines an MCP tool called get_weather
groq_client.pyCalls the Groq API and optionally the MCP server
main.pyEntry point for test/debug
requirements.txtPython package dependencies
pyproject.tomlProject metadata and optional config

Prerequisites

  • Python 3.11 or higher
  • pipx and uv (for clean Python environments)
  • Groq API key from https://console.groq.com
  • Unix shell or Git Bash on Windows

Setup

1. Clone the repository

git clone https://github.com/yourname/demo_mcp_server.git
cd demo_mcp_server

2. Create and activate the virtual environment

uv venv
source .venv/Scripts/activate    # Windows (Git Bash)
# or
source .venv/bin/activate        # macOS/Linux

3. Install dependencies

uv pip install -r requirements.txt

Environment Variables

Create a .env file with your Groq API key and model:

GROQ_API_KEY=your-groq-api-key
GROQ_MODEL=llama3-70b-8192

Other valid model values include:

  • mixtral-8x7b-32768
  • gemma-7b-it

Running the MCP Server

Start the MCP server (tool defined in weather.py):

python weather.py

This exposes one tool:

@mcp.tool()
async def get_weather(location: str) -> str:
    return "Today is sunny"

It will be available at http://localhost:8000/mcp.


Running the Groq Client

This runs a test LLM prompt using your Groq credentials:

python groq_client.py

It will:

  • Send a prompt to the Groq API
  • Optionally connect to the MCP tool if needed

Project Structure

demo_mcp_server/
ā”œā”€ā”€ .env
ā”œā”€ā”€ weather.py
ā”œā”€ā”€ groq_client.py
ā”œā”€ā”€ main.py
ā”œā”€ā”€ requirements.txt
ā”œā”€ā”€ pyproject.toml
ā”œā”€ā”€ uv.lock

Notes

  • You can add more tools by decorating them with @mcp.tool().