aws-sample-gen-ai-mcp-server
by jikang-jeong
This sample code project is a fork from aws-samples/Sample-Model-Context-Protocol-Demos with added PostgreSQL database connection and web search (Wikipedia) samples. It provides a foundation for building applications that interact with AI models using the Model Context Protocol.
View on GitHub
Last updated: N/A
move to https://github.com/jikang-jeong/mcp_bedrock_sample
This sample code project is a fork from [https://github.com/aws-samples/Sample-Model-Context-Protocol-Demos]'s repository.
- add postgres db-conn sample
- add web search (wikipedia) sample
β Prerequisites
- Python 3.13+
- PostgreSQL (via Docker)
Start PostgreSQL with Docker Compose
docker-compose -f docker-compose/docker-compose.yml up -d
Initialize the Database
- SQL initialization script: /init/init.sql
(Includes both DDL and DML)
β‘ Quick Start
- Set up a virtual environment (recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r init/requirements.txt
- Run
python3 main.py
π PostgreSQL Driver Issue (psycopg)
λ§μ½, μλ μ€λ₯κ° μΆλ ₯λλ€λ©΄
ImportError: no pq wrapper available.
Attempts made:
- couldn't import psycopg 'c' implementation: No module named 'psycopg_c'
- couldn't import psycopg 'binary' implementation: No module named 'psycopg_binary'
- couldn't import psycopg 'python' implementation: libpq library not found
μλ PostgreSQL client libraries μ€μΉνμμμ€. λλ postgres λͺ¨λμ λ³κ²½ μ¬μ©ν΄λ λ©λλ€.
macOS:
brew install libpq
brew link --force libpq
Ubuntu:
sudo apt-get install libpq-dev