FastAPI SSE MCP Random
FastAPI SSE MCP 랜덤
스트리밍 통신을 위해 서버 전송 이벤트(SSE)를 사용하여 모델 컨텍스트 프로토콜(MCP)을 구현하는 FastAPI 서버입니다. 이 프로젝트는 난수 생성, Azure OpenAI DALL-E를 사용한 이미지 생성, AI 팟캐스트 생성 등 다양한 유틸리티 도구를 제공합니다.
특징
실시간 스트리밍 통신을 위한 SSE(Server-Sent Events)
구조화된 도구 사용을 위한 모델 컨텍스트 프로토콜(MCP) 구현
다양한 유틸리티 도구 :
에코 도구 및 리소스
난수 생성기
Azure OpenAI DALL-E 3를 통한 이미지 생성
AI 팟캐스트 생성
반성적 반응을 위한 "생각 도구"
Related MCP server: MyAIServ MCP Server
필수 조건
파이썬 3.10+
Azure OpenAI API 액세스(이미지 생성용)
설치
저장소를 복제합니다.
지엑스피1
종속성을 설치합니다.
pip install -r requirements.txt또는 uv 사용하면:
uv pip install -e .용법
서버 시작
다음을 사용하여 서버를 실행합니다.
python main.py서버는 http://0.0.0.0:8000 에서 시작됩니다.
사용 가능한 엔드포인트
GET /: 상태 점검 엔드포인트GET /sse/: SSE 연결 엔드포인트POST /messages/: 클라이언트 메시지의 엔드포인트
사용 가능한 도구
에코 도구
{
"name": "echo_tool",
"parameters": {
"message": "Hello, world!"
}
}난수 생성기
{
"name": "random_number",
"parameters": {
"min_value": 1,
"max_value": 100
}
}이미지 생성
{
"name": "generate_image",
"parameters": {
"prompt": "A beautiful landscape with mountains and a lake"
}
}팟캐스트 세대
{
"name": "generate_podcast",
"parameters": {
"prompt": "The future of artificial intelligence",
"duration": 5,
"name1": "Mark",
"voice1": "Thomas",
"name2": "Sophia",
"voice2": "Emily"
}
}생각 도구
{
"name": "think_tool",
"parameters": {
"input": "What are the implications of quantum computing?"
}
}프로젝트 구조
main.py: 주요 FastAPI 애플리케이션 및 MCP 도구 구현sse.py: 서버 전송 이벤트(SSE) 구현pyproject.toml: 프로젝트 메타데이터 및 종속성requirements.txt: 기본 종속성 목록
종속성
FastAPI: API 구축을 위한 웹 프레임워크
MCP: 모델 컨텍스트 프로토콜 구현
OpenAI: Azure OpenAI 서비스용 클라이언트
Uvicorn: FastAPI 애플리케이션을 실행하기 위한 ASGI 서버
요청: API 호출을 위한 HTTP 라이브러리
특허
[여기에 라이센스를 지정하세요]
기여하다
[프로젝트 참여에 대한 지침]
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Appeared in Searches
Latest Blog Posts
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/hk4crprasad/fastapi_sse_mcp_random'
If you have feedback or need assistance with the MCP directory API, please join our Discord server