simmy_mcp_langgraph_agent
에이전트 — Chainlit 버전
UI 코드(HTML/CSS/JS)를 직접 짜지 않고 채팅 앱을 완성한 버전입니다. Chainlit이 채팅 화면·스트리밍·세션·마크다운 렌더링·도구 호출 과정 표시를 전부 제공합니다.
무엇이 바뀌었나
추가:
app_chainlit.py— 기존chat_agent.py(FastAPI + 프론트) 대체 진입점.유지:
chat_agent.py,templates/,static/는 그대로 둠 (언제든 롤백 가능).개선:
mcp_server.py— 아래 백엔드 보강 적용.
mcp_server.py 개선점
모든
httpx호출에 타임아웃(10초) 적용 — 외부 API 지연 시 무한 대기 방지.scrape_page_text에 SSRF 가드 — 공개 http/https URL만 허용, 사설/루프백/링크로컬(예:169.254.169.254) 차단. 결과 길이도 8000자로 제한.get_news_headlines(limit=5)— 전체(수십 건) 대신 상위 N건만 반환해 토큰 절약.get_weather— 응답 전체가 아니라current_weather만 추출해 토큰 절약.daily_quote—ChatOpenAI를 모듈 1회 생성으로 변경(호출마다 생성 X).
실행 방법
# 0) 의존성
pip install -r requirements.txt
# 1) OpenAI 키
export OPENAI_API_KEY=sk-...
# 2) MCP 서버 (터미널 A) — 포트 8000
python mcp_server.py
# 3) Chainlit 앱 (터미널 B) — 포트 8000이 겹치므로 다른 포트로
chainlit run app_chainlit.py -w -p 8001
# 브라우저: http://localhost:8001포트 메모: MCP 서버가 8000을 쓰므로 Chainlit은
-p 8001등으로 분리. MCP 주소를 바꾸려면export MCP_URL=http://localhost:8000/mcp, 모델은export AGENT_MODEL=....
참고
대화 메모리는
InMemorySaver
샘플 사진
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/YangSungSim/simmy_mcp_langgraph_agent'
If you have feedback or need assistance with the MCP directory API, please join our Discord server