Agent Implementation Model
Recommended build order and product primitives for agents implementing Weavz.
Use this page as the build map for Weavz. The product is organized around workspaces, configured integrations, connection resolution, agent access, and guarded execution.
Recommended Build Order
- Create or choose an MCP Workspace with one automatically included endpoint. Treat it as the product, tenant, project, personal user, or agent integration hub.
- Add workspace integrations with stable aliases. Configure connection strategy, enabled actions, built-in persistence, and execution policy on the workspace integration.
- Add connections and end users. Use
fixedfor shared service accounts,per_userfor user-owned auth, andper_user_with_fallbackwhen a default connection can be overridden by a user connection. - Start with no saved inputs or approval rules. Add saved inputs for repeated action values, or approval rules for particular actions that should ask first or be blocked. Existing explicit rules remain in force; automatic application and locks are advanced options.
- Choose the agent access path. For direct hosted-client onboarding, use the Weavz MCP App at
/mcp/weavzso the user signs in from Claude, ChatGPT, Codex, Cursor, or another MCP client, chooses a workspace during authorization, and receives a workspace-scoped Code Mode connector. For a selected workspace, use its included endpoint URL. There is no separate server creation step. - Use Code Mode for broad agent workspaces and Tool Mode for small explicit tool surfaces. Workspace integrations sync into MCP servers automatically.
- For app-owned agent harnesses, use
mcpWorkspaces.createAccessToken()ormcp_workspaces.create_access_token()with the workspace ID and an existing external end-user ID. Direct action execution is secondary and fits smoke tests, backend jobs, trigger workers, and non-MCP product flows. - Execute actions directly or enable triggers inside the workspace when a backend workflow needs that path. When the same integration appears more than once, target it with
workspaceIntegrationIdorintegrationAlias. - Choose the discovery path. Use runtime integration metadata for dynamic catalogs and setup UIs, TypeScript generated helpers for compile-time known action inputs, Python generated Pydantic models for local validation, and MCP Code Mode declarations for agent runtime tool calls.
- Validate the complete setup in Playground. Automate backend provisioning with REST, the TypeScript SDK, or the Python SDK; use the CLI for terminal, SSH, container, and coding agent workflows that operate the connected workspace.
Primitive Map
| Primitive | What it means |
|---|---|
| Workspace | The scoped integration hub for a product, tenant, project, or agent environment |
| Workspace integration | A configured integration instance with alias, connection strategy, enabled actions, and optional settings |
| Connection | The encrypted credential for a third-party service |
| End user | Your app user's identity for per-user auth and state |
Saved inputs (partials API) | Optional reusable action values; automatic application and locks are advanced choices |
Approval rule (approval-policies API) | Optional rule to ask before a matching action or block it |
| MCP endpoint | Included agent access URL for one MCP Workspace |
| Weavz MCP App | Generic remote MCP connector that provisions or reuses a Code Mode server after user sign-in and workspace selection |
| Filesystem/State KV | Built-in persistence for files and key-value state, scoped by end user, workspace, or custom namespace key |
| Code Mode | MCP mode with weavz_search, weavz_read_api, and weavz_execute for dynamic multi-step agent work |
| SDK generated catalog | Generated TypeScript action types and Python Pydantic models for known integration/action pairs |
| Weavz CLI | Terminal and coding agent workflow for workspace context, app management, action discovery, direct action runs, and Code Mode execution through the hosted MCP connector |
Default Choices
- Use workspace integrations and aliases instead of raw connections when embedding Weavz into a product.
- Default to one workspace per tenant, team, project, or agent environment. Use a workspace per user for personal-agent products or strict isolation where each user needs separate app configuration, state, endpoints and access policies.
- Use end users inside a shared workspace when users share the same integration environment but need their own credentials and state.
- Use Code Mode for agent-facing workspaces with many actions or multi-step workflows.
- Use the Weavz MCP App when the first user interaction should happen inside Claude, ChatGPT, Codex, Cursor, or another remote MCP client.
- Use private workspace access tokens when your backend provisions an agent harness. Send the returned
accessTokenasAuthorization: BearertomcpEndpoint; keep REST API keys on the backend. - Use Tool Mode for constrained servers with a small, explicit tool list.
- New MCP Workspaces include a Code Mode endpoint with OAuth, restricted end-user access, organization-member admission and
settings.codeMode.approvalWaitSeconds: 0. SetauthMode,endUserAccess,endUserId, orsettings.codeMode.approvalWaitSecondsonly when the client or approval flow needs those behaviors. - Add Filesystem, State KV, memory, browser, Computer Control or Sandbox only when the task needs them. Use code for basic JSON reshaping, dates or calculations; retired helpers are unavailable for new setup.
- Keep persistence and execution policy in workspace integration settings, not in action input.
- For actions and triggers, target repeated integrations with
workspaceIntegrationIdorintegrationAlias, passendUserIdfor per-user connection resolution, and usepartialIdswhen defaults or enforced values should be explicit. - Add approval rules before exposing high-risk tools to MCP clients.
- Use
client.integrations.get()orGET /api/v1/integrations?name=...for runtime action/property metadata. - Use TypeScript
ActionInput<I, A>,integrationActions, andisKnownActionName()for compile-time known SDK calls. - Use Python
get_action_input_model(),validate_action_input(), andclient.actions.execute_typed()for local Pydantic validation before SDK execution. - Use the CLI after user login when a terminal or coding agent needs to inspect workspace context, connect apps, validate inputs, run actions, or execute Code Mode scripts. Use API-key SDKs for SaaS backend provisioning.