About Client Server
Client Server is an MCP server published by wangliguang in the Developer Tools category: mCP server: Client Server. It has been installed 0 times through Conduid.
The repository has 2 stars and 0 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues (0) before depending on it in production.
Install
npx mcp-client-serverThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Client Server
Powered by Claude · Grounded in docs
Security checks
- ·README presentNot checked yet.
- ·License declaredNot checked yet.
- ·Tests presentNot checked yet.
- ·Dependencies pinnedNot checked yet.
- ·No dynamic code executionNot checked yet.
- !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.
README
从这个项目中能获得的东西
- 大模型是如何与 mcp 进行交互
- 与tool的交互逻辑
- 与resource的交互逻辑
- 与prompt的交互逻辑
- 两种mcp server的机制
- 如何自己开发一个 mcp server
- 如何使用三方的mcp server
- stdio 如何转 streamable-http
一、项目介绍
1. 目录结构
├── index.js # 启动文件,在这里可以选择你要使用的 mcp server
├── llm
│ └── askLLM.js # 调用大模型
└── mcp
├── sse
│ └── client.js
├── stdio
│ ├── compute
│ │ ├── client.js
│ │ └── server.js # 自己写的 mcp server
│ └── filesystem
│ └── client.js
└── streamable-http
└── client.js
2. 脚本介绍
npm run start:开启对话服务,根目录下有个.env文件用于设置环境变量,在src/index里可以选择要测试的mcp 类型npm run sse:基于stdio启动sse服务npm run inspector:开启测试mcp server的可视化工具
3. 经验教训
-
各种
Transport都可以通过requestInit设置header,比如补充鉴权的tokennew StreamableHTTPClientTransport(new URL('http://localhost:8000/sse'), { requestInit: { headers: { "Authorization": "Bearer xxx", } } }) -
在访问各种
client各种接口时,都可以通过_meta设置参数,比如:await client.listTools({ _meta: { newsId: "179", } }) await client.callTool({ name: tool.name, arguments: { ...JSON.parse(functionInfo.arguments), _meta: { newsId: '170' } } }); await client.listResources({ _meta: { newsId: "179", } }) await client.readResource({ uri: "", _meta: { newId: '179' })
二、MCP知识点补充
1. 调用client.connect时报错
protocol version not supported, supported lastest version is 2025-03-26
主要原因是mcp client 和 mcp server 使用的 mcp 协议版本不一致,前端的办法就是升级 或降级@modelcontextprotocol/sdk的版本
2. stdio、sse、streamableHttp的区别
MCP 协议:为什么 Streamable HTTP 是最佳选择?
stdio 是在本地拉取对应的代码在本地启动一个服务
sse 是在服务器上拉取对应的代码启动一个服务
3. 如何将stdio 转换成sse或streamableHttp服务
工具:https://github.com/supercorp-ai/supergateway
4. RAG与MCP
5. Sequential Thinking
大腦思考大不同:Sequential Thinking MCP 與推理型大模型功能實現全解析
三、官方地址
README mirrored from the source repository 4 months ago. The original is authoritative.