WeKnora MCP Dispatch
This server is a multi-user MCP gateway for WeKnora, providing per-request API key authentication and tenant isolation, with optional read‑only operation.
Tenant Management: Create and list tenants (spaces).
Knowledge Base Management: Create, list, retrieve, delete, and hybrid search (vector + keyword) knowledge bases.
Knowledge Management: Ingest knowledge from files, URLs, or plain text; list, retrieve, and delete knowledge items.
Chunk Management: List and delete individual chunks within a knowledge item.
Model Management: Register, list, and inspect models for QA, embeddings, and reranking.
Session Management: Create, list, retrieve, and delete chat sessions, with configurable conversation rounds, query rewriting, and fallback responses.
Chat: Perform RAG‑based chat (retrieve relevant chunks and answer with an LLM) or agentic chat for autonomous multi‑step reasoning with tool use (knowledge search, web search, SQL, etc.).
Agent Management: List available agents and inspect their configurations, including knowledge base selection mode.
Wiki Features: Full‑text search across wiki pages, read a page by slug, and browse a structured index by page type (entities, concepts, summaries, etc.).
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@WeKnora MCP DispatchFind documents about MCP authentication in my knowledge base"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
WeKnora MCP Dispatch
这是面向 WeKnora v0.7.2 的多用户 MCP 网关,基于官方 MCP Server 1.1.1 (MCP Python SDK 2.x 高层 API)改造。一个 Streamable HTTP 服务实例可以接收 多个客户端请求,并以每个客户端提交的 WeKnora API Key 决定其可访问的空间和知识库。
定制能力
MCP_AUTH_MODE=weknora_api_key:将 Bearer Token 作为 WeKnora API Key 验证。API Key 仅绑定到当前 MCP 请求上下文,异步任务和同步工具工作线程均保持租户隔离。
动态 Key 模式不会回退到服务端静态
WEKNORA_API_KEY,上下文丢失时失败关闭。验证缓存只保存 SHA-256 指纹;缓存容量、TTL 和验证并发均有上限。
MCP_READ_ONLY=true:从 MCP 2.x 工具注册表移除写入、会话和聊天工具。保留上游
shared_secret和 stdio 模式,便于兼容原有部署。
请求链路:
MCP client
├─ 可选:外层网关鉴权请求头
└─ Authorization: Bearer <WeKnora API Key>
↓
WeKnora MCP Dispatch
├─ GET /knowledge-bases 验证 Key
├─ 绑定当前请求身份
└─ X-API-Key 转发至 WeKnora APIRelated MCP server: mcp-streamable-http-bridge
生产 Docker 配置
使用本仓库构建镜像,并参考
production.request-scoped.override.yml
覆盖 WeKnora 官方 Compose 的 mcp 服务。请求级模式下应保持
WEKNORA_API_KEY 和 MCP_SERVER_AUTH_TOKEN 为空。
docker build -t local/weknora-mcp-dispatch:v0.7.2 .关键环境变量:
变量 | 推荐值 | 说明 |
|
| WeKnora API 地址 |
|
| 启用请求级空间 Key |
|
| 仅暴露知识查询工具 |
|
| Streamable HTTP 路径 |
|
| 验证缓存 TTL |
|
| 最大缓存指纹数 |
|
| 最大并发验证数 |
WorkBuddy 配置示例
写入用户级 ~/.workbuddy/mcp.json 或项目级 .workbuddy/mcp.json:
{
"mcpServers": {
"weknora": {
"type": "http",
"url": "https://kb.example.com/mcp",
"headers": {
"Authorization": "Bearer ${WEKNORA_SPACE_API_KEY}",
"CF-Access-Client-Id": "${CF_ACCESS_CLIENT_ID}",
"CF-Access-Client-Secret": "${CF_ACCESS_CLIENT_SECRET}"
}
}
}
}如果入口没有 Cloudflare Access,删除两个 CF-Access-* 请求头即可。
Codex 配置示例
在 ~/.codex/config.toml 中加入:
[mcp_servers.weknora]
url = "https://kb.example.com/mcp"
bearer_token_env_var = "WEKNORA_SPACE_API_KEY"
env_http_headers = { "CF-Access-Client-Id" = "CF_ACCESS_CLIENT_ID", "CF-Access-Client-Secret" = "CF_ACCESS_CLIENT_SECRET" }如果入口没有 Cloudflare Access,删除 env_http_headers。不要把 WeKnora API Key
或外层网关 Secret 明文提交到配置仓库。
快速开始
推荐直接参考 MCP配置说明,无需进行以下操作。 本节沿用上游 stdio/静态 Key 用法;多用户 HTTP 生产部署请使用上面的请求级配置。
1. 安装依赖
pip install -r requirements.txt2. 配置环境变量
# Linux/macOS
export WEKNORA_BASE_URL="http://localhost:8080/api/v1"
export WEKNORA_API_KEY="your_api_key_here"
# Windows PowerShell
$env:WEKNORA_BASE_URL="http://localhost:8080/api/v1"
$env:WEKNORA_API_KEY="your_api_key_here"
# Windows CMD
set WEKNORA_BASE_URL=http://localhost:8080/api/v1
set WEKNORA_API_KEY=your_api_key_here3. 运行服务器
推荐方式 - 使用主入口点:
python main.py其他运行方式:
# 使用原始启动脚本
python run_server.py
# 使用便捷脚本
python run.py
# 直接运行服务器模块
python weknora_mcp_server.py
# 作为 Python 模块运行
python -m weknora_mcp_server4. 命令行选项
python main.py --help # 显示帮助信息
python main.py --check-only # 仅检查环境配置
python main.py --verbose # 启用详细日志
python main.py --version # 显示版本信息安装为 Python 包
从 PyPI 安装
pip install tencent-weknora-mcp
# 或使用 uvx 直接运行(无需预安装)
uvx --from tencent-weknora-mcp weknora-mcp-server官方 PyPI 包名为
tencent-weknora-mcp(Tencent/WeKnora 维护,Trusted Publishing 发布)。 旧社区包weknora-mcp请不要再使用。 安装后命令行入口仍为weknora-mcp-server/weknora-server。 官方 PyPI 包不包含本仓库的请求级多用户派发功能;生产部署该功能时应构建本仓库。
开发模式安装
pip install -e .安装后可以使用命令行工具:
weknora-mcp-server
# 或
weknora-server生产模式安装
pip install .构建分发包
# 使用 setuptools
python setup.py sdist bdist_wheel
# 使用现代构建工具
pip install build
python -m build测试模组
运行测试脚本验证模组是否正常工作:
python test_module.py
pytest -q tests功能特性
该 MCP 服务器提供以下工具:
空间管理
create_tenant- 创建新空间list_tenants- 列出所有空间
知识库管理
create_knowledge_base- 创建知识库list_knowledge_bases- 列出知识库get_knowledge_base- 获取知识库详情delete_knowledge_base- 删除知识库hybrid_search- 混合搜索
知识管理
create_knowledge_from_file- 从本地文件创建知识create_knowledge_from_url- 从 URL 创建知识create_knowledge_from_text- 从文本创建知识list_knowledge- 列出知识get_knowledge- 获取知识详情delete_knowledge- 删除知识
模型管理
create_model- 创建模型list_models- 列出模型get_model- 获取模型详情
会话管理
create_session- 创建聊天会话get_session- 获取会话详情list_sessions- 列出会话delete_session- 删除会话
聊天功能
chat- 发送聊天消息
块管理
list_chunks- 列出知识块delete_chunk- 删除知识块
故障排除
如果遇到导入错误,请确保:
已安装所有必需的依赖包
Python 版本兼容(推荐 3.10+)
没有文件名冲突(避免使用
mcp.py作为文件名)
调用效果
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA minimal, containerized MCP server that exposes a Streamable HTTP transport with API key authentication, allowing secure access to MCP endpoints.
- FlicenseNot gradedqualityBmaintenanceBridges stdio Model Context Protocol (MCP) servers to MCP Streamable HTTP behind a single gateway, enabling multi-tenant, multi-user deployment with per-tenant environment variables via HTTP headers.
- FlicenseNot gradedqualityCmaintenanceStateless MCP adapter for the LKPlanWise Go REST API, enabling AI agents to call curated financial tools via Streamable HTTP while forwarding bearer credentials.
- AlicenseNot gradedqualityBmaintenanceA thin stdio gateway to Nodus's Streamable HTTP MCP server, exposing a curated allowlist of tools for the Research Workbench. It enables secure, bearer-authenticated interactions with Nodus without graph logic or caching.MIT
Related MCP Connectors
Remote ChromaDB vector database MCP server with streamable HTTP transport
An authenticated remote MCP server for user-owned devices and one-shot capability invocation.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mwe-support/weknora-mcp-dispatch'
If you have feedback or need assistance with the MCP directory API, please join our Discord server