
invariantlabs-ai/mcp-streamable-http
Developer tools이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기
invariantlabs-ai/mcp-streamable-http는 [[T0]에서 가져온 MCP 서버 후보입니다.
개요
invariantlabs-ai/mcp-streamable-http는 [[T0]에서 가져온 MCP 서버 후보입니다.
개요(AI 번역)
이 저장소는 명세인 MCP Streamable HTTP Spec에 기반한 Python 및 Typescript의 MCP(모델 컨텍스트 프로토콜) Streamable HTTP 클라이언트 및 서버의 예제 구현을 제공합니다: 📄 MCP Streamable HTTP Spec.
클라이언트 + 서버 스택은 Python 또는 TypeScript 중 하나만으로도 설정할 수 있습니다. 이 예시는 또한 Python 클라이언트가 TypeScript 서버와 통신할 수 있도록 하는 언어 간 호환성을 보여줍니다.
🚀 시작하기
1. 저장소 복제
2. 파이썬 예시
1. Anthropic API 키를 추가하세요
python-example/client 디렉터리 내 .env 파일을 다음 내용으로 업데이트하세요:
2. 서버 설정
기본적으로 서버는 http://localhost:8123에서 시작합니다.
다른 포트를 지정하고 싶으면 --port 플래그를 사용하세요:
3. 클라이언트 설정
4. 클라이언트 실행
이로 인해 MCP Streamable HTTP 프로토콜을 사용한 대화형 채팅 루프가 시작됩니다.
만약 다른 포트에서 MCP 서버를 시작했다면, --mcp-localhost-port 플래그로 지정하세요:
3. Typescript 예시
1. Anthropic API 키를 추가하세요
typescript-example/client 디렉터리 내 .env 파일을 다음 내용으로 업데이트하세요:
이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.
README
MCP Streamable HTTP – Python and Typescript Examples
This repository provides example implementations of MCP (Model Context Protocol) Streamable HTTP client and server in Python and Typescript, based on the specification: 📄 MCP Streamable HTTP Spec.
You can set up a client + server stack entirely using either Python or TypeScript. This example also demonstrates cross-language compatibility, allowing a Python client to communicate with a TypeScript server, and vice-versa.
🚀 Getting Started
1. Clone the Repository
git clone https://github.com/invariantlabs-ai/mcp-streamable-http.git
cd python-example
2. Python Example
1. Add Your Anthropic API Key
Update the .env file inside the python-example/client directory with the following content:
ANTHROPIC_API_KEY=your_api_key_here
2. Set Up the Server
cd python-example/server
pip install .
python weather.py
By default, the server will start at http://localhost:8123.
If you’d like to specify a different port, use the --port flag:
python weather.py --port=9000
3. Set Up the Client
cd ../client
pip install .
4. Run the Client
python client.py
This will start an interactive chat loop using the MCP Streamable HTTP protocol.
If you started the MCP server on a different port, specify it using the --mcp-localhost-port flag:
python client.py --mcp-localhost-port=9000
3. Typescript Example
1. Add Your Anthropic API Key
Update the .env file inside the typescript-example/client directory with the following content:
ANTHROPIC_API_KEY=your_api_key_here
2. Set Up the Server
cd typescript-example/server
npm install && npm run build
node build/index.js
By default, the server will start at http://localhost:8123.
If you’d like to specify a different port, use the --port flag:
node build/index.js --port=9000
3. Set Up the Client
cd ../client
npm install && npm run build
4. Run the Client
node build/index.js
This will start an interactive chat loop using the MCP Streamable HTTP protocol.
If you started the MCP server on a different port, specify it using the --mcp-localhost-port flag:
node build/index.js --mcp-localhost-port=9000
💬 Example Queries
In the client chat interface, you can ask questions like:
- “Are there any weather alerts in Sacramento?”
- “What’s the weather like in New York City?”
- “Tell me the forecast for Boston tomorrow.”
The client will forward requests to the local MCP weather server and return the results using Anthropic’s Claude language model. The MCP transport layer used will be Streamable HTTP.
설치
This server does not publish a one-line install command.
Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →