Skip to content
Integrations and automation

Connect an AI agent to Farin with MCP

Create a Farin API key, add the hosted MCP endpoint to your AI agent, and check access with wazi_describe.

3 min read Updated Owners and managers setting up AI agent integrations

Connect an MCP-compatible AI agent to Farin’s hosted server at /api/mcp with a company-scoped API key. Create the key in API Keys, then add the endpoint and bearer header in your agent.

Start with read access for the domains the agent needs. Use the API key guide to review permissions, then call wazi_describe to confirm which resources the key can access.

Quick facts

Start here

  • MCP (Model Context Protocol) is a standard that lets AI tools call structured functions on your behalf.
  • The hosted MCP endpoint accepts a Farin wz_ API key as a bearer token; tool calls do not need a separate key argument.
  • Use wazi_describe to discover permitted domains, resources, and columns before reading or changing data.
  • wazi_query reads data. wazi_mutate writes only when the API key has CRUD permission for that domain.
  • For production planning, use wazi_call_action with the production domain to read daily bake sheets or released runs. Changing retail targets or releasing a run requires production CRUD access.
  • Revoke the key from API Keys to remove access from future requests.

How it works

Farin accepts the agent’s MCP requests over Streamable HTTP, checks the bearer key and its domain permissions, and returns structured results from the Farin API. The agent does not connect to the database directly.

Step 1: Generate an API key

Open API key settings

Go to API Keys.

Only owners and managers can create API keys.

Create a new key

Click Create API Key.

Give the key a name you can recognize later. Select only the API domains the agent needs, and choose read unless it must make changes.

  • You can revoke a key at any time from the same page.
  • The full key value is shown only once — copy it before closing the dialog.

Step 2: Configure the agent

Farin provides a hosted MCP endpoint, so you do not need to run a local MCP script. In an MCP-compatible agent, add the endpoint and bearer header below.

Add the hosted endpoint

Use the Streamable HTTP transport and enter the Farin host your workspace uses. For the main Farin host, the endpoint is https://farin.app/api/mcp.

  • Endpoint: https://farin.app/api/mcp (or your Farin host plus /api/mcp)
  • Header: Authorization: Bearer wz_...
  • Use the API key value as the bearer token. Do not paste it into a prompt or share it in a tool call.

Discover tools and use them safely

Run wazi_describe first to see the domains, resources, and fields available to this key. Start with a read before asking the agent to change records.

Read data with wazi_query

Choose a domain and resource returned by wazi_describe, then use wazi_query to read the records the key is allowed to access.

  • Use filters and small result limits when exploring a large resource.
  • If a domain or resource is missing, check that it is included in the API key permissions.

Write only with the required permission

Use wazi_mutate only when a task requires a create, update, or delete operation and the API key has CRUD access to that domain.

  • Review the target and requested changes before writing.
  • Use read-only access if the task only needs information. Add CRUD access only when the agent must change data.

Security and permissions

  • API keys are scoped to a single company. An agent using one company's key can never access another company's data.
  • Each key has a permission list that controls which domains it can read from or write to.
  • The MCP server enforces the same domain permissions and method checks as the web API.
  • Write operations (create, update, delete) require explicit write permission on the domain.
  • Keys can be revoked from API Keys. If permissions need to change, create a replacement key and revoke the old one.

If something goes wrong

Common issues

401 Unauthorized: The API key is invalid, revoked, or missing. Check that the key starts with wz_ and is still active on API Keys.

403 Forbidden: The key is valid but lacks permission for the requested domain or write action. Create a key with the required domain and access level, then revoke the old key.

No resources listed: Run wazi_describe and check the key’s allowed domains. A resource may be outside the key’s scope.

Agent cannot connect: Check the host, /api/mcp path, and Authorization: Bearer wz_... header. The agent must support Streamable HTTP MCP.

Related guides

Keep going