{"id":30866687,"url":"https://github.com/invariantlabs-ai/mcp-streamable-http","last_synced_at":"2025-09-07T22:06:24.485Z","repository":{"id":294444793,"uuid":"986903915","full_name":"invariantlabs-ai/mcp-streamable-http","owner":"invariantlabs-ai","description":"A working example for Streamable HTTP transport based MCP server and client","archived":false,"fork":false,"pushed_at":"2025-05-20T12:11:11.000Z","size":12,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-20T13:27:12.415Z","etag":null,"topics":["llm","mcp","mcp-client","mcp-server","mcp-streamable-http","tool-use"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/invariantlabs-ai.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-20T09:38:50.000Z","updated_at":"2025-05-20T12:14:59.000Z","dependencies_parsed_at":"2025-05-20T13:37:18.224Z","dependency_job_id":null,"html_url":"https://github.com/invariantlabs-ai/mcp-streamable-http","commit_stats":null,"previous_names":["invariantlabs-ai/mcp-streamable-http"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/invariantlabs-ai/mcp-streamable-http","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invariantlabs-ai%2Fmcp-streamable-http","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invariantlabs-ai%2Fmcp-streamable-http/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invariantlabs-ai%2Fmcp-streamable-http/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invariantlabs-ai%2Fmcp-streamable-http/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/invariantlabs-ai","download_url":"https://codeload.github.com/invariantlabs-ai/mcp-streamable-http/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/invariantlabs-ai%2Fmcp-streamable-http/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274101775,"owners_count":25222448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm","mcp","mcp-client","mcp-server","mcp-streamable-http","tool-use"],"created_at":"2025-09-07T22:03:15.919Z","updated_at":"2025-09-07T22:06:24.455Z","avatar_url":"https://github.com/invariantlabs-ai.png","language":"Python","funding_links":[],"categories":["🤖 AI/ML","📚 Projects (2474 total)"],"sub_categories":["MCP Servers"],"readme":"# MCP Streamable HTTP – Python and Typescript Examples\n\nThis 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](https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http).\n\nYou 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.\n\n## 🚀 Getting Started\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/invariantlabs-ai/mcp-streamable-http.git\ncd python-example\n```\n\n### 2. Python Example\n\n#### 1. Add Your Anthropic API Key\n\nUpdate the `.env` file inside the `python-example/client` directory with the following content:\n\n```env\nANTHROPIC_API_KEY=your_api_key_here\n```\n\n#### 2. Set Up the Server\n\n```bash\ncd python-example/server\npip install .\npython weather.py\n```\n\nBy default, the server will start at `http://localhost:8123`.  \nIf you'd like to specify a different port, use the `--port` flag:\n\n```bash\npython weather.py --port=9000\n```\n\n#### 3. Set Up the Client\n\n```bash\ncd ../client\npip install .\n```\n\n#### 4. Run the Client\n\n```bash\npython client.py\n```\n\nThis will start an **interactive chat loop** using the MCP Streamable HTTP protocol.  \nIf you started the MCP server on a different port, specify it using the `--mcp-localhost-port` flag:\n\n```bash\npython client.py --mcp-localhost-port=9000\n```\n\n### 3. Typescript Example\n\n#### 1. Add Your Anthropic API Key\n\nUpdate the `.env` file inside the `typescript-example/client` directory with the following content:\n\n```env\nANTHROPIC_API_KEY=your_api_key_here\n```\n\n#### 2. Set Up the Server\n\n```bash\ncd typescript-example/server\nnpm install \u0026\u0026 npm run build\nnode build/index.js\n```\n\nBy default, the server will start at `http://localhost:8123`.  \nIf you'd like to specify a different port, use the `--port` flag:\n\n```bash\nnode build/index.js --port=9000\n```\n\n#### 3. Set Up the Client\n\n```bash\ncd ../client\nnpm install \u0026\u0026 npm run build\n```\n\n#### 4. Run the Client\n\n```bash\nnode build/index.js\n```\n\nThis will start an **interactive chat loop** using the MCP Streamable HTTP protocol.  \nIf you started the MCP server on a different port, specify it using the `--mcp-localhost-port` flag:\n\n```bash\nnode build/index.js --mcp-localhost-port=9000\n```\n\n---\n\n## 💬 Example Queries\n\nIn the client chat interface, you can ask questions like:\n\n- “Are there any weather alerts in Sacramento?”\n- “What’s the weather like in New York City?”\n- “Tell me the forecast for Boston tomorrow.”\n\nThe 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvariantlabs-ai%2Fmcp-streamable-http","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finvariantlabs-ai%2Fmcp-streamable-http","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finvariantlabs-ai%2Fmcp-streamable-http/lists"}