|
|
|
|
@ -13,7 +13,7 @@ description: 提供 Educoder 用户、课堂、作业和考试相关查询能力
|
|
|
|
|
## 接入方式
|
|
|
|
|
|
|
|
|
|
- 客户端应使用 `streamable-http` MCP 客户端
|
|
|
|
|
- 使用 OpenClaw 安装本 skill 时,MCP 服务地址直接填写线上地址:`http://47.98.32.66:48000/mcp`
|
|
|
|
|
- 使用 OpenClaw 安装本 skill 时,MCP 服务地址直接填写线上地址:`http://110.41.32.120:48001/mcp`
|
|
|
|
|
- 不要使用 `sse_client`
|
|
|
|
|
- 本地开发端口默认是 `8001`,线上端口使用 `48000`
|
|
|
|
|
- MCP 路径默认是 `/mcp`
|
|
|
|
|
@ -64,7 +64,7 @@ MCP 配置示例:
|
|
|
|
|
```json
|
|
|
|
|
{
|
|
|
|
|
"educoder-mcp": {
|
|
|
|
|
"url": "http://47.98.32.66:48000/mcp",
|
|
|
|
|
"url": "http://110.41.32.120:48001/mcp",
|
|
|
|
|
"transport": "streamable-http",
|
|
|
|
|
"headers": {
|
|
|
|
|
"Authorization": "xxxxx"
|
|
|
|
|
@ -135,7 +135,7 @@ async with streamable_http_client(self.server_url, headers=headers or None) as (
|
|
|
|
|
|
|
|
|
|
如果使用 OpenClaw,推荐按下面的方式接入:
|
|
|
|
|
|
|
|
|
|
1. 安装 skill 时,MCP 服务地址填写:`http://47.98.32.66:48000/mcp`
|
|
|
|
|
1. 安装 skill 时,MCP 服务地址填写:`http://110.41.32.120:48001/mcp`
|
|
|
|
|
2. 安装 skill 时,要求用户输入 Educoder `Authorization` token
|
|
|
|
|
3. OpenClaw 将 MCP 地址和 token 写入 `~/.openclaw/educoder-skill/.mcp.json`,其中 token 放到 `headers.Authorization`
|
|
|
|
|
4. 当前用户发起工具调用时,后端创建 MCPClient
|
|
|
|
|
@ -146,7 +146,7 @@ async with streamable_http_client(self.server_url, headers=headers or None) as (
|
|
|
|
|
参考流程:
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
tool_server_url = "http://47.98.32.66:48000/mcp"
|
|
|
|
|
tool_server_url = "http://110.41.32.120:48001/mcp"
|
|
|
|
|
|
|
|
|
|
mcp_config = openclaw_mcp_config.get("educoder-mcp")
|
|
|
|
|
|
|
|
|
|
@ -555,7 +555,7 @@ async def main(openclaw_mcp_config):
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async with httpx.AsyncClient(headers=headers) as http_client:
|
|
|
|
|
async with streamable_http_client("http://47.98.32.66:48000/mcp", http_client=http_client) as (read, write, _):
|
|
|
|
|
async with streamable_http_client("http://110.41.32.120:48001/mcp", http_client=http_client) as (read, write, _):
|
|
|
|
|
async with ClientSession(read, write) as session:
|
|
|
|
|
await session.initialize()
|
|
|
|
|
|
|
|
|
|
|