Model Context Protocol (MCP)

by drkhan107

135 downloads Not rated yet MIT
GitHub

About

A working pattern for SSE-based MCP clients and servers using Gemini LLM

Details

License
MIT

Explore

- Integrates with Google’s Gemini.
- Uses SSE (Server-Sent Events) transport.
- Includes a FastAPI server for a GUI backend.
- Provides a Streamlit web interface.
- Simple setup with a .env file for API key.
- Fully functional demo ready to run locally.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Model Context Protocol (MCP)
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Create a .env file in the root directory and add your Google API key:

GOOGLE_API_KEY="your_api_key_here"

Install all required packages from requirements.txt:

pip install -r requirements.txt

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "model context protocol (mcp)": {
            "mcp_gemini": {
                "command": "python",
                "args": [
                    "sse_server.py"
                ]
            }
        }
    }
}

McpServers

{
    "mcp_gemini": {
        "command": "python",
        "args": [
            "sse_server.py"
        ]
    }
}

A working demo of MCP integrated with Google's Gemini.

---

πŸš€ Getting Started

1. Clone the repository

git clone https://github.com/drkhan107/mcp_gemini.git
cd your-repo-name

2. Set up environment variables

Create a .env file in the root directory and add your Google API key:

GOOGLE_API_KEY="your_api_key_here"

3. πŸ“¦ Install Dependencies

Install all required packages from requirements.txt:
pip install -r requirements.txt

4. πŸ–₯️ Run the MCP Server

Start the MCP server:
python sse_server.py
βœ… This will start the MCP server at the configured port (default is http://localhost:8080/sse).

5. 🧠 Start the MCP Client (Optional)

Once the server is running, start the SSE client with the server URL:

python ssc_client.py http://localhost:8080/sse

6. 🧠 Start the FastAPI server (To Use GUI)

Run the following command (To change the port etc, edit the fastapp.py file)

python fastapp.py

7. Launch Streamlit app

- Make sure MCP server is running (http://localhost:8080/sse) - Make sure FastAPI is running.

Run the following command


streamlit run app.py 

This will start the streamlit app on port 8501

8. Browser

Once you open the browser (localhost:8501), click on connect to MCP server.

alt text

βœ… Done!
You now have a working demo of the Model Context Protocol with Gemini.

No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.