custom-mcp

HrushiYadav/custom-mcp

3.1

If you are the rightful owner of custom-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Universal Data MCP Server is a lightweight server built in TypeScript that connects AI assistants to real-world databases, files, and APIs using the Model Context Protocol.

Tools
6
Resources
0
Prompts
0

Universal Data MCP Server 🧠

Connect your LLM to real-world databases, files, and APIs using the Model Context Protocol.

This project provides a lightweight MCP (Model Context Protocol) server built in TypeScript that enables AI assistants (like Claude or Cursor) to query structured databases, fetch external APIs, and inspect local files β€” all via a clean MCP-compatible interface.



Key Features πŸš€

  • πŸ“¦ Multi-Database Querying: Supports MongoDB, PostgreSQL, MySQL, and SQLite.
  • πŸ“ File Content Access: Read local files using getFileContent.
  • 🌐 JSON API Integration: Fetch and process external APIs with fetchAPI.
  • 🧠 LLM-Ready: Use natural language with AI tools like Claude or Cursor.
  • πŸ› οΈ Zod-Schema Validation: Ensures reliable input/output via types.
Available Tools
  • queryMongo: Query MongoDB collections
  • queryPostgres: Run SQL queries on PostgreSQL
  • queryMySQL: Run SQL queries on MySQL
  • querySQLite: Query SQLite DBs from file
  • getFileContent: Read contents of a file
  • fetchAPI: Send GET requests to JSON APIs

How It Works πŸ€”

The system connects via stdin/stdout to a local MCP-compatible client:

[LLM Client] <-> [Universal MCP Server] <-> [Data Sources]

Installation βš™οΈ

Note: Requires Node.js 18+ and optionally access to databases or files you want to work with.

Prerequisites

Required Software
  • Node.js (v18+): Download
  • npm or yarn
  • MongoDB / PostgreSQL / MySQL / SQLite installed locally or accessible remotely
  • An MCP-compatible LLM Client:

Step 1: Clone and Install

git clone https://github.com/HrushiYadav/custom-mcp.git
cd custom-mcp
npm install

Step 2: Start the MCP Server

npm start

This will launch the MCP server and expose all tools via StdioServerTransport.


Configure Your MCP Client 🧠

Edit your LLM client’s configuration file to include:

{
  "mcpServers": {
    "UniversalMCP": {
      "command": "npm",
      "args": ["start"],
      "workingDirectory": "/absolute/path/to/custom-mcp"
    }
  }
}

Supported clients like Claude or Cursor will automatically detect and start this server.


Usage ▢️

Start your LLM client and try queries like:

Run `SELECT name FROM users WHERE age > 30` on PostgreSQL
Read the content of `package.json`
Fetch data from https://api.coindesk.com/v1/bpi/currentprice.json

Project Structure 🧱

src/
β”œβ”€β”€ index.ts         # Main MCP server
β”œβ”€β”€ tools.ts         # Tool registry
└── utils/           # Tool handlers
    β”œβ”€β”€ api.ts
    β”œβ”€β”€ files.ts
    β”œβ”€β”€ mongo.ts
    β”œβ”€β”€ mysql.ts
    β”œβ”€β”€ postgres.ts
    └── sqlite.ts

Contributing 🀝

We welcome all contributions to improve and extend the Universal Data MCP Server.

  1. Fork this repository.
  2. Create a branch (feature/your-idea or bugfix/your-fix).
  3. Make your changes and test them.
  4. Commit with a clear message (feat: Add Postgres schema tool).
  5. Open a pull request.

Troubleshooting ❓

Common Issues
  • Cannot start server?

    • Ensure Node.js 18+ is installed
    • Run npm install before npm start
  • Client not connecting?

    • Verify JSON path in your MCP config matches actual working directory
  • Database not responding?

    • Check DB credentials and network access
    • Test connection with your DB tool directly

Contact πŸ‘‹


Acknowledgments πŸ™