rahulmeena0912/Mcp_server
If you are the rightful owner of Mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server for database schema management and querying, built with Node.js and TypeScript.
mcp-server
A Model Context Protocol (MCP) server for database schema management and querying, built with Node.js and TypeScript.
Project Structure
fintra-mcp-server/
│
├── src/
│ ├── controllers/
│ │ └── tools.ts # MCP tools implementation
│ ├── data/
│ │ ├── tableDescriptions.json # Table metadata and descriptions
│ │ └── columnDescriptions.json # Column-level descriptions
│ ├── utils/
│ │ └── db.ts # Database connection pool
│ ├── index.ts # Application entry point
│ └── server.ts # MCP server configuration
│
├── node_modules/ # Dependencies
├── dist/ # Compiled JS output (ignored by git)
│
├── .env # Environment variables
├── .gitignore
├── package.json
├── tsconfig.json
├── README.md
Features
- Database Schema Discovery: Automatically reads and exposes PostgreSQL table schemas
- Intelligent Querying: Provides table and column descriptions for better LLM understanding
- MCP Protocol: Implements Model Context Protocol for seamless AI integration
- Type Safety: Full TypeScript implementation with Zod validation
Available Tools
- tableSchema - Returns complete database schema with tables and columns
- tableSchemaDescription - Provides detailed table descriptions and purposes
- tableColumnsDescription - Returns column-level descriptions for specific tables
- query - Executes SQL queries on the PostgreSQL database
Getting Started
Prerequisites
- Node.js (v18 or higher)
- PostgreSQL database
- npm or yarn package manager
Installation
-
Clone the repository:
git clone <repository-url> cd fintra-mcp-server -
Install dependencies:
npm install -
Create a
.envfile with your database configuration:DATABASE_URL=postgresql://username:password@localhost:5432/database_name PORT=3000 -
Set up your table and column descriptions in the data files:
- Edit
src/data/tableDescriptions.jsonfor table metadata - Edit
src/data/columnDescriptions.jsonfor column descriptions
- Edit
Development
Run the development server:
npm run dev
Production
Build and run the production server:
npm run build
npm start
Configuration
Database Setup
Ensure your PostgreSQL database is accessible and the connection string in .env is correct. The server will automatically discover tables in the public schema.
Adding Table/Column Descriptions
Update the JSON files in src/data/ to provide better context for AI queries:
tableDescriptions.json: Add table-level metadatacolumnDescriptions.json: Add column-level descriptions
API Usage
This server implements the Model Context Protocol (MCP) and can be integrated with MCP-compatible clients for database querying and schema exploration.