FastAPI SSE MCP Random

by hk4crprasad

Integrations

  • Uses FastAPI to implement the Model Context Protocol server with Server-Sent Events for streaming communication

  • Connects to Azure OpenAI DALL-E 3 for image generation based on text prompts

  • Built with Python 3.10+ and includes various utility tools like random number generation, echo functionality, and AI podcast generation

FastAPI SSE MCP 랜덤

스트리밍 통신을 위해 서버 전송 이벤트(SSE)를 사용하여 모델 컨텍스트 프로토콜(MCP)을 구현하는 FastAPI 서버입니다. 이 프로젝트는 난수 생성, Azure OpenAI DALL-E를 사용한 이미지 생성, AI 팟캐스트 생성 등 다양한 유틸리티 도구를 제공합니다.

특징

  • 실시간 스트리밍 통신을 위한 SSE(Server-Sent Events)
  • 구조화된 도구 사용을 위한 모델 컨텍스트 프로토콜(MCP) 구현
  • 다양한 유틸리티 도구 :
    • 에코 도구 및 리소스
    • 난수 생성기
    • Azure OpenAI DALL-E 3를 통한 이미지 생성
    • AI 팟캐스트 생성
    • 반성적 반응을 위한 "생각 도구"

필수 조건

  • 파이썬 3.10+
  • Azure OpenAI API 액세스(이미지 생성용)

설치

  1. 저장소를 복제합니다.

지엑스피1

  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 라이브러리

특허

[여기에 라이센스를 지정하세요]

기여하다

[프로젝트 참여에 대한 지침]

-
security - not tested
F
license - not found
-
quality - not tested

구조화된 도구 사용을 위한 모델 컨텍스트 프로토콜(MCP)을 구현하는 FastAPI 서버로, 난수 생성, Azure OpenAI DALL-E를 통한 이미지 생성, AI 팟캐스트 생성 등의 유틸리티 도구를 제공합니다.

  1. 특징
    1. 필수 조건
      1. 설치
        1. 용법
          1. 서버 시작
          2. 사용 가능한 엔드포인트
          3. 사용 가능한 도구
        2. 프로젝트 구조
          1. 종속성
            1. 특허
              1. 기여하다

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol (MCP) server implementation for the OpenLedger API. This server provides structured context to AI models according to the MCP specification.
                  Last updated -
                  8
                  TypeScript
                  Apache 2.0
                • -
                  security
                  -
                  license
                  -
                  quality
                  A Model Context Protocol server enabling AI assistants to generate images through OpenAI's DALL-E API with full support for all available options and fine-grained control.
                  Last updated -
                  JavaScript
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  A zero-configuration tool that automatically converts FastAPI endpoints into Model Context Protocol (MCP) tools, enabling AI systems to interact with your API through natural language.
                  Last updated -
                  1
                  Python
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  A command-line tool that transforms any OpenAPI service into a Model Context Protocol (MCP) server, enabling seamless integration with AI agents and tools that support the MCP specification.
                  Last updated -
                  90
                  2
                  TypeScript
                  MIT License

                View all related MCP servers

                ID: cxgfonzuny