MCP Server Development: Letting Claude Work Your CRM
How to design, secure and ship a remote MCP server so Claude can safely read and update your CRM data, based on a production build for a real-estate CRM.
MCP server development is the fastest way I know to make an existing business product usable from inside Claude. Instead of building a chatbot into your app, you expose a set of tools, and the assistant your team already uses can look up leads, summarize a pipeline or log a follow-up on their behalf.
I built a remote MCP server with OAuth for Antoc, a real-estate CRM used by 100+ firms in India with roughly 300K leads under management. This post covers what I learned about designing the tools, securing them and keeping the model from doing something dumb with real customer data.
TL;DR
An MCP server wraps your product's capabilities as typed tools that Claude can discover and call. For a SaaS product, build a remote server, authenticate users with OAuth, and scope every tool to the caller's business and role. Keep the tool list short, write descriptions for the model, start read-only, and add write tools gradually with validation and logging.
key takeaways
- MCP server development is mostly API design: a small set of well-named, well-described tools beats a mirror of your entire REST API.
- A remote MCP server needs real OAuth so each user's assistant acts with that user's permissions, not a shared admin key.
- Every write tool should validate inputs, scope to the caller's business, and return a short human-readable result the model can relay.
- Start read-only, watch real usage, then add write tools one at a time with clear confirmations.
What an MCP server actually does
The Model Context Protocol defines how an AI client discovers and calls capabilities on a server. Your server advertises tools, each with a name, a description and a JSON schema for its arguments. The client shows those tools to the model, the model decides when to call one, and your server runs the real logic and returns a result.
That makes the server a translation layer. It does not hold intelligence; it holds your business rules. The model handles intent ("which of my leads from last week haven't been called?"), and your server turns that into a scoped database query that respects permissions.
Local vs remote
There are two deployment shapes, and they serve different buyers.
| Shape | Transport | Auth | Best for |
|---|---|---|---|
| Local | stdio, runs on the user's machine | Usually an API key in config | Developer tools, personal scripts |
| Remote | HTTP, hosted by you | OAuth per user | SaaS products, non-technical teams |
For a CRM used by sales managers, local is a non-starter. Nobody in a real-estate office is editing a JSON config file. A remote server lets them add a connector, sign in with their normal account, and start asking questions.
Designing tools the model can use well
The biggest mistake in MCP server development is exposing every endpoint you have. Models pick tools based on names and descriptions, and a list of 60 near-identical tools leads to wrong picks and wasted tokens.
I design tools around jobs, not tables. A good starting set for a CRM looks like this:
search_leads— filter by stage, source, assignee, date range, with a hard limit on results.get_lead— full detail for one lead, including recent activity.pipeline_summary— counts by stage for a period, so the model does not page through thousands of rows to answer "how is this month going?"list_followups_due— what needs attention today.add_note— append a note to a lead.update_lead_stage— move a lead to a named stage, validated against the business's pipeline.
Notice what is missing: no generic update_lead that takes arbitrary fields, no delete. Narrow write tools are easier to reason about and easier to audit.
Write descriptions for the model, not for humans
A tool description is a prompt. I include when to use it, when not to, and what the arguments mean in business terms. For example, the stage tool's description lists that stage names are per business and tells the model to call pipeline_summary first if it does not know the valid stages.
Return values matter too. Instead of dumping raw documents, return compact objects with the fields a person would care about, plus IDs for follow-up calls. Smaller payloads mean faster responses and fewer hallucinated details.
Auth, tenancy and guardrails
This is where a demo becomes a product. The MCP spec includes an authorization flow based on OAuth, and for a multi-tenant SaaS you want it.
The flow I use:
- The user adds the connector in Claude and is redirected to your login page.
- They sign in with their existing credentials and approve access.
- Your server issues a token tied to that user and their active business.
- Every tool call resolves the token to a user, business and role before touching data.
That last step is the important one. Antoc supports multi-business organization switching, so a single person can belong to several businesses. The token must carry which business is active, and every query must filter by it. I never accept a business ID as a tool argument from the model.
Guardrails worth having on day one
- Permission parity: if a staff member cannot see a report in the app, the MCP tool should not return it either.
- Plan checks: Antoc has plan-based feature locking, so tools respect the same feature flags as the UI.
- Argument validation: reject unknown stages, malformed dates and oversized limits before hitting the database.
- Audit logging: record which user, through which client, called which tool with which arguments.
- Rate limits: models can loop. Cap calls per user per minute.
How I built this in practice
Antoc's backend is Node/Express on MongoDB with Mongoose, running on GCP VMs in asia-south1 behind Nginx with PM2. I built the remote MCP server with the official MCP SDK so it shares models and business logic with the main API rather than duplicating them. The OAuth layer plugs into the existing account system, so users connect Claude with the same login they use for the web app.
Because the database had already been hardened as leads grew past 300K, with proper indexes and safe bulk operations that validate filters, the MCP tools could run real queries without risking full-collection scans or unscoped updates. That groundwork mattered more than any prompt. A tool that accidentally runs an update without a business filter is a disaster whether a human or a model triggered it.
The result is that a business owner can ask Claude about their pipeline, pull up a lead before a call, or log a note, and it all lands in the same CRM their team sees. You can read more about the wider product in the Antoc case study.
Common mistakes
- Mirroring the full REST API as tools, which confuses the model and bloats context.
- Using one shared API key for every user, so the assistant sees data the user should not.
- Letting the model pass tenant or business IDs as arguments instead of deriving them from the token.
- Returning huge raw documents when a compact summary would answer the question.
- Shipping write tools before observing how people actually use the read tools.
- Skipping audit logs, then having no way to explain who changed a record and how.
keep reading
FAQ
What is an MCP server in plain terms?+
An MCP server is a small service that exposes your software's actions and data as tools an AI assistant like Claude can call. It follows the Model Context Protocol, so any compatible client can discover the tools, read their descriptions and call them with structured arguments.
How long does MCP server development take for an existing product?+
If your product already has a clean API and auth system, a focused read-only MCP server can be built in one to two weeks. Adding OAuth, write tools, multi-tenant scoping and proper logging typically takes another two to four weeks depending on how many tools you need.
Is it safe to let Claude write to my CRM?+
It can be, if the server enforces the same permissions as your app, validates every argument and scopes every query to the authenticated business. I also recommend starting read-only and adding write tools with narrow, explicit purposes rather than a generic update endpoint.
Do I need a remote MCP server or a local one?+
Local servers suit developer tools that run on one machine. For a SaaS product where customers use Claude on the web or desktop, a remote MCP server with OAuth is the right choice because users connect with their own account and nothing has to be installed.
Devang Gandhi
AI & full stack developer at Passdn, building CRMs, SaaS, AI agents and Flutter apps for clients in the US, UK, Australia, UAE and India. More about me