refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名) - 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块) - docreader proto 描述符采用等长替换,保持序列化字节布局有效 - Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像 - 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
This commit is contained in:
1 parent
9097ee699d
commit
9058149576
3136 files changed
+18018
-18004
No files matched your search
@@ -1,6 +1,6 @@
|
||||
# WeKnora 本地 MCP Demo
|
||||
# Academy 本地 MCP Demo
|
||||
|
||||
最小外部 MCP 服务,用来测试 WeKnora **作为 MCP 客户端**接入第三方工具。
|
||||
最小外部 MCP 服务,用来测试 Academy **作为 MCP 客户端**接入第三方工具。
|
||||
|
||||
提供 6 个演示工具:
|
||||
|
||||
@@ -21,7 +21,7 @@ chmod +x start.sh
|
||||
./start.sh
|
||||
```
|
||||
|
||||
`start.sh` 会自动创建 `.venv` 并安装依赖。默认监听 `http://127.0.0.1:8010/mcp`,鉴权令牌 `weknora-demo-token`。
|
||||
`start.sh` 会自动创建 `.venv` 并安装依赖。默认监听 `http://127.0.0.1:8010/mcp`,鉴权令牌 `academy-demo-token`。
|
||||
|
||||
自定义:
|
||||
|
||||
@@ -43,7 +43,7 @@ python test_tools.py
|
||||
|
||||
应列出 6 个工具。
|
||||
|
||||
## 3. 接入 WeKnora
|
||||
## 3. 接入 Academy
|
||||
|
||||
1. 打开 **设置 → MCP 服务 → 新建**
|
||||
2. 填写:
|
||||
@@ -54,7 +54,7 @@ python test_tools.py
|
||||
| 传输 | **HTTP Streamable** |
|
||||
| URL | `http://127.0.0.1:8010/mcp` |
|
||||
| 认证 | **Bearer** |
|
||||
| 令牌 | `weknora-demo-token`(与 `MCP_SERVER_AUTH_TOKEN` 一致) |
|
||||
| 令牌 | `academy-demo-token`(与 `MCP_SERVER_AUTH_TOKEN` 一致) |
|
||||
|
||||
3. 保存后点 **测试连接**,应发现 6 个工具。
|
||||
4. 在 **智能体** 配置里勾选该 MCP 服务(或选全部工具)。
|
||||
@@ -72,7 +72,7 @@ python test_tools.py
|
||||
|
||||
## 5. 注意事项
|
||||
|
||||
- WeKnora UI **不支持 stdio** 传输;必须用 **HTTP Streamable** 或 **SSE**。
|
||||
- Academy UI **不支持 stdio** 传输;必须用 **HTTP Streamable** 或 **SSE**。
|
||||
- Demo 只绑定 `127.0.0.1`,不要暴露到公网。
|
||||
- `send_demo_alert` 不会真正发送消息,仅返回模拟结果。
|
||||
|
||||
@@ -82,4 +82,4 @@ python test_tools.py
|
||||
MCP_TRANSPORT=sse MCP_PORT=8011 ./start.sh
|
||||
```
|
||||
|
||||
WeKnora 里传输选 **SSE**,URL 填 `http://127.0.0.1:8011/sse`。
|
||||
Academy 里传输选 **SSE**,URL 填 `http://127.0.0.1:8011/sse`。
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
WeKnora 本地 MCP Demo Server
|
||||
Academy 本地 MCP Demo Server
|
||||
|
||||
最小可运行的外部 MCP 服务,用于在 WeKnora「设置 → MCP 服务」里测试客户端接入。
|
||||
最小可运行的外部 MCP 服务,用于在 Academy「设置 → MCP 服务」里测试客户端接入。
|
||||
默认以 Streamable HTTP 监听 http://127.0.0.1:8010/mcp
|
||||
|
||||
启动:
|
||||
export MCP_SERVER_AUTH_TOKEN=weknora-demo-token
|
||||
export MCP_SERVER_AUTH_TOKEN=academy-demo-token
|
||||
python server.py
|
||||
|
||||
WeKnora 配置:
|
||||
Academy 配置:
|
||||
传输:HTTP Streamable
|
||||
URL:http://127.0.0.1:8010/mcp
|
||||
认证:Bearer,令牌与 MCP_SERVER_AUTH_TOKEN 一致
|
||||
@@ -31,7 +31,7 @@ from mcp.server import MCPServer
|
||||
logging.basicConfig(level=logging.INFO, format="%(levelname)s %(message)s")
|
||||
logger = logging.getLogger("mcp-demo")
|
||||
|
||||
mcp = MCPServer("weknora-mcp-demo", version="0.1.0")
|
||||
mcp = MCPServer("academy-mcp-demo", version="0.1.0")
|
||||
|
||||
# 与 website-docs/sample-data/ 配套的演示语料,方便 Agent 调用后对照知识库答案。
|
||||
DEMO_POLICIES: dict[str, str] = {
|
||||
@@ -63,7 +63,7 @@ def require_network_transport_auth(transport: str) -> str:
|
||||
if transport in ("sse", "http") and not token:
|
||||
logger.error(
|
||||
"MCP_SERVER_AUTH_TOKEN is required for %s transport. "
|
||||
"Example: export MCP_SERVER_AUTH_TOKEN=weknora-demo-token",
|
||||
"Example: export MCP_SERVER_AUTH_TOKEN=academy-demo-token",
|
||||
transport,
|
||||
)
|
||||
sys.exit(1)
|
||||
@@ -189,7 +189,7 @@ def list_team_contacts(department: str = "") -> dict[str, Any]:
|
||||
def send_demo_alert(channel: str, message: str) -> dict[str, Any]:
|
||||
"""模拟向外部渠道发送通知(演示用,不会真正外发)。
|
||||
|
||||
适合在 WeKnora 里测试 MCP 工具人工审批:建议把此工具标记为需要审批。
|
||||
适合在 Academy 里测试 MCP 工具人工审批:建议把此工具标记为需要审批。
|
||||
"""
|
||||
return {
|
||||
"ok": True,
|
||||
@@ -235,7 +235,7 @@ async def run_sse(host: str, port: int) -> None:
|
||||
|
||||
|
||||
def parse_args() -> argparse.Namespace:
|
||||
parser = argparse.ArgumentParser(description="WeKnora local MCP demo server")
|
||||
parser = argparse.ArgumentParser(description="Academy local MCP demo server")
|
||||
parser.add_argument(
|
||||
"--transport",
|
||||
choices=["http", "sse"],
|
||||
|
||||
@@ -3,7 +3,7 @@ set -euo pipefail
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
export MCP_SERVER_AUTH_TOKEN="${MCP_SERVER_AUTH_TOKEN:-weknora-demo-token}"
|
||||
export MCP_SERVER_AUTH_TOKEN="${MCP_SERVER_AUTH_TOKEN:-academy-demo-token}"
|
||||
export MCP_HOST="${MCP_HOST:-127.0.0.1}"
|
||||
export MCP_PORT="${MCP_PORT:-8010}"
|
||||
export MCP_TRANSPORT="${MCP_TRANSPORT:-http}"
|
||||
@@ -26,7 +26,7 @@ echo " transport : ${MCP_TRANSPORT}"
|
||||
echo " endpoint : http://${MCP_HOST}:${MCP_PORT}/$([ "$MCP_TRANSPORT" = http ] && echo mcp || echo sse)"
|
||||
echo " auth token: ${MCP_SERVER_AUTH_TOKEN}"
|
||||
echo
|
||||
echo "WeKnora UI → 设置 → MCP 服务 → 新建"
|
||||
echo "Academy UI → 设置 → MCP 服务 → 新建"
|
||||
echo " 传输: HTTP Streamable"
|
||||
echo " URL : http://${MCP_HOST}:${MCP_PORT}/mcp"
|
||||
echo " 认证: Bearer / ${MCP_SERVER_AUTH_TOKEN}"
|
||||
|
||||
@@ -14,7 +14,7 @@ from mcp.client.streamable_http import streamable_http_client
|
||||
|
||||
async def main() -> int:
|
||||
base = os.getenv("MCP_DEMO_URL", "http://127.0.0.1:8010/mcp")
|
||||
token = os.getenv("MCP_SERVER_AUTH_TOKEN", "weknora-demo-token")
|
||||
token = os.getenv("MCP_SERVER_AUTH_TOKEN", "academy-demo-token")
|
||||
|
||||
async with httpx.AsyncClient(
|
||||
headers={"Authorization": f"Bearer {token}"},
|
||||
|
||||
Reference in new issue
Block a user