hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
Integrations
Manages environment variables for configuration, including Selector AI API keys and URLs.
Runs the MCP server in a lightweight container with health checks, and the client can spawn the Docker container for interactive sessions.
Used for cloning the repository during installation process.
선택기 AI FastMCP
이 저장소는 Selector AI용 모델 컨텍스트 프로토콜(MCP)의 전체 구현을 제공합니다. 여기에는 스트리밍 가능 서버와 stdin/stdout을 통해 통신하는 Docker 기반 대화형 클라이언트가 포함됩니다.
✨ 특징
✅ 서버
FastMCP와 호환되며 Python 기반으로 구축됨
실시간 SSE 스트리밍 지원
Selector AI를 활용한 대화형 AI 채팅
최소한의 보일러플레이트
컨테이너 오케스트레이션을 위한 내장된 상태 점검
요청/응답 로깅 및 재시도
✅ 고객
Python 클라이언트가 Docker를 통해 서버를 생성합니다.
CLI와 프로그래밍 방식 액세스를 모두 지원합니다.
stdin 및 stdout을 통해 읽고 쓰기
.env를 사용한 환경 변수 구성
🚀 빠른 시작
필수 조건
파이썬 3.8 이상
도커
Selector AI API 키
선택기 API URL
⚙️ 설치
저장소 복제
git clone https://github.com/automateyournetwork/selector-mcp-server
cd 선택기-ai-mcp
Python 종속성 설치
pip install -r requirements.txt
환경 변수 설정 .env 파일을 만듭니다.
SELECTOR_URL= https://선택자-api-url
SELECTOR_AI_API_KEY=귀하의 API 키
🐳 도커파일
서버는 다음 Dockerfile을 사용하여 가벼운 컨테이너에서 실행됩니다.
python:3.11-slim에서
작업 디렉토리 /앱
requirements.txt를 복사하세요.
pip install -r requirements.txt를 실행하세요.
복사 . .
CMD ["python", "-u", "mcp_server.py"]
건강 점검 --간격=30초 --시간 초과=30초 --시작 기간=5초
CMD python -c "소켓 가져오기; s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM); s.connect('/tmp/mcp.sock'); s.send(b'{"tool_name": "ready"}\n'); data = s.recv(1024); s.close(); json 가져오기; result = json.loads(data); result.get('status') == 'ready'이면 0이고 그렇지 않으면 1)" || 1 종료
Docker 이미지 빌드
docker build -t selector-mcp .
🧠 클라이언트 사용
클라이언트 시작
그러면 Docker 컨테이너가 생성되고 대화형 셸이 열립니다.
파이썬 mcp_client.py
CLI 세션 예시
AIOps란 무엇인가요?
선택기> AIOps는 AI를 IT 운영에 적용하는 것을 말합니다.
프로그래밍 방식 액세스
selector_client에서 call_tool, spawn_server를 가져옵니다.
프로시저 = spawn_server()
call_tool(proc, "준비")
응답 = call_tool(proc, "ask_selector", {"content": "AIOps란 무엇인가요?"})
인쇄(응답)
🖥️ Claude Desktop과 함께 사용
Claude Desktop과 통합하는 경우 이 서버를 실행하고 소켓이나 HTTP 엔드포인트를 로컬로 노출할 수 있습니다.
Docker를 사용하거나 기본적으로 서버를 실행합니다.
파이썬 mcp_server.py
Claude Desktop의 외부 도구 구성에서 소켓이나 HTTP 엔드포인트에 연결합니다.
메시지가 다음 형식과 일치하는지 확인하세요.
지엑스피1
Claude Desktop은 stdout을 통해 AI의 구조화된 응답을 받게 됩니다.
🛠️ 나만의 컨테이너 만들기
이 설정을 사용자 지정하려면:
이 저장소를 포크하거나 복제하세요
선호하는 모델이나 라우팅 논리를 통합하려면 selector_fastmcp_server.py를 수정하세요.
Docker 이미지를 다시 빌드합니다.
docker build -t my-custom-mcp .
대신 my-custom-mcp를 생성하도록 클라이언트를 업데이트하세요.
"docker", "실행", "-i", "--rm", "my-custom-mcp"
📁 프로젝트 구조
선택기-ai-mcp/
✅ 요구 사항
requirements.txt의 종속성:
요청
파이썬-dotenv
📜 라이센스
아파치 라이선스 2.0
This server cannot be installed
스트리밍이 가능한 서버와 stdin/stdout을 통해 통신하는 Docker 기반 클라이언트를 통해 Selector AI와 실시간으로 대화형 AI 채팅을 할 수 있는 MCP(Model Context Protocol) 서버입니다.