Enables containerized deployment of the FastAPI application with scripts for managing the service lifecycle including starting, stopping, and monitoring.
Uses .env files for configuration management, allowing secure storage of database credentials and connection strings.
Built on FastAPI framework, providing RESTful API endpoints for health checks, database operations, and note management with automatic API documentation.
Allows connection to PostgreSQL databases, providing tools for testing database connections, viewing table structures, and querying table data with pagination support.
Supports connection to databases using Prisma ORM through environment configuration variables.
FastAPI Sample Project
간단한 FastAPI 샘플 프로젝트입니다.
설치
필요한 패키지들을 설치하세요:
실행
로컬 실행
서버를 실행하려면:
Docker를 사용한 실행 (권장)
Docker를 사용하여 FastAPI 애플리케이션을 실행 (외부 PostgreSQL 데이터베이스 연결):
사전 준비
- 프로젝트 루트에
.env
파일을 생성하고 PostgreSQL 연결 정보를 입력하세요:
스크립트 사용 (권장)
직접 명령어 사용
서버가 실행되면 다음 URL에서 접근할 수 있습니다:
- API 서버: http://localhost:8000
- API 문서: http://localhost:8000/docs
- ReDoc 문서: http://localhost:8000/redoc
- MCP 서버: http://localhost:8000/mcp
API 엔드포인트
기본 엔드포인트
GET /
: API 문서로 리다이렉트GET /health
: API 상태 확인
데이터베이스 엔드포인트
GET /db/test-connection
: 데이터베이스 연결 테스트GET /db/config
: 데이터베이스 설정 정보 확인 (비밀번호는 가려짐)GET /db/tables
: 데이터베이스의 모든 테이블 목록 조회GET /db/table/{table_name}
: 특정 테이블의 구조 정보 조회GET /db/table/{table_name}/data
: 특정 테이블의 데이터 조회 (limit, offset 파라미터 지원)
노트 관리 엔드포인트 (MCP 통합)
POST /notes
: 새로운 노트 생성 (사용자가 "노트" 언급 시 사용)GET /notes
: 모든 노트 조회 (페이징 지원)GET /notes/{note_id}
: 특정 노트 조회DELETE /notes/{note_id}
: 특정 노트 삭제
MCP (Model Context Protocol) 사용법
이 프로젝트는 FastAPI MCP를 통합하여 MCP 클라이언트와 연결할 수 있습니다.
MCP 클라이언트 연결
SSE를 사용한 연결
가장 인기 있는 MCP 클라이언트(Claude Desktop, Cursor & Windsurf)는 다음 설정을 사용합니다:
mcp-remote를 사용한 연결
인증이나 SSE를 지원하지 않는 MCP 클라이언트의 경우 mcp-remote
를 브리지로 사용할 수 있습니다:
MCP 서버 접근
- MCP 서버는
http://localhost:8000/mcp
에서 실행됩니다 - FastAPI 애플리케이션과 함께 자동으로 시작됩니다
개발
이 프로젝트는 FastAPI 프레임워크를 사용하여 구축되었습니다. 자동으로 생성되는 API 문서를 통해 엔드포인트를 테스트할 수 있습니다.
This server cannot be installed
A sample FastAPI project that implements the Model Context Protocol (MCP), allowing AI assistants to connect to a PostgreSQL database and manage notes through natural language interactions.
Related MCP Servers
- -securityAlicense-qualityA high-performance FastAPI server supporting Model Context Protocol (MCP) for seamless integration with Large Language Models, featuring REST, GraphQL, and WebSocket APIs, along with real-time monitoring and vector search capabilities.Last updated -5PythonMIT License
- -securityFlicense-qualityA FastAPI-based implementation of the Model Context Protocol that enables standardized interaction between AI models and development environments, making it easier for developers to integrate and manage AI tasks.Last updated -5PythonMIT License
- -securityAlicense-qualityA Model Context Protocol (MCP) server that enables AI assistants to interact with MySQL databases by executing SQL queries and checking database connectivity.Last updated -TypeScriptMIT License
- -securityAlicense-qualityA modern Model Context Protocol (MCP) server that enables AI assistants to collect interactive user feedback, supporting text and image-based responses.Last updated -PythonMIT License