Multi-Agent Research Assistant MCP Server
FastMCP server offering weather and news lookup tools, demonstrating MCP integration with a LangGraph multi-agent research workflow.
README
Multi-Agent Research Assistant & MCP Server
This project implements the assignment in two small parts:
- A LangGraph multi-agent workflow with one Supervisor and two specialist workers.
- A FastMCP server with two tools and a client that calls those tools.
The language model is Ollama, so no OpenAI API key is required.
1. What The Project Demonstrates
The Supervisor receives a question and chooses the appropriate worker:
User question
|
v
Supervisor Agent
|------------------------------|
v v
Research Agent Analysis Agent
| |
v v
Knowledge-base tool Comparison tool
For a question that needs both workers, the Supervisor asks the Research Agent for evidence first, then gives that evidence to the Analysis Agent.
The MCP part is independent of the LangGraph part:
MCP Client ---> FastMCP Server
|------ get_weather(city)
|------ get_news(topic)
2. Prerequisites
- Windows PowerShell
- Python 3.10 or newer
- Ollama
- An Ollama model such as
llama3.2
The repository already contains the requested virtual environment at multivenv.
3. Installation
Open PowerShell in the project directory:
cd D:\LLMEngg_8-Multi-Agent-Research-Assistant-MCP-Server
.\multivenv\Scripts\Activate.ps1
python -m pip install -r requirements.txt
Copy-Item .env.example .env
If PowerShell does not allow activation, use the virtual environment directly for every command:
.\multivenv\Scripts\python.exe -m pip install -r requirements.txt
Do not use a different system Python. Otherwise imports such as langchain_core may be missing.
4. Configure Ollama
Start Ollama in a separate terminal. If Ollama is already running as a desktop application, skip ollama serve.
ollama serve
ollama pull llama3.2
The default configuration in .env is:
OLLAMA_MODEL=llama3.2
OLLAMA_BASE_URL=http://localhost:11434
You can use another model, but it must support chat and tool calling well enough for LangGraph. For example:
OLLAMA_MODEL=qwen2.5:7b
5. Run The Multi-Agent Assistant
Run a research-only question:
python main.py "What does MCP do?"
This should route to the Research Agent, which searches data/knowledge_base.txt.
Run an analysis question:
python main.py "Compare these two ideas: solar power uses sunlight; wind power uses moving air."
This should route to the Analysis Agent, which uses compare_texts.
Run a collaboration question:
python main.py "Research solar and wind power, then compare their main trade-offs."
This question needs both workers. The expected workflow is:
- The Supervisor calls
ask_research_agent. - The Research Agent calls
search_knowledge_base. - The Supervisor sends the evidence to
ask_analysis_agent. - The Analysis Agent calls
compare_texts. - The Supervisor returns one final answer.
The default question can also be run without an argument:
python main.py
6. Run The MCP Demonstration
The client calls both FastMCP tools:
python -m mcp_client.client
Expected output is similar to:
Weather: Cloudy, 15 C
News: Mock headline: New developments in artificial intelligence are being monitored by the research team.
The client uses FastMCP's in-process client transport so the demonstration is reliable and easy to run locally. It still uses the real MCP client/server protocol. The standalone server can be started for an MCP-compatible host with:
python mcp_server/server.py
That standalone server uses MCP stdio transport.
7. Run Tests
python -m pytest -q
The tests cover the deterministic tools without requiring Ollama or a model download. The LangGraph construction can also be checked without making a model request:
$env:OLLAMA_MODEL = "llama3.2"
python -c "from agents.supervisor import build_supervisor; build_supervisor(); print('Supervisor created')"
8. File Structure
agents/
model.py Shared ChatOllama configuration
research_agent.py Research worker created with create_react_agent
analysis_agent.py Analysis worker created with create_react_agent
supervisor.py Supervisor and wrapped worker tools
tools/
research_tool.py Local knowledge-base lookup tool
analysis_tool.py Structured two-text comparison tool
data/
knowledge_base.txt Local evidence used by the Research Agent
mcp_server/
server.py FastMCP server and its two tools
mcp_client/
client.py Client demonstration calling both MCP tools
main.py Command-line entry point for the Supervisor
tests/ Deterministic tool tests
requirements.txt Python dependencies
.env.example Ollama configuration template
9. Assignment Objective Checklist
| Assignment objective | Implementation |
|---|---|
| Build a Supervisor agent | agents/supervisor.py |
Build a Research Agent with create_react_agent |
agents/research_agent.py |
Build an Analysis Agent with create_react_agent |
agents/analysis_agent.py |
| Give Research Agent an information-retrieval tool | tools/research_tool.py and data/knowledge_base.txt |
| Give Analysis Agent a two-snippet comparison tool | tools/analysis_tool.py |
| Wrap workers as tools for the Supervisor | ask_research_agent and ask_analysis_agent |
| Add role-specific system prompts | Each agent module defines its own prompt |
| Build an MCP server with at least two tools | mcp_server/server.py |
| Demonstrate an MCP client calling the tools | mcp_client/client.py |
| Test research, analysis, and collaboration scenarios | Commands in Section 5 |
10. Troubleshooting
No module named langchain_core
The system Python is being used. Activate multivenv or use the direct interpreter path:
.\multivenv\Scripts\python.exe main.py "What does MCP do?"
connection refused from Ollama
Start Ollama and confirm the model exists:
ollama serve
ollama list
ollama pull llama3.2
The model does not call tools
Use a tool-capable chat model, keep the question explicit, and try the collaboration example from Section 5. Small or older models may answer directly without using a tool.
The knowledge base returns no answer
The Research Agent only searches the local file. Add more paragraphs to data/knowledge_base.txt and rerun the question.
11. Important Scope Note
This is a simple educational implementation. The knowledge base is a mock local data source, weather and news are mock MCP results, and the LLM routing is tested manually with Ollama. The deterministic tools are covered by automated tests.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。