mcpField
M
MCP Agent

MCP Agent

Local
github.com/NhahanAI & Agents5Updated 75w ago

About MCP Agent

MCP Agent is a LangGraph agent using ReWOO to reduce prompt overhead by planning evidence before tool execution. It is intended for LLMs that need to use MCP servers through filtered, validated tool plans.

Key features

  1. 01Filter tools by task relevance
  2. 02Generate and parse YAML execution plans
  3. 03Validate and correct plans
  4. 04Fill tool inputs from prior evidence
  5. 05Synthesize answers from collected evidence

Use cases

  1. 01Help smaller LLMs use MCP servers
  2. 02Run multi-step tasks that require tools

MCP support

It executes planned tool calls through MCP servers and processes their results as evidence.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

No install method listed yet

We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.

Repository

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Agent

ai

Diagram

diagram

Overview

This project implements a LangGraph agent based on the ReWOO (Reasoning WithOut Observation) pattern. Similar to the ReAct (Reasoning and Acting) pattern, it reasons and acts, but aims to reduce the amount and complexity of prompts, especially when using Small LLMs (SLMs), by pre-defining the necessary evidence during the planning phase instead of explicitly separating an Observation step.

It also includes several optimization logics, such as tool filtering, plan validation and correction, and evidence management, for efficient interaction with the MCP (Model Context Protocol) server.

Architecture: LangGraph Nodes

This agent executes the ReWOO workflow using the following LangGraph nodes:

  1. tool_filter: At the start of agent execution, filters the most relevant tools for the current task based on the user query and descriptions of all available tools.
  2. planner: Based on the filtered tool information, generates a step-by-step execution plan (in YAML format) to resolve the user query. Also handles plan correction logic upon errors.
  3. plan_parser: Parses the raw YAML plan generated by the planner and validates its structural integrity. May include logic for automatic correction using LLM upon parsing/validation errors.
  4. plan_validator: Finally validates whether the tool names included in the parsed plan exist in the valid tool list selected during the tool_filter step.
  5. tool_selector: Selects the tool for the current step to be executed from the validated plan.
  6. tool_input_preparer: Prepares the input for the selected tool. In this process, it replaces placeholders (#E1, etc.) with actual values by referencing the evidence collected in previous steps.
  7. tool_executor: Executes the actual tool (via the MCP server) with the prepared input and retrieves the result.
  8. evidence_processor: Processes the tool execution result and stores it in the evidence dictionary. (Currently a placeholder, further logic can be implemented).
  9. generate_final_answer: When all plan steps are completed or the plan finishes without tool calls, synthesizes the final answer by compiling all collected evidence.

Project Structure

.
├── agent/             # ReWOO agent core logic
│   ├── graph.py       # LangGraph graph definition
│   ├── state.py       # Agent state definition (ReWOOState)
│   ├── nodes/         # Graph node implementations (planner, parser, executor, etc.)
│   ├── prompts/       # LLM prompt definitions
│   └── utils.py       # Utility functions
├── core/              # Core utilities
│   └── llm_loader.py  # LLM instance loading and management
├── tests/             # Test code (unit/integration)
├── images/            # Images for README
├── mcp.json           # MCP server configuration file
├── main.py            # Agent execution script
├── .env.example       # Environment variable setup example
└── README.md          # Project documentation

Usage

python main.py

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.