Build with AI

Build a custom CRM with an AI coding agent

Connect Claude Code, Cursor, or another AI coding agent to Workspace369, then ask it to build your own CRM screens on your clients, proposals, and invoices.

View as Markdown

Build a custom CRM on Workspace369 with Claude Code, Cursor, Lovable or ChatGPT: it is the backend (clients, pipeline stages, custom fields, proposals, e-sign, invoices) your AI app reads and writes over MCP or HTTP, so you don't build the backend from scratch. Workspace369 (one word, 369) is a client-work platform with a public MCP server and HTTP API; it is not Workspace 365.

You can ask an AI coding agent to build a custom CRM, client portal, or internal dashboard, and have it use Workspace369 as the system of record. The agent reads and writes your real clients, proposals, contracts, invoices, payments, and bookings through the Workspace369 MCP server. It does not need its own database for those records.

The short version: an admin turns MCP on, you connect the agent with one URL, and you paste a build prompt. Anything the agent wants to send to a client waits for your approval in the Workspace369 app.

Before you begin

You need a Workspace369 workspace. If you don't have one yet, start a free trial. You'll be its owner, so you can do every step below yourself.

  1. A workspace admin must turn MCP on. It is off by default. If you started the trial you are the owner, so you can do this yourself: open Settings, then under AI choose AI connections and turn on Allow AI connections. See Enable MCP and manage connected apps.
  2. MCP and personal access tokens work on every plan; the HTTP Builder API at /v1 is on every paid plan (Cadet and up), including the 14-day trial once the card is saved. Every successful call counts toward the workspace's AI usage, and the free trial starts when you save your card (nothing is charged for 14 days). Until the card is saved, calls are refused.
  3. Decide who the agent acts as. It acts as you, with your permissions, and never more. Give it a view-only connection first if you only want a dashboard.
  4. Decide where the code runs. Anything with a secret in it must run on a server, not in a web page. See Keep tokens on the server.

Connect your coding agent

The server URL is the same for every agent:

https://mcp.workspace369.com/mcp

Claude Code

Add the server, then sign in. In the Workspace369 web or desktop app, Settings → AI → AI connections → Code editors → Copy Claude Code command copies the same command with the core CRM address (/mcp/crm) of the workspace you have open. For this guide, use the command below instead: it has the full address, which the build prompt needs. Both name the server workspace369, so add one or the other.

claude mcp add --transport http workspace369 https://mcp.workspace369.com/mcp
  1. Start Claude Code in your project.
  2. Run /mcp.
  3. Choose workspace369 and follow the browser steps to sign in and pick the workspace.
  4. Approve only the access the project needs.

Add --scope project to share the entry with your team through .mcp.json, or --scope user to use it in every project. Do not put a token in a file you commit.

For a script or a remote agent that cannot open a browser, create a personal access token and pass it as a header:

claude mcp add --transport http workspace369 https://mcp.workspace369.com/mcp \
  --header "Authorization: Bearer $WORKSPACE369_TOKEN"

The app the agent builds needs the same two values. Set them in the environment it runs in:

export WORKSPACE369_TOKEN=mcp_pat_…
export WORKSPACE369_MCP_URL=https://mcp.workspace369.com/mcp   # or your workspace's own address

When you create a token in Workspace369, the Token created screen shows this command ready to paste, with your token and your workspace's own address, https://mcp.workspace369.com/w/<workspace ID>/mcp. It names the server workspace369- plus the first six letters and digits of your workspace ID, so connections to two workspaces don't replace each other. Below it, a second command adds the core CRM address, https://mcp.workspace369.com/w/<workspace ID>/mcp/crm, under the same name followed by -crm. Use it when the agent needs only the core CRM tools; the build prompt below uses the full address. If your app shows only one command, add /crm to the address and -crm to the name yourself. If you use these commands, use their names wherever this page says workspace369. Claude Code saves the header as you typed it, so a token written into the command sits as plain text in your Claude Code settings. Treat that file as a secret, or use the variable form below.

To share a token setup with --scope project, put the header in single quotes: --header 'Authorization: Bearer ${WORKSPACE369_TOKEN}'. Then .mcp.json stores the variable name, not the token, and Claude Code reads the token from your environment when it starts.

If claude mcp list shows workspace369 as "Needs authentication" even though your token is good, an older workspace369 entry from a browser sign-in may be the one in use. Run claude mcp get workspace369 to see which entry that is, and add the token entry under another name, such as workspace369-token.

With --scope project, claude mcp list shows the new server as "Pending approval (run claude to approve)" until you run claude interactively in that folder and approve it. For a headless or CI run that uses claude -p, there is no prompt to answer. To make the run use only the token entry, pass it as a file and add --strict-mcp-config:

claude -p "your prompt" --strict-mcp-config --mcp-config ./workspace369.mcp.json

The file has the same mcpServers shape as .mcp.json, with the header written as Bearer ${WORKSPACE369_TOKEN}. With that flag, Claude Code ignores every other MCP server, including an older sign-in entry named workspace369. See the Claude Code MCP documentation for how project servers are approved.

Cursor, VS Code and Windsurf

In Cursor or VS Code, the quickest way is a button in the Workspace369 web or desktop app. Open Settings, then under AI choose AI connections, and in Code editors click Add to Cursor or Add to VS Code. The editor opens and asks you to confirm, then you sign in. The button adds the core CRM address (/mcp/crm) for the workspace you have open, which is enough to check the connection. The build prompt below also uses payments, contracts and bookings, so for it add the full address (https://mcp.workspace369.com/mcp) as a second server, using the file entry described next.

Windsurf, and Cursor or VS Code if you'd rather edit the file, read an entry from their MCP settings file. The exact entry is in Connect an AI app to your workspace. Save it, then sign in when the app asks.

ChatGPT and Claude

Use the custom connector option in each app and paste the server URL. These apps are good for asking questions about your data and drafting records. Use a coding agent when you want working code. The steps are in Connect an AI app to your workspace.

Check the connection

Ask the agent a read-only question first:

Use the workspace369 tools to tell me which invoices are overdue and which clients have a follow-up due today.

To check the core CRM address (/mcp/crm) with a simpler question, ask instead:

Use the workspace369 tools to list my clients and their pipeline stages.

If it answers with your data, the connection works. If it says the tools are missing, see If something does not work.

Give the agent the build prompt

Paste this into your agent. Edit the first line to describe your business.

The prompt uses payments, contracts and bookings, which are on the full address (https://mcp.workspace369.com/mcp). On the core CRM address (/mcp/crm) those tools aren't there, and the agent shows those parts as unavailable.

I run a [kind of business]. Build a small internal CRM web app for my team.
Use Next.js (App Router) with TypeScript unless I say otherwise. Add unit
tests with mocked tool responses, then run the tests, the type check and the
build, and fix anything that fails before you finish. Then start the app
with my two environment variables set, load each screen once, and fix any
error the server logs.

Use the workspace369 MCP server as the only source of truth for clients,
proposals, contracts, invoices, payments, and bookings. Do not create your
own tables for these records.

First, list the available workspace369 tools and read the descriptions of the
ones you plan to use.

Step 0, before any code: call workspace_schema to see my current pipeline
stages and client fields. Propose the stages and custom fields my kind of
business needs, then call crm_apply_blueprint with dry_run true and show me
the preview. Apply it with dry_run false only after I say yes. It keeps what
already exists and deletes nothing. Then plan the screens.

Screens:
1. Client list with search and a "follow up today" filter, with a header
   from pipeline_summary: clients per stage, new and stalled clients.
2. Client page with contact details, open proposals, invoices, payments, and
   notes, and its next follow-up from follow_ups_list, with buttons to
   schedule one (follow_ups_create) and mark it done (follow_ups_complete).
3. A "new client" form.

Rules:
- Read data through the tools, from server code only.
- Never put an access token in browser code, logs, or the repository. Read
  the token from the WORKSPACE369_TOKEN environment variable and the server
  URL from WORKSPACE369_MCP_URL, on the server only. Don't search config
  files for either.
- If a tool you need isn't in the list, show that part as unavailable. Don't
  guess how it works.
- Do not send anything to a client directly. For sends, create the draft and
  tell me it is waiting for my approval in Workspace369.
- Handle errors: a refused call returns an error result with a reason, and a
  rate-limited call returns 429 with a Retry-After header.
- Run it on my computer for now. Tell me what to add before my team uses it
  over a network, such as sign-in and hosting.

More prompts, including proposals with deposits and importing contacts, are in Prompts and AGENTS.md for coding agents.

Keep tokens on the server

A web page that runs in a visitor's browser cannot hold a secret. Anything in it can be read.

  • Put your Workspace369 connection in server code: an API route, a backend function, or a script. Your pages call that code, and that code calls Workspace369. See Call Workspace369 from your app over HTTPS.
  • Store a personal access token in an environment variable or a secret manager. Never commit it.
  • Create the token with only the scopes the app needs. A dashboard needs view scopes only. For the build prompt above, that is view access for Clients, Notes, Proposals, Contracts, Invoices (which covers payments) and Calendar (which covers bookings), plus edit access for Clients for the new-client form, the follow-up buttons and the pipeline setup in step 0. Setting up stages also needs permission to manage stages, and adding fields needs permission to edit business details; the workspace owner has both. A call outside the token's scopes is refused with "Insufficient scope", even though the tool still appears in the tool list.
  • Every successful call counts toward the workspace's AI usage, and one page load can make several calls. Ask the agent to cache the workspace schema between requests.
  • Revoke the token when the project ends. Rotation steps are in Personal access tokens.
  • The MCP server only accepts browser requests from a short list of AI app websites. A call made from your own page code is refused with a 403.

What waits for your approval

Calls that send something to a person, or that change something a person relies on, are held. The agent gets a link, and nothing is sent until you approve it in the Workspace369 app. That covers sending invoices, proposals, and contracts, replying to leads, and sending messages. The full list is in How MCP access is controlled and billed.

You can turn on Send without asking for a connection you trust. Keep it off while the agent is still being built and tested.

What the agent cannot do

  • It cannot delete clients, invoices, proposals, projects, tasks, or events.
  • It cannot invite or remove team members or change permissions.
  • It cannot create, edit, or turn on a workflow. It can list, read, test, and turn off workflows.
  • It cannot delete pipeline stages or custom fields, or rename or change the type of an existing custom field. It can set up your pipeline and custom fields with crm_apply_blueprint, add stages and fields, rename or move a stage with client_stages_update, fill in field values and move clients between stages.
  • It cannot read or write anything outside the one workspace it is connected to.

Every call is recorded in the activity log, and each successful call counts toward the workspace's AI usage (a send counts more than a read). See How MCP access is controlled and billed.

Keep it fast

Every tool call is a round trip to Workspace369: it checks your access, runs the tool and logs the call. So how many calls a screen makes matters more than which tools it uses. Measured in October 2026 from one computer, a typical read took just under a second. The first call after about ten quiet minutes was slower, about 1.5 to 2 seconds, while the server woke up.

  • Read lists in one call. Use clients_search or invoices_search with their filters, such as stage and tags for clients or status and clientId for invoices, and a limit of up to 100. Follow nextCursor for the next page. Ten clients_get calls in a row take several seconds; one clients_search with a limit of 10 takes under one.
  • Keep one connection open. Create the MCP client once when your server code starts and reuse it for every request. Connecting again for each page repeats the setup and the tool list before any data comes back.
  • Cache what your screens show often. Keep the workspace schema and a client list in server memory for a minute or two instead of reading them on every page load.
  • Point read-heavy apps at /mcp/crm. Calls aren't faster there, but its tool list is much smaller, so the agent has less to read and fewer tools to choose from. See Connect the core CRM toolset.
  • Show a loading state. Give the first screen a placeholder while its data loads, so a slow first call looks like loading, not like a broken page.

Next steps

Was this article useful?

Mark whether this guide was useful on this device.