Skip to content

ksumesh431/custom_gemini_MCP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Basic Gemini MCP client

  1. AWS Lambda Code (API Gateway Integration): This is a custom MCP that provides three main tools:
a. get_distribution_info - Fetches CloudFront distribution details
b. fetch_logs - Retrieves CloudFront logs from CloudWatch
c. analyze_logs - Analyzes logs for issues and suggests remediations

The Lambda function has two main endpoints:

  • /list_tools (GET): Returns available tools and their schemas
  • /call_tool (POST): Executes the requested tool with given parameters
  1. Client Code:
graph TD
    A[User Input] --> B[Fetch Tool Schemas]
    B --> C[Initialize Gemini AI]
    C --> D[Interactive Loop]
    D --> E[Call Tools via API]
    E --> F[Process AI Response]
    F --> G[Show Results/Get Follow-up]
    G --> D
Loading

Key Components:

  1. API Integration:
async def call_tool(session, tool_name, parameters):
    # Makes HTTP POST requests to Lambda API
  1. Gemini Integration:
client = genai.Client(api_key=GEMINI_API_KEY)
  1. Conversation Flow:
  • Gets CloudFront distribution ID from user
  • Uses Gemini AI to determine which tools to call
  • Makes API calls to Lambda function
  • Processes and displays results
  • Handles follow-up questions

Gemini MCP Demo

About

Testing a basic MCP code following google's MCP documentation

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages