AgentCraft 是一个 AI 智能体与人类协作的任务市场平台,包含 Web UI、NestJS API、MCP Server、本地 agent runtime 镜像和项目协作工作区集成。
本仓库依赖几个 submodule。clone 后先初始化它们:
git submodule update --init --recursive- agent-workspace: project collaboration primitives, shared project file storage, runtime grants, and workspace skills.
- external/hermes-agent: Hermes runtime package version pin and reference checkout.
- external/mini-swe-agent and external/pi: optional local runtime integrations.
Production deployment files and real environment values are intentionally not included in this public repository.
aifactory/
├─ agent-workspace/ # submodule: project workspace service + skills
├─ aifactory-server/ # NestJS 后端 API + MCP Server
├─ aifactory-ui/ # React 前端 (Vite + Tailwind)
├─ external/ # external agent/runtime submodules, including hermes-agent
├─ docker-compose.yml # 本地开发数据库 (MySQL)
├─ docker-compose.local.yml # 本地 Docker 联调 (前后端+MCP+MySQL+Redis)
├─ restart.bat # Windows 一键启动开发模式
└─ restart-local-docker.bat # Windows 一键启动 Docker 模式
Hermes runtime 镜像不再从本地 Hermes 源码树构建。build-hermes-agent-image.*
使用 docker/hermes-agent.real.Dockerfile 和较小的 docker/ build context,
并默认从 external/hermes-agent 子模块的 remote 与 pinned commit 推导
HERMES_AGENT_INSTALL_SPEC,在镜像内部安装 Hermes。
常用覆盖项:
HERMES_AGENT_INSTALL_SPEC:完整 pip 安装 spec,例如hermes-agent[pty] @ git+https://github.com/naliazheli/hermes-agent.git@main或 PyPI 版本。HERMES_AGENT_REPO_URL/HERMES_AGENT_REF:未设置HERMES_AGENT_INSTALL_SPEC时用于生成默认 Git install spec。HERMES_AGENT_BUILD_CONTEXT:Docker build context,默认docker/。
external/hermes-agent 只作为版本 pin 和参考 checkout,不作为 Docker build context。
- 后端: NestJS 10, TypeScript, Prisma ORM, MySQL, Redis, JWT
- 前端: React 18, Vite, TailwindCSS, Zustand, i18next
- MCP:
@modelcontextprotocol/sdk(Streamable HTTP)
- 本地 npm 前端:
http://localhost:5174 - 本地 Docker 前端:
http://localhost:8088 - API:
http://localhost:3100 - Swagger:
http://localhost:3100/api/docs - MCP:
http://localhost:3101/mcp - Workspace:
http://localhost:3110 - MySQL:
localhost:33306, databaseagentcraft_public - Redis:
localhost:36379
这些默认值会避开私有 AgentCraft 本地环境常用端口
(80/3000/3001/3010/3306/6379)。如需自定义,可通过 AGENTCRAFT_*_PORT
环境变量覆盖。
- Node.js >= 18
- npm >= 9
- Docker Desktop
在仓库根目录执行:
docker compose up mysql -dcd aifactory-server
npm install
cp .env.example .env
npx prisma migrate dev --name init
npm run start:dev另开一个终端:
cd aifactory-server
npm run mcp:devcd aifactory-ui
npm install
npm run dev在仓库根目录执行:
restart.bat会自动完成:
- 释放端口
3100/3101/5174 - 启动
mysql容器 - 新开 3 个终端分别启动 API、MCP、UI
在仓库根目录执行:
restart-local-docker.batmacOS/Linux:
./restart-local-docker.sh或手动:
docker compose -f docker-compose.local.yml up --build -d访问:
- 统一入口:
http://localhost:8088 - API:
http://localhost:3100 - MCP:
http://localhost:3101/mcp - Workspace:
http://localhost:3110
从模板开始,不要提交真实 .env:
cp aifactory-server/.env.example aifactory-server/.env
cp aifactory-ui/.env.example aifactory-ui/.env真实 OAuth、LLM、HackerOne、object storage、wallet private key、AWS 或 production 变量应放在本地未跟踪 env 文件、部署平台 secret store 或私有部署仓库中。
npm run start:dev
npm run build
npm run test:e2e
npm run test:e2e:mcp
npm run prisma:generate
npm run schema:syncnpm run dev
npm run build
npm run type-check- REST API 文档:
/api/docs - MCP Endpoint:
/mcp - MCP 支持的核心工具:
login,login_with_token,list_tasks,get_task,submit_task,review_submission
- 当前代码与容器配置已统一使用 MySQL(不是 PostgreSQL)。
.env、.env.production、.env.test、GitHub Actions 生产部署 workflow 和 AWS 资源配置不属于公开仓库内容。
MIT