AI Research Agent

AI Research Agent

Enables autonomous web research, file management, and dynamic UI dashboard generation through Gemini LLM and FastMCP.

Category
Visit Server

README

šŸ¤– Autonomous AI Research Agent (MCP)

This project implements an autonomous AI Research Agent using the Model Context Protocol (MCP). The agent is built with Python, leverages Google's Gemini LLM, and uses FastMCP to dynamically expose robust tools for web searching, local file management, and UI rendering via Prefab UI.


✨ Features

  • Autonomous Tool Execution: The Gemini LLM automatically discovers and iteratively calls tools until its objective is met.
  • MCP Server Architecture: Provides isolated context and tools out-of-the-box over the stdio transport.
  • Web Research: Integrates duckduckgo-search for real-time web scraping and topic summarization.
  • File Management: A fully functional local CRUD system that creates markdown reports.
  • Dynamic UI Generation: Automatically spins up a Prefab UI dashboard in the background to visualize the research results.
  • Rate Limit Resilience: The client features an intelligent backoff system that intercepts 429 quota limits and seamlessly resumes operations without crashing.

šŸ—ļø Architecture

The project consists of two core layers seamlessly interacting over the Model Context Protocol:

graph TD

    Client["client.py<br/>Agent / LLM"]
    Server["server.py<br/>FastMCP Server"]

    T1["research_topic()"]
    T2["manage_report()"]
    T3["render_dashboard()"]

    Web["Internet (DuckDuckGo / API)"]
    File["reports/ Directory"]
    UI["Prefab Dashboard"]

    Client <-->|stdio / JSON-RPC| Server

    Server --> T1
    Server --> T2
    Server --> T3

    T1 --> Web
    T2 --> File
    T3 --> UI

Research Tool (research_topic) Report Tool (manage_report) UI Tool (render_dashboard)

  1. client.py: Initializes the Gemini LLM client, connects to the server.py using stdio_client, and translates MCP tool schemas into Gemini Function Declarations.
  2. server.py: The FastMCP Server instance. Provides the LLM with the context and the capabilities it needs to interact with the environment.
  3. dashboard.py: Auto-generated by the server during execution. Contains the Prefab Python UI component tree.

šŸš€ Getting Started

1. Prerequisites

  • Python 3.10+
  • uv (The blazing fast Python package manager)
  • A free Gemini API Key from Google AI Studio.

2. Installation

Install dependencies using uv:

uv init
uv add mcp duckduckgo-search prefab-ui google-genai python-dotenv

3. Environment Variables

Copy the .env.example file to .env and paste your API key:

GEMINI_API_KEY=your_actual_api_key_here

Security Note: The .env file is excluded in .gitignore to prevent leaking your API keys.

4. Running the Agent

Simply run the client script. The server will start automatically in the background.

.venv\Scripts\python.exe client.py

Watch the console as the agent thinks, searches the web, writes reports, and ultimately starts the dashboard!

5. Viewing the Dashboard

Once the agent completes its run, it will host your research report at: šŸ‘‰ http://127.0.0.1:5175

(To manually run the dashboard at any time, execute: .venv\Scripts\prefab.exe serve dashboard.py)


šŸ”’ Security Practices

  • API Keys: Handled securely via python-dotenv.
  • Git Ignore: .env, reports/, and dynamic .py generations are strictly ignored.
  • Server Communication: server.py communicates exclusively via stdio, meaning it does not expose any network ports to the public by default.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured