Skip to content
Weavz
Menu

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.

  1. Create or choose an MCP Workspace with one automatically included endpoint. Treat it as the product, tenant, project, personal user, or agent integration hub.
  2. Add workspace integrations with stable aliases. Configure connection strategy, enabled actions, built-in persistence, and execution policy on the workspace integration.
  3. Add connections and end users. Use fixed for shared service accounts, per_user for user-owned auth, and per_user_with_fallback when a default connection can be overridden by a user connection.
  4. 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.
  5. Choose the agent access path. For direct hosted-client onboarding, use the Weavz MCP App at /mcp/weavz so 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.
  6. Use Code Mode for broad agent workspaces and Tool Mode for small explicit tool surfaces. Workspace integrations sync into MCP servers automatically.
  7. For app-owned agent harnesses, use mcpWorkspaces.createAccessToken() or mcp_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.
  8. 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 workspaceIntegrationId or integrationAlias.
  9. 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.
  10. 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

PrimitiveWhat it means
WorkspaceThe scoped integration hub for a product, tenant, project, or agent environment
Workspace integrationA configured integration instance with alias, connection strategy, enabled actions, and optional settings
ConnectionThe encrypted credential for a third-party service
End userYour 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 endpointIncluded agent access URL for one MCP Workspace
Weavz MCP AppGeneric remote MCP connector that provisions or reuses a Code Mode server after user sign-in and workspace selection
Filesystem/State KVBuilt-in persistence for files and key-value state, scoped by end user, workspace, or custom namespace key
Code ModeMCP mode with weavz_search, weavz_read_api, and weavz_execute for dynamic multi-step agent work
SDK generated catalogGenerated TypeScript action types and Python Pydantic models for known integration/action pairs
Weavz CLITerminal 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 accessToken as Authorization: Bearer to mcpEndpoint; 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. Set authMode, endUserAccess, endUserId, or settings.codeMode.approvalWaitSeconds only 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 workspaceIntegrationId or integrationAlias, pass endUserId for per-user connection resolution, and use partialIds when defaults or enforced values should be explicit.
  • Add approval rules before exposing high-risk tools to MCP clients.
  • Use client.integrations.get() or GET /api/v1/integrations?name=... for runtime action/property metadata.
  • Use TypeScript ActionInput<I, A>, integrationActions, and isKnownActionName() for compile-time known SDK calls.
  • Use Python get_action_input_model(), validate_action_input(), and client.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.

Key References