agents-mcp-demo
If you are the rightful owner of agents-mcp-demo 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 repository serves as a template for implementing a Model Context Protocol (MCP) server, demonstrating how to connect AI agents to tools and data sources using a PostgreSQL database.
The Template MCP Server acts as a secure gateway between an MCP client and an external data source, specifically a PostgreSQL database. It demonstrates the implementation of an MCP server that can define and expose custom tools, handle requests from MCP clients, translate these requests into backend operations, and return structured results or errors. The server uses a toy PostgreSQL database with a 'users' table to showcase these capabilities. The server is designed to illustrate the basic setup and operation of an MCP server, including defining tools like adding, retrieving, finding, and deleting users in the database. The server is configured using environment variables and can be run using Docker or locally for development purposes.
Features
- Secure gateway between MCP client and PostgreSQL database.
- Custom tool definition and exposure via MCP standard.
- Request handling and translation into backend operations.
- Structured result or error return to clients.
- Example tools for user management in a database.
Tools
add_user`
Add new users to the database
get_all_users`
Search list of all users
find_user_by_email`
Find specific users by email
delete_user_by_email`
Delete users based on email