MCP RAG Agent Server

MCP RAG Agent Server

This MCP server enables intelligent API testing automation by combining RAG knowledge retrieval with tool execution capabilities. It allows QA engineers to perform natural language-driven API testing with contextual knowledge support.

Category
Visit Server

README

๐Ÿš€ MCP RAG Agent โ€“ AI-Powered API Testing Framework

Python Flask RAG API Testing Status


๐Ÿ“Œ Overview

The MCP RAG Agent is an AI-driven modular testing framework that combines:

  • ๐Ÿ”Ž RAG (Retrieval Augmented Generation) โ€“ Knowledge-based context retrieval
  • โš™๏ธ MCP Layer (Tool Execution Engine) โ€“ Executes tools dynamically
  • ๐Ÿงช API Testing Agent โ€“ Automates API validation like Postman

It enables natural language โ†’ API execution โ†’ validation โ†’ intelligent response generation.


๐Ÿง  System Architecture

graph TD
A[User Query] --> B[API Agent - NLP Parser]
B --> C[MCP Server - Tool Router]
C --> D[RAG Engine - Knowledge Retrieval]
C --> E[API Execution Tool]
D --> C
E --> F[External API / System]
F --> G[Response Validation Layer]
G --> H[Final AI Response]

๐Ÿงฉ Architecture Explanation

1๏ธโƒฃ API Agent Layer

  • Accepts natural language input
  • Converts request into structured API test case

2๏ธโƒฃ MCP Server Layer

  • Central orchestration layer
  • Routes requests to appropriate tools

3๏ธโƒฃ RAG Layer

  • Fetches contextual knowledge from documents
  • Enhances API validation logic

4๏ธโƒฃ Execution Layer

  • Executes API calls (GET/POST/PUT/DELETE)
  • Captures response payloads

5๏ธโƒฃ Validation Layer

  • Compares expected vs actual response
  • Returns structured test result

๐Ÿ” End-to-End Flow

User Input
   โ†“
API Agent (Intent Detection)
   โ†“
MCP Server (Tool Selection)
   โ†“
RAG (Context Injection)
   โ†“
API Execution Engine
   โ†“
Response Validation
   โ†“
Final Result Output

โš™๏ธ Installation Guide

1๏ธโƒฃ Clone Repository

git clone https://github.com/karthikeyanramu/MCP_RAG_AGENT.git
cd MCP_RAG_AGENT

2๏ธโƒฃ Create Virtual Environment

python -m venv venv

Activate:

# Windows
venv\Scripts\activate

# Mac/Linux
source venv/bin/activate

3๏ธโƒฃ Install Dependencies

pip install -r requirements.txt

4๏ธโƒฃ Start MCP Server

python server/mcp_server.py

Expected:

MCP Server running on http://localhost:5000

5๏ธโƒฃ Run API Agent

python -m qa_agent.api_agent_runner

๐Ÿงช Postman Integration (Manual Testing Support)

Even though this system is AI-driven, it supports Postman-style API testing.

๐Ÿ“Œ Example Request

๐Ÿ”น Endpoint

POST http://localhost:5000/execute

๐Ÿ”น Headers

{
  "Content-Type": "application/json",
  "Authorization": "Bearer <token-if-needed>"
}

๐Ÿ”น Sample Payload

{
  "tool": "api_executor",
  "method": "POST",
  "url": "https://api.example.com/login",
  "headers": {
    "Content-Type": "application/json"
  },
  "body": {
    "username": "test_user",
    "password": "Test@123"
  }
}

๐Ÿ“Œ Sample Response

{
  "status": 200,
  "message": "Login Successful",
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "validation": "PASSED"
}

๐Ÿ”„ CI/CD Pipeline (QA Maturity Model)

This system can be integrated into CI/CD pipelines for automated API validation.

๐Ÿš€ Pipeline Flow

graph LR
A[Code Push] --> B[CI Trigger - GitHub Actions]
B --> C[Install Dependencies]
C --> D[Run API Tests via MCP Agent]
D --> E[RAG Validation Layer]
E --> F[Test Report Generation]
F --> G[Deploy / Fail Pipeline]

๐Ÿงช CI/CD Benefits

โœ” Automated API regression testing โœ” AI-driven validation (reduces manual QA effort) โœ” Early defect detection โœ” Domain knowledge injection via RAG โœ” Scalable test execution


๐Ÿ“Œ Sample GitHub Actions Workflow

name: MCP API Tests

on: [push]

jobs:
  test:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v3

      - name: Setup Python
        uses: actions/setup-python@v4
        with:
          python-version: 3.10

      - name: Install dependencies
        run: pip install -r requirements.txt

      - name: Run MCP API Agent
        run: python -m qa_agent.api_agent_runner

๐Ÿงฐ Available Tools

Tool Purpose
knowledge_search RAG-based document retrieval
calculator Arithmetic operations
api_executor Executes HTTP requests

๐Ÿ“Š Real-World Use Cases

  • Banking API automation (AML / KYC)
  • Collateral management system testing
  • Microservices regression testing
  • AI-driven QA automation frameworks

โš ๏ธ Troubleshooting

โŒ Port conflict

netstat -ano | findstr :5000
taskkill /PID <pid> /F

โŒ Module error

pip install -r requirements.txt

๐Ÿš€ Future Enhancements

  • OpenAI / LLM integration
  • UI dashboard for test execution
  • Kubernetes deployment
  • Advanced embedding-based RAG
  • Postman collection auto-import

๐Ÿ‘จโ€๐Ÿ’ป Summary

This project demonstrates:

โœ” AI-powered API testing โœ” MCP-based tool orchestration โœ” RAG-enhanced validation โœ” Enterprise-grade QA automation architecture

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured