-
Notifications
You must be signed in to change notification settings - Fork 0
Building a Tool
Forge is a plugin platform. Every tool is a folder under tools/ — add one and it appears in the rail, the CLI, and (if you export them) the MCP surface. Nothing in the shell needs changing.
The full guide lives in CONTRIBUTING.md. This is the shape of it.
tools/<id>/
plugin.json manifest (required)
client.jsx a default-exported React component (the UI)
server.mjs optional backend: routes, commands, MCP tools, skills, connectors
Scaffold from the template:
npm run new-tool -- <id> "Display Name"
npm run build # or: npm run watchid must match the folder name. Discovery is automatic — the client picks up client.jsx files and the server loads each server.mjs.
| Export | Becomes |
|---|---|
routes |
HTTP endpoints, mounted under /api/<your-id>/. |
commands |
Terminal subcommands — ai-forge <name> …. |
mcpTools |
Tools served over ai-forge mcp (stdio) to Claude Code / Codex. |
skills |
Reusable AI prompts, served as MCP prompts and via ai-forge skills. |
uiResources |
MCP-App panels rendered in a sandboxed iframe inside the conversation. |
connectors |
Credential / command connectors that show up on the Setup screen. |
Import shared logic from ../../src/. Credential/setup routes stay in the core shell because every tool shares them.
The CLI has zero runtime dependencies — Node built-ins and the global fetch only. React / webpack / Babel are build-time devDependencies that produce the browser bundle and never load in the CLI. Keep new tools the same way, so ai-forge stays install-free and works in CI and Codex.
- Match the existing style; use the shared UI primitives in
src/client/uiso every tool looks and behaves the same. - Accessibility and clear German/English strings are first-class — user-facing text is translatable.
- Keep
stdoutfor JSON-RPC only in MCP tools; send logging tostderr.
See CONTRIBUTING.md for full examples of each export, the manifest fields, and the design tokens.