MCP Research Agent is a Python-centric stack for answering questions over your own knowledge base while delegating actions to Model Context Protocol (MCP) tool servers. An LLM planner chooses when to search embeddings, pull fresh web snippets, read allowed paths, or run vetted tools—so the assistant stays grounded and auditable.


What it does

  • RAG over chunked documents with a vector store and semantic search.
  • Tool-calling agent (LangChain-compatible patterns) that invokes MCP tools instead of ad-hoc HTTP glue.
  • Multiple MCP backends: e.g. filesystem bounds, HTTP fetch, custom domain tools implemented with FastMCP.
  • Session-scoped memory so multi-turn research threads keep citations and intermediate hypotheses coherent.

Architecture (conceptual)

  1. User query enters the orchestrator (FastAPI or async worker).
  2. The model decides retrieve → vector DB / keyword hybrid or call MCP tool (fetch URL, read file under policy, run approved script).
  3. Tool outputs are compressed into the chat context; the model produces an answer with inline provenance (source ids, URLs, file paths where permitted).
Note

MCP gives you a stable contract between “what the model may do” and “how tools are implemented.” Swap a local MCP server for a remote one without rewriting prompt logic.


Stack (typical)

AreaChoices
RuntimePython, FastAPI (or ASGI worker)
Agent / LLMLangChain (or similar) tool-calling + OpenAI / AWS Bedrock / compatible endpoints
MCPFastMCP or community MCP servers; langchain-mcp-adapters to load tools into the agent
Vectorspgvector, managed vector DB, or embedded store for prototypes
Frontend (optional)Next.js or Streamlit for demos

Why MCP here

  • Composability: add a tool server without fork-and-patch of the agent core.
  • Security boundaries: run MCP in a separate process or container with filesystem and network policy.
  • Observability: log each tools/call with arguments and outcomes for research audits.

Extensions

  • Human-in-the-loop confirmations before destructive MCP actions.
  • Eval harness: replay queries with golden citations for regression tests after model or index updates.

Comments

One comment per visitor. Edit or delete your own comment anytime.

0/2000
Loading comments...
0
0
0
0