OpsMCP
Provides tools for retrieving, creating, updating, and analyzing user records in a PostgreSQL database, enabling natural-language company operations.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@OpsMCPShow me all users with role manager"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ OpsMCP โ AI-Powered Company Operations Agent
An AI-powered company operations agent that uses the Model Context Protocol (MCP) to securely connect natural-language AI interactions with a PostgreSQL database.
๐ Overview
OpsMCP allows users to interact with company data using natural language instead of manually writing SQL queries or navigating complex admin panels.
The system connects an AI agent to a PostgreSQL database through MCP tools, allowing the agent to retrieve information, analyze users, and perform authorized database operations.
For sensitive write operations, the system requires explicit user confirmation before modifying the database.
Related MCP server: Postgres MCP Server
๐ฏ Problem
Traditional internal company systems often require users to:
Navigate multiple administrative dashboards
Understand database structures
Write SQL queries
Perform repetitive operations manually
Track database modifications separately
This creates unnecessary complexity for routine company operations.
๐ก Solution
OpsMCP provides a natural-language interface for company operations.
Instead of writing:
SELECT id, name, email, role
FROM users
ORDER BY id;A user can simply ask:
"Show me all users."
The AI determines which MCP tool is required, executes it, receives the result, and converts it into a human-friendly response.
๐ง How It Works
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Web Dashboard โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ AI Agent โ
โ Natural Language โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
MCP Tool Calling
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Server โ
โ โ
โ Tools โข Resources โ
โ Prompts โข Security โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ PostgreSQL โ
โ Database โ
โโโโโโโโโโโโโโโโโโโโโโโโโจ Key Features
๐ค Natural-Language Database Operations
Users can interact with company data using normal language.
Examples:
Show me all users.Find user with ID 2.Create a new user named Rahul with role developer.Change Rahul's role to manager.Analyze all users and tell me which role has the most users.๐ง MCP Tools
The project exposes database operations as MCP tools.
Current tools include:
Tool | Purpose |
| Retrieve all users |
| Retrieve a specific user |
| Create a new user |
| Update a user's role |
| Analyze user distribution |
๐ MCP Resources
The project also demonstrates MCP resources for providing structured contextual information to the AI agent.
Example:
company://infoThis resource contains information about:
Departments
Company roles
Organization structure
๐งฉ MCP Prompts
Reusable MCP prompts are included for structured operations such as user analysis.
Example analysis workflow:
1. Count total users
2. Group users by role
3. Identify unusual roles
4. Generate a summary๐ Security
Security is an important part of the project.
API-Key Authentication
The MCP server supports API-key authentication using HTTP authorization headers.
Two permission levels are implemented:
READ_ONLY
READ_WRITEAuthorization
Read operations can be performed using the read-only permission.
Database-changing operations require:
READ_WRITEpermission.
โ ๏ธ Confirmation Before Write Operations
Before executing database-changing operations, the AI client asks the user for confirmation.
Example:
โ ๏ธ WRITE OPERATION REQUIRES CONFIRMATION
Tool : update_user_role
Arguments : {
"user_id": 2,
"new_role": "manager"
}
Do you want to continue? (yes/no)The database is modified only after explicit approval.
๐ก๏ธ Input Validation
User input is validated before database operations.
For example, supported roles are:
developer
designer
product manager
managerInvalid input such as:
aestronuotis rejected instead of being inserted into the database.
๐ Audit Logging
Database-changing operations are recorded in an audit log.
Example:
action | tool_name | status
----------------+------------------+---------
update_user_role| update_user_role | SUCCESSThis provides traceability for sensitive operations.
๐๏ธ Project Structure
OPSMCP-AI-AGENNT/
โ
โโโ server/
โ โโโ auth/
โ โโโ database/
โ โ โโโ connection.py
โ โ
โ โโโ prompts/
โ โ โโโ user_analysis.py
โ โ
โ โโโ resources/
โ โ โโโ company.py
โ โ
โ โโโ tools/
โ โโโ audit.py
โ โโโ user_tools.py
โ
โโโ static/
โ โโโ app.js
โ โโโ style.css
โ
โโโ templates/
โ โโโ index.html
โ
โโโ ai_client.py
โโโ web_app.py
โโโ run_server.py
โโโ requirements.txt
โโโ .gitignore
โโโ README.md๐ ๏ธ Tech Stack
Backend
Python
FastAPI
Uvicorn
AI
OpenAI-compatible API
Function/tool calling
Natural-language interaction
Protocol
Model Context Protocol (MCP)
Streamable HTTP transport
Database
PostgreSQL
Psycopg
Frontend
HTML
CSS
JavaScript
Security
API-key authentication
Read/write authorization
Confirmation-based database mutations
Input validation
Audit logging
โ๏ธ Local Setup
1. Clone the repository
git clone https://github.com/Ayushsharma109/OPSMCP-AI-AGENNT.git
cd OPSMCP-AI-AGENNT2. Create a virtual environment
Windows:
python -m venv .venvActivate it:
.venv\Scripts\activate3. Install dependencies
pip install -r requirements.txt4. Configure environment variables
Create a .env file:
MCP_API_KEY=your_main_api_key
MCP_READONLY_KEY=your_readonly_api_key
OPENAI_API_KEY=your_api_key
OPENAI_BASE_URL=your_base_url
OPENAI_MODEL=your_model
DB_NAME=mcp_demo
DB_USER=postgres
DB_PASSWORD=your_password
DB_HOST=localhost
DB_PORT=5432Never commit
.envor API keys to GitHub.
5. Start PostgreSQL
Make sure PostgreSQL is running and the required database/tables exist.
6. Start the MCP server
python run_server.pyThe MCP server runs on:
http://127.0.0.1:80007. Start the web application
Open another terminal:
python web_app.pyThe dashboard will be available at:
http://127.0.0.1:8080๐งช Example Workflow
User
Show me all users.AI Agent
Determines that get_users is required.
MCP
Executes:
get_users()PostgreSQL
Returns the user records.
AI
Converts the database result into a natural-language response.
๐ Write Operation Workflow
User Request
โ
AI Agent
โ
MCP Tool Selection
โ
Permission Check
โ
User Confirmation
โ
Input Validation
โ
PostgreSQL Update
โ
Audit Log
โ
AI ResponseThis design helps prevent accidental database modifications.
๐ Hackathon MVP
OpsMCP was developed as a focused MVP demonstrating how MCP can be used to connect AI agents with real enterprise data and controlled backend operations.
The project focuses on:
AI tool calling
MCP architecture
Secure database interaction
Human confirmation for mutations
Auditability
Natural-language company operations
๐ Future Improvements
Potential future improvements include:
Role-based dashboard access
More enterprise MCP tools
Advanced analytics
Multi-database support
Better audit-log visualization
Deployment-ready authentication
Enterprise SSO integration
More granular permissions
๐จโ๐ป Author
Ayush Sharma
Built as a solo hackathon project exploring:
AI Agents + MCP + PostgreSQL + Secure Tool Execution
๐ License
This project is intended primarily as a hackathon and learning project.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables AI assistants to interact with PostgreSQL databases using natural language queries, providing secure read-only access to database schemas and SQL translation capabilities.67
- FlicenseAqualityNot gradedmaintenanceEnables comprehensive PostgreSQL database management through natural language including queries, schema operations, user management, and administrative tasks. Features enterprise-grade connection pooling, transaction support, and full database administration capabilities.112251
- AlicenseNot gradedqualityDmaintenanceEnables natural language interaction with PostgreSQL databases, supporting query execution, schema management, data operations, user management, and database maintenance with secure remote access via HTTP/SSE transport.MIT
- AlicenseNot gradedqualityDmaintenanceEnables secure, read-only PostgreSQL database interaction through natural language, with automatic database discovery and connection management.2MIT
Related MCP Connectors
Query PostgreSQL databases in plain English โ LLM-generated, safety-validated SQL.
The grounded data layer for any LLM: governed SQL, metrics, lineage and catalog over your data.
GibsonAI MCP server: manage your databases with natural language
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Ayushsharma109/OPSMCP-AI-AGENNT'
If you have feedback or need assistance with the MCP directory API, please join our Discord server