{"id":26945541,"url":"https://github.com/chemistwang/demo-mcp","last_synced_at":"2026-04-27T22:32:34.979Z","repository":{"id":285705201,"uuid":"959048752","full_name":"chemistwang/demo-mcp","owner":"chemistwang","description":"基于MCP协议构建的demo","archived":false,"fork":false,"pushed_at":"2025-04-02T07:57:35.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T08:32:29.414Z","etag":null,"topics":["mcp"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chemistwang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-04-02T07:25:05.000Z","updated_at":"2025-04-02T07:58:01.000Z","dependencies_parsed_at":"2025-04-02T08:43:32.882Z","dependency_job_id":null,"html_url":"https://github.com/chemistwang/demo-mcp","commit_stats":null,"previous_names":["chemistwang/demo-mcp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chemistwang/demo-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemistwang%2Fdemo-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemistwang%2Fdemo-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemistwang%2Fdemo-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemistwang%2Fdemo-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chemistwang","download_url":"https://codeload.github.com/chemistwang/demo-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chemistwang%2Fdemo-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32358509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["mcp"],"created_at":"2025-04-02T19:15:15.080Z","updated_at":"2026-04-27T22:32:34.965Z","avatar_url":"https://github.com/chemistwang.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MCP Demo\n\n支持查询天气 `query_weather` 和查询当前时间 `query_current_time`\n\n## 1. 启用 ollama\n\n启用 `ollama`，在 `.env` 文件中配置相关参数\n\n## 2. 安装依赖\n\n```bash\nuv sync\n```\n\n## 3. 激活虚拟环境\n\n```bash\nsource .venv/bin/activate\n```\n\n## 4. 运行\n\n```bash\nuv run client.py server.py\n```\n\n## 5. MCP 简介\n\n- Anthropic MCP 发布通告：https://www.anthropic.com/news/model-context-protocol\n- MCP GitHub 主页：https://github.com/modelcontextprotocol\n\n### 5.1 Server 简介\n\n根据 MCP 协议定义，`Server` 可以提供三种类型的标准能力，`Resources`、`Tools`、`Prompts`，每个`Server`可同时提供者三种类型能力或其中一种。\n\n- Resources：资源，类似于文件数据读取，可以是文件资源或是 API 响应返回的内容。\n- Tools：工具，第三方服务、功能函数，通过此可控制 LLM 可调用哪些函数。\n- Prompts：提示词，为用户预先定义好的完成特定任务的模板。\n\n### 5.2 协议\n\nMCP 定义了 Client 与 Server 进行通讯的协议与消息格式，其支持两种类型通讯机制：标准输入输出通讯、基于 SSE 的 HTTP 通讯，分别对应着本地与远程通讯。Client 与 Server 间使用`JSON-RPC 2.0`格式进行消息传输。\n\n- 本地通讯：使用了 stdio 传输数据，具体流程 Client 启动 Server 程序作为子进程，其消息通讯是通过`stdin/stdout`进行的，消息格式为`JSON-RPC 2.0`。\n- 远程通讯：Client 与 Server 可以部署在任何地方，Client 使用 SSE 与 Server 进行通讯，消息的格式为`JSON-RPC 2.0`，Server 定义了`/see与/messages`接口用于推送与接收数据。\n\n### 5.3 导航\n\n- MCP 官方服务器合集：https://github.com/modelcontextprotocol/servers\n- MCP Github 热门导航：https://github.com/punkpeye/awesome-mcp-servers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchemistwang%2Fdemo-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchemistwang%2Fdemo-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchemistwang%2Fdemo-mcp/lists"}