Skip to main content
Glama
Autonomous AI Research Analyst MCP Server

Autonomous AI Research Analyst MCP Server

by Chaithraanc

🧠 Autonomous AI Research Analyst (MCP + Vector DB)

An end-to-end, autonomous AI research assistant built using the Model Context Protocol (MCP), Dockerized Qdrant Vector Database, and a ReAct (Reasoning + Acting) Agent loop.

Instead of relying on static knowledge, this agent dynamically searches live academic repositories (arXiv), parses complex multi-column PDFs into structured Markdown, chunks them hierarchically by document sections, generates local embeddings, and performs semantic retrieval to synthesize cited research reports.


🏗️ System Architecture

This project decouples the Agentic Reasoning Layer (Client) from the Data Ingestion & Retrieval Microservice (Server) using the industry-standard Model Context Protocol (MCP) over standard input/output (stdio).

System Architecture Diagram


Related MCP server: ResearchMCP

🛠️ Key Engineering Decisions & Features

  • Decoupled Microservice Architecture (FastMCP): Tools are exposed via @mcp.tool() decorators, making the research backend completely modular and pluggable into custom Python agents, Claude Desktop, or Cursor.

  • Layout-Aware Hierarchical Chunking: Standard character splitters destroy tabular data and sever context. This pipeline uses pymupdf4llm to convert PDFs into structured Markdown—preserving complex statistical tables—followed by MarkdownHeaderTextSplitter to anchor every chunk with its parent section hierarchy (Section > Subsection).

  • Local Privacy-First Embeddings: Uses HuggingFace's all-MiniLM-L6-v2 (SentenceTransformers) to generate 384-dimensional dense vector embeddings locally without external embedding API costs.

  • Production Vector Storage: Connects asynchronously (AsyncQdrantClient) to a containerized Qdrant instance running on Docker, storing text chunks alongside rich metadata payloads (source URL and section headers) to guarantee accurate citations and prevent hallucinations.


🚀 Tech Stack

  • Agent Orchestration: Python, Groq Cloud API (openai/gpt-oss-120b), Custom ReAct Loop

  • Protocol & Microservice: fastmcp, mcp (Model Context Protocol SDK)

  • Vector Database: Qdrant (Running via Docker)

  • Document Parsing & Chunking: pymupdf4llm, langchain-text-splitters

  • Embeddings: sentence-transformers (all-MiniLM-L6-v2)

  • Package Management: uv


⚙️ Local Setup & Installation

1. Prerequisites

2. Spin Up Qdrant in Docker

Run a local Qdrant container exposed on port 6333:

docker run -p 6333:6333 -p 6334:6334 -v qdrant_storage:/qdrant/storage qdrant/qdrant

3. Clone & Install Dependencies

git clone https://github.com
cd autonomous-research-analyst-mcp

# Sync virtual environment and install packages
uv sync

4. Set Environment Variables

Set your Groq API key in your terminal session:

# Windows PowerShell
\$env:MY_API_KEY_AI="gsk_your_api_key_here"

5. Run the Autonomous Agent

uv run python agent.py

📊 Sample Execution & Results

User Query:

"Find a paper on climate change parameters in India, save it, and tell me the predicted carbon dioxide emission values for 2035."

Agent Execution Trace:

  1. [Cycle 1] Agent invokes search_arxiv(query="climate change parameters India").

  2. [Cycle 2] Agent selects "Analysis of various climate change parameters in India using machine learning" (arXiv:2201.10123) and executes ingest_and_vectorize().

  3. [Cycle 3] Server parses the PDF into Markdown, preserving Table II (Model Accuracy) and Table III (Predictions), and upserts the vectors into Qdrant.

  4. [Cycle 4] Agent invokes query_vector_db(query="2035 carbon dioxide emission predicted values").

  5. [Cycle 5] Agent synthesizes the retrieved tabular metrics into the final report:

Final Synthesized Output: Based on the paper "Analysis of various climate change parameters in India using machine learning" (https://arxiv.org), the projected 2035 values derived from Exponential Regression models are:

  • Total Carbon Dioxide ($CO_2$) Emissions (Parameter 7): 5,801,529.111 kilotons (Model $R^2$ accuracy: 0.997)

  • Total Greenhouse Gas Emissions (Parameter 11): 5,446,579.740 kilotons of $CO_2$ equivalent (Model $R^2$ accuracy: 0.988)


🔮 Future Improvements

  • Hybrid Search: Combine Qdrant dense vector search with sparse keyword search (BM25) to improve retrieval on exact acronyms and chemical formulas.

  • Multimodal Vision RAG: Integrate a vision-language model to generate text descriptions of embedded matplotlib/seaborn charts and graphs.

Available Tools

3 tools
ingest_and_vectorizeIngest And VectorizeA

Downloads a PDF, extracts its layout structure as Markdown (preserving tables/headers), splits it hierarchically by document sections, and stores them in Qdrant.

Inputs: pdf_url (required). Returns: result

query_vector_dbQuery Vector DbB

Queries the running Qdrant Docker container using semantic similarity search. Returns the top matching text chunks found across all ingested documents.

Inputs: query (required), n_results. Returns: result

search_arxivSearch ArxivB

Search arXiv for scientific papers by keyword. Returns paper titles, summaries, and downloadable direct PDF URLs.

Inputs: query (required), max_results. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool occupies a distinct stage of the research pipeline: search external sources, ingest/vectorize a document, and query the vector store. There is no overlap in purpose or trigger conditions, so an agent can select the correct tool unambiguously.

    Naming Consistency5/5

    All names use snake_case with clear verb_noun or verb_object patterns (search_arxiv, ingest_and_vectorize, query_vector_db). The single compound name still follows the same lowercase underscore convention.

    Tool Count4/5

    Three tools form a tightly scoped, complete pipeline for search-ingest-query without redundancy. The surface is slightly thin compared to a typical 5-15 tool server, but each tool clearly earns its place.

    Completeness4/5

    The core research workflow (search arXiv, ingest PDFs, semantic query) is fully covered with no dead ends. Minor gaps remain around managing ingested content, such as listing or deleting documents and inspecting collection state.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables LLM agents to search arXiv, download papers, parse PDFs into structured sections, and extract key findings using client-side LLMs. Features persistent caching and layout-aware PDF extraction.
      6
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables LLMs to search arXiv, extract and analyze paper content, and build a personal semantically-searchable research library with saved papers and notes.
      -
    • A
      license
      A
      quality
      C
      maintenance
      Enables an AI assistant to search scientific literature across OpenAlex and Semantic Scholar, download supported Elsevier and Springer Nature full texts, and build a local searchable index so questions can be answered with citations to original paper passages. It runs locally over stdio with CPU-based embeddings and needs no Qdrant account, Docker, GPU, or LLM API key of its own.
      11
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables local literature workflows by searching arXiv, retrieving paper metadata, downloading and parsing PDFs, and retrieving page-cited body evidence for Q&A. It also exposes usage resources and templates for searching, analyzing, and summarizing papers via stdio MCP.
      4
      MIT