
sidharthrajaram/mcp-sse
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
SSE 기반 MCP 클라이언트 및 서버의 작업 패턴
개요
이는 SSE 기반 MCP 서버와 그 도구를 사용하는 독립 실행형 MCP 클라이언트의 작동 패턴을 보여줍니다. 여기서 오리지널 논의를 기반으로 합니다. : .env나 환경 변수로 ANTHROPIC_API_KEY 제공하세요. 즉, MCP 서버는 이제 에이전트(클라이언트)가 언제든지 어디서든 연결, 사용, 분리되는 실행 중인 프로세스가 될 수 있습니다. 즉, SSE 기반 서버와 클라이언트는 분리된 프로세스(심지어 분리된 노드에서도)가 될 수 있습니다. 이는 클라이언트가 직접 서버를 하위 프로세스로 생성하는 STDIO 기반 패턴과 달리 '클라우드 네이티브' 사용 사례에 더 적합합니다. Smithery를 통해 Claude 데스크톱용 SSE 기반 서버와 클라이언트를 자동으로 설치하려면: weather.py 는 SSE 기반 MCP 서버로, 국립기상청 API를 기반으로 한 일부 도구를 제공합니다. MCP 문서의 STDIO 서버 예제를 기반으로 한 것입니다. 기본적으로 서버는 0.0.0 버전으로 실행됩니다.
개요(AI 번역)
이는 SSE 기반 MCP 서버와 그 도구를 사용하는 독립 실행형 MCP 클라이언트의 작동 패턴을 보여줍니다. 여기서 오리지널 논의를 기반으로 합니다.
사용
참고: ANTHROPIC_API_KEY는 .env 또는 환경 변수로 반드시 제공해야 합니다.
왜?
즉, MCP 서버는 이제 에이전트(클라이언트)가 언제든지 어디서든 연결, 사용, 분리되는 실행 중인 프로세스가 될 수 있습니다. 즉, SSE 기반 서버와 클라이언트는 분리된 프로세스(심지어 분리된 노드에서도)가 될 수 있습니다. 이는 클라이언트가 직접 서버를 하위 프로세스로 생성하는 STDIO 기반 패턴과 달리 ‘클라우드 네이티브’ 사용 사례에 더 적합합니다.
Smithery를 통해 설치 중
Smithery를 통해 Claude 데스크톱용 SSE 기반 서버와 클라이언트를 자동으로 설치하려면:
서버
weather.py는 SSE 기반 MCP 서버로, 국립기상청 API를 기반으로 한 일부 도구를 제공합니다. MCP 문서의 STDIO 서버 구현 예시에서 각색되었습니다.
기본적으로 서버는 0.0.0.0:8080으로 실행되지만, 다음과 같은 명령줄 인수로 구성할 수 있습니다:
의뢰인
client.py는 SSE 기반 MCP 서버에 연결하고 도구를 사용하는 MCP 클라이언트입니다.
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
SSE-based Server and Client for MCP
This demonstrates a working pattern for SSE-based MCP servers and standalone MCP clients that use tools from them. Based on an original discussion here.
Usage
Note: Make sure to supply ANTHROPIC_API_KEY in .env or as an environment variable.
uv run weather.py
uv run client.py http://0.0.0.0:8080/sse
Initialized SSE client...
Listing tools...
Connected to server with tools: ['get_alerts', 'get_forecast']
MCP Client Started!
Type your queries or 'quit' to exit.
Query: whats the weather like in Spokane?
I can help you check the weather forecast for Spokane, Washington. I'll use the get_forecast function, but I'll need to use Spokane's latitude and longitude coordinates.
Spokane, WA is located at approximately 47.6587° N, 117.4260° W.
[Calling tool get_forecast with args {'latitude': 47.6587, 'longitude': -117.426}]
Based on the current forecast for Spokane:
Right now it's sunny and cold with a temperature of 37°F and ...
Why?
This means the MCP server can now be some running process that agents (clients) connect to, use, and disconnect from whenever and wherever they want. In other words, an SSE-based server and clients can be decoupled processes (potentially even, on decoupled nodes). This is different and better fits “cloud-native” use-cases compared to the STDIO-based pattern where the client itself spawns the server as a subprocess.
Installing via Smithery
To install SSE-based Server and Client for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @sidharthrajaram/mcp-sse --client claude
Server
weather.py is a SSE-based MCP server that presents some tools based on the National Weather Service APIs. Adapted from the MCP docs’ example STDIO server implementation.
By default, server runs on 0.0.0.0:8080, but is configurable with command line arguments like:
uv run weather.py --host --port
Client
client.py is a MCP Client that connects to and uses tools from the SSE-based MCP server. Adapted from the MCP docs’ example STDIO client implementation.
By default, client connects to SSE endpoint provided in the command line argument like:
uv run client.py http://0.0.0.0:8080/sse
설치
npx -y @smithery/cli install @sidharthrajaram/mcp-sse --client claude