AI Research Agent
The server provides an autonomous AI research workflow with three core tools:
Research any AI topic (
research_topic): Searches the web via DuckDuckGo, extracts information, and generates a summary.Manage research reports (
manage_report): Performs CRUD operations (create, read, update, delete) on markdown files in a localreports/directory.Render a visual dashboard (
render_dashboard): Generates and serves an interactive Prefab UI dashboard athttp://127.0.0.1:5175, displaying title, summary, key points, references, and a link to the report file in a professional tabbed layout.
Provides web search and topic summarization via DuckDuckGo, allowing the agent to perform real-time internet research.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AI Research Agent Research quantum computing advances and generate dashboard"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
🤖 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
stdiotransport.Web Research: Integrates
duckduckgo-searchfor 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, featuring a professional tabbed layout and dynamic metrics based on extracted data.
Rate Limit Resilience: The client features an intelligent backoff system that intercepts
429quota limits and seamlessly resumes operations without crashing.
Related MCP server: Gemini Research MCP Server
🏗️ 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 --> UIclient.py: Initializes the Gemini LLM client, connects to theserver.pyusingstdio_client, and translates MCP tool schemas into Gemini Function Declarations.server.py: The FastMCP Server instance. Provides the LLM with the context and the capabilities it needs to interact with the environment.dashboard.py: Auto-generated by the server during execution. Contains the Prefab Python UI component tree (tabbed layout with dynamic metrics).
🚀 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-dotenv3. Environment Variables
Copy the .env.example file to .env and paste your API key:
GEMINI_API_KEY=your_actual_api_key_hereSecurity Note: The
.envfile is excluded in.gitignoreto 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.pyWatch 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 (e.g. for a demo), run:
$env:PYTHONUTF8="1"; .venv\Scripts\prefab.exe serve dashboard.pyWindows Note: The
PYTHONUTF8=1environment variable is required to prevent a Unicode encoding error on Windows terminals when the Prefab CLI starts.
🔒 Security Practices
API Keys: Handled securely via
python-dotenv.Git Ignore:
.env,reports/, and dynamic.pygenerations are strictly ignored.Server Communication:
server.pycommunicates exclusively viastdio, meaning it does not expose any network ports to the public by default.
Available Tools
3 toolsmanage_reportC
Perform CRUD operations on reports.
Args:
action: One of 'create', 'read', 'update', 'delete'.
filename: The name of the file in the reports/ directory.
content: The text content for create/update.
Inputs: action (required), filename (required), content. Returns: result
render_dashboardA
Use Prefab to display the report dashboard in the background and return the URL.
Args:
title: The research title.
summary: The summary of the research.
key_points: List of key points.
references: List of references URLs.
file_name: The saved file name.
Inputs: title (required), summary (required), file_name (required), key_points (required), +1 more. Returns: result
research_topicB
Search the internet for any AI topic.
Args:
topic: The AI topic to research
Inputs: topic (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool serves a distinctly different purpose: researching a topic, managing report files with CRUD operations, and rendering a dashboard. There is no overlap or ambiguity between them.
All tool names follow a consistent verb_noun pattern in snake_case: research_topic, manage_report, render_dashboard. No mixing of conventions.
Three tools is slightly low but still reasonable for a focused AI research agent covering the essential tasks of researching, managing reports, and displaying a dashboard. It feels well-scoped.
The basic workflow is covered, but there is a notable gap: no tool to list existing report filenames, which is needed for the read/update/delete actions without prior knowledge.
Related MCP Connectors
Self-hosted AI workspace: semantic RAG document search, long-term memory, and AI chat via MCP.
OCR, transcription, file extraction, and image generation for AI agents via MCP.
MCP tool marketplace for AI agents: web, OSINT, security and research tools through one key.
AI Agent Utility Layer for agent safety, web monitoring, crypto research and tool discovery.
Related MCP Servers
- AlicenseAqualityDmaintenanceA task-based AI orchestrator that bridges AI models (Gemini, Claude, OpenAI) with local environments, operating as an interactive CLI and an MCP server for structured autonomous development.24 npmMIT
- AlicenseAqualityBmaintenanceMCP server for AI-powered research using Gemini. Provides fast grounded web search, deep autonomous research, URL extraction, and session management.9138 PyPI10MIT
- AlicenseNot gradedqualityDmaintenanceIntegrates Gemini API research capabilities (Deep Research, Quick Search, URL Analysis) into a unified MCP server, enabling comprehensive research, web search, and URL analysis through natural language.MIT
- FlicenseNot gradedqualityDmaintenanceA modular research assistant framework that enables web, Reddit, YouTube, map, and codebase exploration via MCP and FastAPI, with support for multiple LLMs and embedders.-