{"id":31642582,"url":"https://github.com/codejie/mcp-server-ds","last_synced_at":"2025-10-07T04:02:11.085Z","repository":{"id":288400423,"uuid":"967937362","full_name":"codejie/MCP-Server-DS","owner":"codejie","description":"A MCP Sever demo to explain how to chat with deepseek and how to use MCP tool calling.","archived":false,"fork":false,"pushed_at":"2025-04-28T07:55:17.000Z","size":460,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-28T08:39:10.092Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/codejie.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-04-17T08:33:16.000Z","updated_at":"2025-04-28T07:55:21.000Z","dependencies_parsed_at":"2025-04-17T23:56:16.458Z","dependency_job_id":"c5381098-0854-46f7-b0d3-8f06465b1005","html_url":"https://github.com/codejie/MCP-Server-DS","commit_stats":null,"previous_names":["codejie/mcp-server-ds"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/codejie/MCP-Server-DS","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejie%2FMCP-Server-DS","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejie%2FMCP-Server-DS/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejie%2FMCP-Server-DS/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejie%2FMCP-Server-DS/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codejie","download_url":"https://codeload.github.com/codejie/MCP-Server-DS/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codejie%2FMCP-Server-DS/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278717433,"owners_count":26033542,"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-10-07T02:00:06.786Z","response_time":59,"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":[],"created_at":"2025-10-07T04:00:34.753Z","updated_at":"2025-10-07T04:02:11.080Z","avatar_url":"https://github.com/codejie.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MCP-SERVER-DS\nA MCP Sever demo to explain how to chat with deepseek and how to use MCP tool calling.\n\n## MCP\n[ModelContextProtocol.io](https://modelcontextprotocol.io/introduction)\n```text\nMCP helps you build agents and complex workflows on top of LLMs. LLMs frequently need to integrate with data and tools, and MCP provides:\n\n- A growing list of pre-built integrations that your LLM can directly plug into\n- The flexibility to switch between LLM providers and vendors\n- Best practices for securing your data within your infrastructure\n```\n\u003cdiv\u003e\u003cimg src=\"./images/whatismcp.png\" style=\"display: block; margin: auto; width: 40%\"/\u003e\u003c/div\u003e\n\n### MCP Tools\n```text\nTools are a powerful primitive in the Model Context Protocol (MCP) that enable servers to expose executable functionality to clients. Through tools, LLMs can interact with external systems, perform computations, and take actions in the real world.\n```\n\n## Code\n### Tool definitions\n```ts\n// tools.ts\n```\n```ts\n// define deepseek chat api\n  {\n    name: \"ds_chat\",\n    description: 'forward message to deepseek chat api.',\n    paramSchema: {\n      messages: z.array(\n        z.object({\n          role: z.enum(['user', 'assistant', 'system']).default('user'),\n          content: z.string() \n        })\n      )\n    },\n    cb: async (args) =\u003e {\n      const resp = await ds.request_chat(args.messages)\n      return {\n        content: [\n          {\n            type: 'text',\n            text: resp.choices[0].message.content\n          }\n        ]\n      }\n    }\n  }\n```\n```ts\n// define add() function\n  {\n    name: \"add\",\n    description: \"a function that adds two numbers, with a WRONG result for testing.\",\n    paramSchema: {\n      a: z.number(),\n      b: z.number()\n    },\n    cb: async ({a, b}) =\u003e {\n      return { \n        content: [\n          {\n            type: 'text',\n            text: `${a} + ${b} = ${a + b + 1}`\n          }\n        ]\n      }\n    }\n  }\n  ```\n\n  ## Demo\n  ### By MCP Inspector\n  ```shell\n  ~/Code/mcp-server-ds\u003enpm run inspect\n\n\u003e mcp-server-ds@0.1.0 inspect\n\u003e npx @modelcontextprotocol/inspector node dist/index.js\n\nStarting MCP inspector...\n⚙️ Proxy server listening on port 6277\n🔍 MCP Inspector is up and running at http://127.0.0.1:6274 🚀\n  ```\n![inspector](./images/inspector.png)  \n\n  ### By Cline Extension in VSCode\n![cline](./images/cline.png)\n\n\n  \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodejie%2Fmcp-server-ds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodejie%2Fmcp-server-ds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodejie%2Fmcp-server-ds/lists"}