Skip to content

scripbox/MCP_Sever

Repository files navigation

MCP Server for Catalogue API

This project implements a Model Context Protocol (MCP) server that provides AI assistants with intelligent, secure access to a PostgreSQL database containing comprehensive mutual fund data.


🔧 Features

  • Secure PostgreSQL connection via asyncpg
  • Tool-based architecture using FastAPI endpoints
  • OpenAI-powered natural language summaries
  • Structured JSON responses
  • Pluggable LLM backend (OpenAI or Ollama)
  • Read-only access for query safety

🛠 Core Tools (as per PRD)

Tool Name Endpoint Purpose
postgres_query /postgres_query General SELECT execution
describe_schema /describe_schema Schema introspection
search_funds /search_funds Fund discovery via smart filters
analyze_performance /analyze_performance Compare fund performance
correlate_performance /correlate_performance Fund return correlation matrix
sector_analysis /sector_analysis AUM/category-level aggregation
nav_trend_analysis /nav_trend_analysis NAV time-series insight
risk_return_scatter /risk_return_scatter Risk-return mapping data

🔐 Security (PRD Compliant)

  • Read-only DB user
  • Parameterized queries
  • Query complexity limits
  • Secure .env credential loading
  • No raw query logging

⚙️ Environment Setup

python3.12 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
uvicorn main:app --reload

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published