Skip to content

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 NameEndpointPurpose
postgres_query/postgres_queryGeneral SELECT execution
describe_schema/describe_schemaSchema introspection
search_funds/search_fundsFund discovery via smart filters
analyze_performance/analyze_performanceCompare fund performance
correlate_performance/correlate_performanceFund return correlation matrix
sector_analysis/sector_analysisAUM/category-level aggregation
nav_trend_analysis/nav_trend_analysisNAV time-series insight
risk_return_scatter/risk_return_scatterRisk-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

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages