davidan90/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 henry@mcphub.com.
This is a proof of concept for a Model Context Protocol (MCP) server using NestJS, Prisma, and SQLite, integrated with AI connectors for OpenAI and Gemini LLMs.
MCP Server POC
Proof of concept of an MCP (Model Context Protocol) server built with NestJS, Prisma, and SQLite. It allows retrieving and modifying the context of the User
model via commands.
Includes an AI connector to OpenAI and Gemini LLMs to trigger commands programmatically.
๐ Technologies Used
๐ฆ Installation
npm install
โ๏ธ Configuration
1. Create .env
file
DATABASE_URL="file:./dev.db"
OPENAI_API_KEY=sk-...
GEMINI_API_KEY=AIza...
2. Generate the database
npx prisma migrate dev --name init
๐งช Sample Seed (optional)
npx ts-node prisma/seed.ts
๐ Useful Scripts
npm run start:dev # Run the server in development mode
npm run prisma:generate # Generate Prisma client
npm run prisma:migrate # Run database migrations
๐ง MCP Endpoints
Get context
GET /mcp/context
Update context
PATCH /mcp/context
{
"userId": 1,
"isActive": false
}
Execute command
POST /mcp/commands
{
"command": "deactivateUser",
"args": { "userId": 1 }
}
๐ค LLM Connectors
OpenAI (GPT-4 + functions)
npx ts-node connectors/openai-mcp.ts
Sends a user message to GPT-4 and calls MCP commands automatically if needed.
Gemini (Google AI)
npx ts-node connectors/gemini-mcp.ts
Uses Gemini 1.5 Flash to generate tool calls and execute MCP actions.
๐ Project Structure
mcp-server/
โโโ src/ # NestJS backend
โโโ prisma/ # Prisma schema & seeds
โโโ connectors/ # AI-based external clients
โโโ .env # API keys and DB
โโโ package.json
๐ฌ Contact
This project is a proof of concept and ready to be expanded with more tools, validation layers, and LLM functions.