agentic-mcp-gateway

agentic-mcp-gateway

Provides an agentic RAG workflow with tool calling, enabling natural-language retrieval of policy docs, payment searches, and ticket creation over MCP stdio or HTTP.

Category
Visit Server

README

Model Context Protocol (MCP)

tools into an agentic loop for operations work: retrieve policy from a local knowledge base (RAG), search mock payments, and open tickets — the same shape as production copilots that sit in front of core banking / ops APIs, without any proprietary code.

This repository is original demo software by Md Tanvir Alam. It uses generic payments, KYC, and interbank-messaging concepts only.

Architecture

flowchart LR
  subgraph Client
    Recruiter["CLI / curl / MCP client"]
  end

  subgraph HTTP["Optional FastAPI"]
    Chat["POST /chat"]
    Health["GET /health"]
  end

  subgraph Agent["Agent loop"]
    LLM["LLM or FakeLLM stub"]
    ReAct["ReAct planner"]
  end

  subgraph MCP["MCP server"]
    T1["retrieve_docs"]
    T2["search_payments"]
    T3["create_ticket"]
  end

  subgraph Data
    KB["Markdown KB + hash embeddings"]
    SQLite["SQLite mock ledger / tickets"]
  end

  Recruiter --> Chat
  Recruiter --> MCP
  Chat --> ReAct
  ReAct --> LLM
  ReAct --> T1 & T2 & T3
  MCP --> T1 & T2 & T3
  T1 --> KB
  T2 --> SQLite
  T3 --> SQLite

The MCP server and the HTTP agent share one tool registry. That is the production pattern: expose the same typed capabilities over stdio/SSE for IDE agents and over HTTP for a product UI.

Quick start

Python 3.11+ (3.12/3.13 fine). No API key required.

python3 -m venv .venv
source .venv/bin/activate   # Windows: .venv\Scripts\activate
pip install -r requirements.txt

# tests — FakeLLM, hash embeddings, in-memory SQLite
pytest -q

# HTTP demo
cp .env.example .env
PYTHONPATH=src python -m uvicorn agentic_mcp_gateway.http_app:app --port 8080

Try a session:

curl -s localhost:8080/health
curl -s localhost:8080/chat -H 'content-type: application/json' \
  -d '{"message":"Find payment PMT-1002 and open a ticket if it is stuck"}'

MCP stdio (for Claude Desktop / Cursor-style clients):

PYTHONPATH=src python -m agentic_mcp_gateway.mcp_server

Docker:

docker compose up --build
# then the same curl against localhost:8080

How MCP tools map to production

Demo tool What a real platform would wrap Guardrails you would add
retrieve_docs Policy / product RAG over Confluence, runbooks, ISO 20022 notes ACL per tenant, citation required, stale-doc TTL
search_payments Read API over a payments bus or investigation store Field-level masking, audit log, query cost limits
create_ticket Case management / Jira / ServiceNow write path Idempotency keys, maker-checker, PII scrubbing

The agent is a small ReAct loop: think → pick a tool → observe → repeat, then answer. With LLM_PROVIDER=fake the planner is deterministic so CI never needs OpenAI. Set LLM_PROVIDER=llm and OPENAI_API_KEY to swap in a real chat model; the tool contracts stay identical.

Embeddings default to hashed character n-grams (numpy cosine). That is a documented demo fallback — swap HashingEmbedder for a sentence-transformer or vendor embedding API without changing the retriever interface.

Project layout

src/agentic_mcp_gateway/   package
  tools/                   retrieve / payments / tickets
  agent.py                 ReAct + FakeLLM
  mcp_server.py            MCP stdio server
  http_app.py              FastAPI /chat
docs/kb/                   sample ops knowledge
tests/                     tool registry, RAG, mocked agent turn

Author

Md Tanvir Alamgithub.com/tanvir-ux

MIT licensed. Not affiliated with any bank or core-banking vendor.

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