Cartesi Knowledge MCP Server
Cartesi 知识 MCP 服务器
面向生产环境的 模型上下文协议 (Model Context Protocol) 服务器,通过 可流式传输的 HTTP 向 AI 代理公开来自 PostgreSQL 的精选 Cartesi 开发者资源。
当前功能
FastMCP (
mcp[cli]1.26.x) 配合streamable_http_app()— 在生产环境中直接使用 FastMCP 的 Starlette 应用,以便会话生命周期正确运行(参见src/main.py中的create_app())。异步 SQLAlchemy + asyncpg,用于对知识数据库进行只读访问。
分层布局:配置和日志记录 (
src/core/)、数据库会话和模型 (src/db/)、存储库、领域服务 (src/domain/resource_service.py)、模式、格式化程序以及src/server/下的服务器模块。传输安全:
src/server/server.py中提供 DNS 重绑定保护以及可配置的allowed_hosts/allowed_origins(请根据您的部署主机名进行扩展)。纯 HTTP 健康检查:
GET /healthz与 MCP 路由一起返回{"status":"ok"}。
知识响应为 元数据和链接(标题、URI、canonical_url、文档路由)。它们 不 包含完整抓取的页面正文;当代理需要原始 HTML 或 Markdown 时,应自行获取外部 URL。
工作流工具 (prepare_cartesi_*、send_input_to_application、prepare_*_deposit_instructions、get_cartesi_app_logic_guidance) 仅返回针对用户机器的 指令和命令模板。它们 不 会在此服务器上运行 Cartesi CLI、cast 或链上 RPC。
Related MCP server: read-docs-mcp
要求
Python ≥ 3.11(参见
pyproject.toml;随附的Dockerfile使用 Python 3.12)。一个已填充
src/db/models.py和ResourceService所需精选资源模式的 PostgreSQL 数据库。
环境变量
将 .env.example 复制到 .env 并进行调整。默认值和字段名称定义在 src/core/config.py 中(特别是 DATABASE_URL、APP_HOST、APP_PORT、MCP_BASE_URL、分页限制)。对于 PostgreSQL URL,postgres://... 会被规范化为 postgresql+asyncpg://...,sslmode 会被转换为兼容 asyncpg 的 ssl(例如,sslmode=disable 变为 ssl=false)。
安装
使用 uv(推荐):
uv sync使用 pip:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt运行
python -m src.mainuv run python -m src.mainuv run uvicorn src.main:create_app --factory --host 0.0.0.0 --port 8000MCP 端点是位于以下位置的可流式传输 HTTP:
http://<host>:<port>/mcp(默认:http://0.0.0.0:8000/mcp)
Docker
该存储库包含一个多阶段 Dockerfile,它使用 uv 安装依赖项并运行 python -m src.main。在运行时设置 DATABASE_URL 和其他环境变量(例如通过 -e 或您的编排器)。
建议的客户端测试
使用 MCP Inspector 或任何兼容 MCP 的客户端并连接到:
http://localhost:8000/mcpMCP 资源
URI | 用途 |
| 服务器名称、环境、 |
| 目录:资源 URI、工具名称、提示词和建议代理流程的索引 |
| 规范化的资源元数据 |
| 文档资源视图(形状相同;非文档 ID 会报错) |
| 带有父上下文的单个文档路由 |
| 存储库同步/新鲜度元数据 |
| 按标签分组的资源 |
| 按来源分组的资源 |
MCP 工具(注册名称)
这些是客户端看到的 name= 值(Python 处理程序名称可能不同)。
知识
summarize_knowledge_base— 覆盖范围、计数、导向get_knowledge_taxonomy— 已知的标签和来源标题search_knowledge_resources— 按查询、标签、来源、类型搜索get_resource_detail— 按 ID 获取单个资源,可选路由list_resource_doc_routes— 文档资源的路由search_documentation_routes— 跨资源搜索路由list_resources_for_tag/list_resources_for_sourceget_repository_sync_statusbuild_debugging_context— 以问题为中心的资源和路由包
主机端 Cartesi 工作流(仅指令)
prepare_cartesi_create_command— 稳定版 v1.5.x 与 alpha 版 v2.0 创建指南prepare_cartesi_build_commandprepare_cartesi_run_commandsend_input_to_application— InputBox +cast模板prepare_erc20_deposit_instructions— ERC20Portal 流程prepare_erc721_deposit_instructions— ERC721Portal 流程prepare_erc1155_deposit_instructions— ERC1155SinglePortal 流程get_cartesi_app_logic_guidance— 地址簿、门户、凭证、通知、报告
MCP 提示词
debug_cartesi_issue— 使用精选知识进行结构化调试find_cartesi_docs— 主题的文档路由发现explain_repository_context— 存储库资源 + 状态摘要
This server cannot be deployed
Maintenance
Related MCP Connectors
Shared, versioned context that humans and AI agents can publish, review, annotate, and continue.
AI Reasoning Cache & Consensus Layer with 11 MCP tools via Streamable HTTP.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Intelligent context infrastructure for AI teams: knowledge graph, sessions, tasks, documents.
Related MCP Servers
FlicenseAqualityBmaintenanceA server that exposes blockchain data (balances, tokens, NFTs, contract metadata) via the Model Context Protocol, enabling AI agents and tools to access and analyze blockchain information contextually.1845-- AlicenseBqualityDmaintenanceA Model Context Protocol server that enables AI agents to access, search, and understand structured package documentation and source code from Git repositories. It automatically generates specialized tools to browse module overviews, components, and detailed documentation for technical libraries.1698 npm7MIT
- AlicenseNot gradedqualityDmaintenanceA read-only Model Context Protocol server that exposes a semantic knowledge base to AI agents via 27 tools. It enables querying of documents and data integrated from sources like Notion, SharePoint, HubSpot, and Slack.MIT

cfabric-mcpofficial
AlicenseNot gradedqualityBmaintenanceEnables AI agents to perform corpus analysis tasks such as discovery, search, and data access via the Model Context Protocol.10MIT