Tools, MCP & Connectors¶
The AI agent's "abilities" come from tools. A tool is a JSON-schema function the model can call. Doable assembles a tool list for every chat message from three layers:
- Built-in tools — file I/O, shell, fetch, package install. Always present.
- Connectors (MCP servers) — locally running Model Context Protocol servers, e.g. an in-house knowledge base.
- Integrations — third-party SaaS (Notion, Slack, Linear, Stripe, Supabase, …) exposed as tools via OAuth.
Built-in tools¶
Implemented under services/api/src/ai/tools/ and registered by copilot-tool-loader.ts.
| Tool | What it does |
|---|---|
read_file |
Read a file from the project tree |
write_file |
Create / replace a file |
edit_file |
Patch a file (string-replace) |
list_dir |
List a directory |
grep |
Regex search across the project |
shell |
Run a shell command (policy-gated) |
install_package |
pnpm add with auto-detect for npm/yarn projects |
fetch |
HTTP GET with URL allow-list |
screenshot_preview |
Capture the live preview as PNG (Puppeteer) |
restart_dev_server |
Cycle the project's Vite process |
Every call passes through the policy sandbox. Filesystem operations are confined to the project root via dovault.
Adding an MCP connector¶
MCP is a standard for talking to AI tool servers over JSON-RPC.
- Run any MCP server (your own, or one from the catalog).
- In Doable: Workspace Settings → AI → Connectors → Add MCP server. Provide the URL or stdio command.
- The connector manager (
services/api/src/mcp/connector-manager.ts) connects, lists tools, and stores the metadata in theconnectorstable. - Workspace admins toggle individual tools on/off; the policy is persisted.
The next chat session will see the MCP tools alongside the built-ins.
Integrations (third-party SaaS)¶
Doable ships with connectors to dozens of SaaS products. The catalog lives in services/api/src/integrations/registry/ and is grouped by domain:
| Group | Examples |
|---|---|
ai-ml |
OpenAI, Anthropic, Together, Replicate, Hugging Face |
communication |
Slack, Discord, Telegram, Teams |
crm-marketing-social |
HubSpot, Mailchimp, Twitter/X, LinkedIn |
developer-tools |
GitHub, GitLab, Linear, Sentry, Vercel |
finance-ecommerce |
Stripe, PayPal, Shopify, QuickBooks |
productivity |
Notion, Google Drive, Airtable, Asana |
Adding a connection:
- Workspace Settings → Integrations → Browse.
- Pick a service, click Connect, OAuth in.
- Doable encrypts and stores the token (
ENCRYPTION_KEY). - The integration's tools become available to the agent in the next message.
The runtime that executes integration tool calls is services/api/src/integrations/runner.ts — it normalizes the wide variety of REST/SOAP/webhook conventions into a single tool.call interface.
Tool selection per mode¶
Different modes get different tool subsets. For example, Plan mode only allows read-only tools so the agent can analyze the codebase without modifying it. Configure under Workspace Settings → AI → Modes.
The mapping is stored in mode_tool_config (migration 050_mode_tool_config.sql) and edited by routes/admin-tools.ts.
Audit trail¶
Every tool call generates a SandboxAuditEntry:
- timestamp
- tool name + args
- decision (allow / deny / ask)
- result or error
- session, workspace, user
View under Workspace Settings → Audit or query the activity_events table directly.
Writing your own integration¶
See Contributing → Add an Integration.