{"id":25363877,"url":"https://github.com/ipfans/postgres-mcp","last_synced_at":"2025-04-09T04:41:43.642Z","repository":{"id":276927120,"uuid":"930756242","full_name":"ipfans/postgres-mcp","owner":"ipfans","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-25T13:23:15.000Z","size":31,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T14:29:15.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ipfans.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-11T06:46:18.000Z","updated_at":"2025-03-25T13:23:15.000Z","dependencies_parsed_at":"2025-03-25T14:26:04.141Z","dependency_job_id":null,"html_url":"https://github.com/ipfans/postgres-mcp","commit_stats":null,"previous_names":["ipfans/postgres-mcp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfans%2Fpostgres-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfans%2Fpostgres-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfans%2Fpostgres-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfans%2Fpostgres-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipfans","download_url":"https://codeload.github.com/ipfans/postgres-mcp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247980822,"owners_count":21027803,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-14T22:53:28.924Z","updated_at":"2025-04-09T04:41:43.623Z","avatar_url":"https://github.com/ipfans.png","language":"Go","funding_links":[],"categories":["Databases"],"sub_categories":["How to Submit"],"readme":"# Postgres MCP (Research Project)\n\nA Model Control Protocol (MCP) server implementation for PostgreSQL databases. This project provides a simple HTTP interface to interact with PostgreSQL databases through MCP, allowing you to execute read-only queries and explore database resources.\n\n## Features\n\n- MCP-compliant HTTP server\n- Read-only SQL query execution\n- Database resource listing\n- Environment variable support through `.env` files\n- Built with Go and Gin web framework\n\n## Prerequisites\n\n- Go 1.23.6 or later\n- PostgreSQL database\n- Git\n\n## Installation\n\n```bash\ngit clone https://github.com/ipfans/postgres-mcp.git\ncd postgres-mcp\ngo mod download\n```\n\n## Configuration\n\nYou can configure the database connection in two ways:\n\n1. Using command-line flags:\n\n```bash\ngo run cmd/postgres-mcp/main.go -db \"postgres://user:password@localhost:5432/dbname\"\n```\n\n2. Using environment variables:\n   - Create a `.env` file in the project root\n   - Add your database URL:\n     ```\n     DATABASE_URL=postgres://user:password@localhost:5432/dbname\n     ```\n\n## Usage\n\n1. Start the server:\n\n```bash\ngo run cmd/postgres-mcp/main.go\n```\n\nThe server will start on port 8080 by default.\n\n2. Interact with the MCP endpoints:\n\n- List database resources:\n\n  ```\n  POST http://localhost:8080/mcp\n  Content-Type: application/json\n\n  {\n    \"type\": \"function\",\n    \"name\": \"resources\"\n  }\n  ```\n\n- Execute a read-only query:\n\n  ```\n  POST http://localhost:8080/mcp\n  Content-Type: application/json\n\n  {\n    \"type\": \"function\",\n    \"name\": \"query\",\n    \"arguments\": {\n      \"query\": \"SELECT * FROM your_table LIMIT 10\"\n    }\n  }\n  ```\n\n## License\n\nThis project is open source and available under the MIT License.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfans%2Fpostgres-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipfans%2Fpostgres-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfans%2Fpostgres-mcp/lists"}