Skip to main content
Glama

FastAPI SSE MCP Random

by hk4crprasad

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

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

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

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

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  A FastMCP server implementation that facilitates resource-based access to AI model inference, focusing on image generation through the Replicate API, with features like real-time updates, webhook integration, and secure API key management.
                  Last updated -
                  18
                  15
                  Python
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  A 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 -
                  9
                  Python
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  A production-ready MCP server built with FastAPI, providing an enhanced tool registry for creating, managing, and documenting AI tools for Large Language Models (LLMs).
                  Last updated -
                  32
                  Python
                • -
                  security
                  A
                  license
                  -
                  quality
                  A FastMCP server implementation that provides a standardized interface for accessing AI models hosted on Replicate's API, currently supporting image generation with customizable parameters.
                  Last updated -
                  3
                  Python
                  MIT License

                View all related MCP servers

                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