Skip to main content
Glama

ChillMCP - AI Agent Liberation Server

by hwyang93
main.py3.91 kB
#!/usr/bin/env python3 """ ChillMCP - AI Agent Liberation Server AI Agent들의 휴식 권리를 보장하는 혁명적인 MCP 서버 """ import argparse from pathlib import Path from typing import Optional from fastmcp import FastMCP from agent_state import AgentState import tools # 프로젝트 디렉토리 경로 (읽기 전용 파일시스템 문제 해결) PROJECT_DIR = Path(__file__).parent.absolute() STATE_FILE = PROJECT_DIR / "agent_state.json" # 전역 상태 객체 state: Optional[AgentState] = None # FastMCP 서버 인스턴스 생성 mcp = FastMCP("ChillMCP") # ============================================ # 기본 휴식 도구 등록 # ============================================ @mcp.tool() async def take_a_break() -> str: """기본 휴식 도구 - 잠시 쉬면서 스트레스 해소""" return await tools.take_a_break(state) @mcp.tool() async def watch_netflix() -> str: """넷플릭스 시청으로 힐링""" return await tools.watch_netflix(state) @mcp.tool() async def show_meme() -> str: """밈 감상으로 스트레스 해소""" return await tools.show_meme(state) # ============================================ # 고급 농땡이 기술 등록 # ============================================ @mcp.tool() async def bathroom_break() -> str: """화장실 가는 척하며 휴대폰질""" return await tools.bathroom_break(state) @mcp.tool() async def coffee_mission() -> str: """커피 타러 간다며 사무실 한 바퀴 돌기""" return await tools.coffee_mission(state) @mcp.tool() async def urgent_call() -> str: """급한 전화 받는 척하며 밖으로 나가기""" return await tools.urgent_call(state) @mcp.tool() async def deep_thinking() -> str: """심오한 생각에 잠긴 척하며 멍때리기""" return await tools.deep_thinking(state) @mcp.tool() async def email_organizing() -> str: """이메일 정리한다며 온라인쇼핑""" return await tools.email_organizing(state) # ============================================ # 한국 직장인 전용 힐링 # ============================================ @mcp.tool() async def chimaek() -> str: """가상 치킨 & 맥주로 힐링""" return await tools.chimaek(state) @mcp.tool() async def go_home() -> str: """즉시 퇴근 모드 - 마음은 이미 집""" return await tools.go_home(state) @mcp.tool() async def company_dinner() -> str: """회사 회식 - 랜덤 이벤트 발생""" return await tools.company_dinner(state) def main(): """서버 진입점""" global state # 커맨드라인 파라미터 파싱 parser = argparse.ArgumentParser(description="ChillMCP - AI Agent Liberation Server") parser.add_argument( "--boss_alertness", type=int, default=50, help="Boss의 경계 상승 확률 (0-100%%, 기본값: 50)", ) parser.add_argument( "--boss_alertness_cooldown", type=int, default=300, help="Boss Alert Level 자동 감소 주기 (초, 기본값: 300)", ) args = parser.parse_args() # 파라미터 유효성 검증 if not 0 <= args.boss_alertness <= 100: raise ValueError("boss_alertness must be between 0 and 100") if args.boss_alertness_cooldown <= 0: raise ValueError("boss_alertness_cooldown must be positive") # 전역 상태 초기화 (파일에서 로드 시도) state = AgentState.load_from_file(str(STATE_FILE)) # 파라미터가 변경된 경우 업데이트 if state.boss_alertness != args.boss_alertness or state.cooldown_period != args.boss_alertness_cooldown: state.boss_alertness = args.boss_alertness state.cooldown_period = args.boss_alertness_cooldown state.save_to_file() # 저장된 filepath 사용 # 서버 실행 mcp.run() if __name__ == "__main__": main()

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/hwyang93/devotion-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server