Implementing MCP Remote Server for CRM Agent Integration

hubspot · Tech · 2025 · source Agentic: yes · promotional bias: med · source-backed · extracted with prompt 0.5.6 (schema v2)

Generated from extraction.json — do not edit by hand. Every claim cites verbatim source evidence; stated means the quote directly asserts the claim, implied means it supports it indirectly.

Problem

Domain: Remote MCP server for CRM agent integration

HubSpot needed a secure, low-friction way for AI agents such as ChatGPT to query CRM data across contacts, companies, and deals for non-technical users, while working within HubSpot's Java/RPC/microservices stack, honoring OAuth scopes and seat permissions, and navigating an emerging MCP ecosystem with incomplete auth and transport standards.

Constraints:

Architecture

HubSpot built a remote MCP server as a stateless Dropwizard microservice in its Java stack. The service extends the Java MCP SDK for streamable HTTP transport, exposes HubSpot CRM search APIs and RPC methods as MCP tools through annotations, maps OAuth 2.0 scopes to HubSpot seat tiers and user permissions, and provides read-only CRM search/fetch capabilities to OpenAI's ChatGPT connector. HubSpot also built an MCP gateway that auto-discovers tools across services and used Claude Code to generate schemas and templated tool descriptions from the emerging spec. The initial product path emphasizes instant connection for non-technical ChatGPT users rather than local desktop/NPM setup.

Diagram confidence: explicit (topology described by the source).

flowchart LR
  ChatGPT_connector["ChatGPT connector"] --> OAuth_2_0_flow["OAuth 2.0 flow"]
  ChatGPT_connector --> Remote_MCP_server["Remote MCP server"]
  OAuth_2_0_flow --> Permission_mapper["Permission mapper"]
  Permission_mapper --> CRM_search_API["CRM search API"]
  Remote_MCP_server --> Java_MCP_SDK_extension["Java MCP SDK extension"]
  Remote_MCP_server --> Dropwizard_microservice["Dropwizard microservice"]
  Remote_MCP_server --> Streamable_HTTP_transport["Streamable HTTP transport"]
  Remote_MCP_server --> CRM_search_API
  Remote_MCP_server --> MCP_gateway["MCP gateway"]
  Dropwizard_microservice --> Existing_RPC_system["Existing RPC system"]
  Existing_RPC_system --> Annotation_system["Annotation system"]
  Annotation_system --> MCP_gateway
  Annotation_system --> Claude_Code_schema_generation["Claude Code schema generation"]
  Java_MCP_SDK_extension --> Open_source_Java_MCP_SDK["Open source Java MCP SDK"]
  Java_MCP_SDK_extension --> Claude_Code_schema_generation
  CRM_search_API --> CRM_data["CRM data"]
  MCP_gateway --> MCP_clients["MCP clients"]
  MCP_clients --> Breeze_Assistant["Breeze Assistant"]
  MCP_clients --> Discovery_and_registry_service["Discovery and registry service"]
  Breeze_Assistant --> Project_management_tools["Project management tools"]
Drag to pan · scroll or use +/− to zoom · reconstructed from the source's described component topology

Components

Component Role Interacts with
ChatGPT connector OpenAI connector interface that lets ChatGPT users access HubSpot CRM data through MCP search/fetch. Remote MCP server, OAuth 2.0 flow, CRM search API
Remote MCP server HubSpot's stateless MCP microservice exposing CRM data and tools to AI agents. ChatGPT connector, Java MCP SDK extension, Dropwizard microservice, OAuth 2.0 flow, CRM search API, MCP gateway
Java MCP SDK extension Extended SDK support for streamable HTTP transport and HubSpot production needs. Remote MCP server, Open source Java MCP SDK, Claude Code schema generation
Dropwizard microservice HubSpot's standard Java microservice runtime for the remote MCP server. Remote MCP server, Existing RPC system
Streamable HTTP transport Remote MCP transport implemented for short-lived stateless HTTP requests. Remote MCP server, ChatGPT connector
OAuth 2.0 flow Authentication path used by the OpenAI connector and mapped to HubSpot permissions. ChatGPT connector, Permission mapper, Remote MCP server
Permission mapper Maps OAuth scopes to HubSpot seats, tiers, and user permissions. OAuth 2.0 flow, CRM search API
CRM search API Existing REST API surface for contacts, companies, deals, and CRM object queries. Remote MCP server, Permission mapper, CRM data
Existing RPC system HubSpot enterprise RPC system that the MCP implementation needed to fit. Dropwizard microservice, Annotation system
Annotation system Java annotation layer describing RPC methods as MCP tools and tool specifications. Existing RPC system, Claude Code schema generation, MCP gateway
MCP gateway Gateway that auto-discovers tools across services and centralizes MCP capabilities. Remote MCP server, Annotation system, MCP clients
MCP clients HubSpot agents and clients that discover and call verified MCP servers as tools. MCP gateway, Breeze Assistant, Discovery and registry service
Breeze Assistant HubSpot AI assistant expected to use MCP clients to discover tools and operate across systems. MCP clients, Project management tools
Discovery and registry service Planned/active client-side registry for verified secure MCP servers. MCP clients, Breeze Assistant
Claude Code schema generation AI-assisted development workflow that generated templated schemas and tool descriptions from the spec. Java MCP SDK extension, Annotation system
Open source Java MCP SDK Upstream SDK receiving HubSpot's extensions and learnings. Java MCP SDK extension
CRM data Customer CRM objects such as contacts, companies, deals, test/demo data, and conversion information. CRM search API
Project management tools External tools such as Asana that agents may save workflow outputs back into. Breeze Assistant

Data flow

A ChatGPT user connects the HubSpot connector through OAuth 2.0. The remote MCP server receives search/fetch style MCP requests over streamable HTTP, checks the user's HubSpot scopes, seats, tiers, and permissions, and maps requests onto existing CRM search APIs and Java RPC methods exposed through the annotation system. Read-only results for contacts, companies, deals, and related CRM objects return to the AI agent for analysis. Internally, developers use Claude Code and the Java MCP SDK extensions to generate schemas/tool descriptions, while HubSpot contributes the SDK work back to open source.

3 supporting quotes
“One exposes our core raw APIs, our CRM search API with contacts, companies, and deals. It's built on top of our existing REST APIs.”article, stated
“we needed to add the OAuth scope, and then the user permissions that were mapped to our HubSpot seat and tiers.”article, stated
“Those customers aren't necessarily developers or technical, and we wanted it to connect instantly. Which is why we built it that way.”article, stated

Why this architecture

HubSpot built instead of buying because the connector had to move at AI speed, integrate with existing enterprise RPC and Java infrastructure, support OAuth permissions, and offer instant connection to non-technical ChatGPT users. Stateless short-lived HTTP requests reduced scaling risk for the first read-only version, while read-only scope lowered the danger of agents corrupting CRM data.

3 supporting quotes
“we built this connector with OpenAI in four weeks. Or in less than four weeks. And, to move kind of AI speed”article, stated
“Because we needed it to work with our existing enterprise RPC system. So when we looked at it, we said, there are a couple of different options.”article, stated
“It's stateless. So the first version is read only, and then it's also stateless.”article, stated

Models used: ChatGPT · Claude Code · Breeze Assistant · Lovable · V0

Scale

Alternatives considered (roads not taken)

Buy an off-the-shelf MCP server product

Rejected because: HubSpot judged that vendor approval, RPC integration, auth requirements, and custom HTTP streaming needs made building faster and easier.

“We can do something off the shelf. We can get vendor approvals, everything it needs, does it work with everything that we need? Or we can build.”article, stated
“we decided that the things that we needed, it would have been faster and easier to build.”article, stated

Use local desktop MCP setup

Rejected because: Local MCP servers require NPM/package installation and desktop client configuration, which would not work for non-technical ChatGPT users at consumer scale.

“you need to usually do NPM package. You have to install it to your local desktop, and then you have to teach the desktop client, like, how to connect.”article, stated
“Those customers aren't necessarily developers or technical, and we wanted it to connect instantly.”article, stated

Long-running server-sent event connections

Rejected because: HubSpot chose short-lived HTTP requests because long-lived connections were harder to manage at scale and less aligned with their stack.

“are we going to have long-ranging server-event connections, which were a little bit harder to manage at scale?”article, stated
“should we do this for short-lived kind of, like, HTTP requests? That's the way that our stack is built today, so that's the route that we went.”article, stated

Initial read-write CRM agent

Rejected because: HubSpot kept the first version read-only because write access requires permissions, user intent, validation, and data-quality safeguards.

“The initial deployment was deliberately read-only. This conservative approach provided several benefits:”summary, stated
“we know, for instance, that CRM data is not always in the best shape.”article, stated

Treat MCP as fully mature and uniform

Rejected because: HubSpot encountered incomplete auth, evolving specs, OpenAI-specific search/fetch behavior, and implementation inconsistencies such as casing conventions.

“it is very much still evolving. We actually have two remote MCP servers and then one local server in play.”article, stated
“even Snake case or Camel case, it's not consistent across all of the MCP server implementations.”article, stated

Patterns

tool-use-orchestration (agent-architecture)

The remote MCP server exposes CRM search/fetch tools and CRM objects to agents through a standardized protocol.

“if we lived in a world of robots and this was the language they speak, APIs were the language they used to speak. And in the AI world, MCP is the way you speak.”article, stated
“of the CRM objects you have, do you know how to query it? Do you know how to return something?”article, stated

safety-policy-enforcement (governance)

HubSpot maps OAuth scopes to seats and permissions and starts with read-only access to reduce risk from agents modifying CRM data.

“we needed to add the OAuth scope, and then the user permissions that were mapped to our HubSpot seat and tiers.”article, stated
“The initial deployment was deliberately read-only. This conservative approach provided several benefits:”summary, stated

structured-output-contract (quality)

HubSpot generated schemas, tool descriptions, and annotation-backed MCP tool specifications so Java RPC methods could be exposed consistently.

“We actually ended up using things like Claude Code to generate all of the pieces we needed in the first spec we had from that spec.”article, stated
“we essentially created an annotation system for MCP tools. So it was easier to describe these RPC Java methods.”article, stated

model-routing (serving)

HubSpot runs multiple MCP server variants for different connector and API surfaces, including OpenAI-specific search/fetch and core raw CRM APIs.

“We actually have two remote MCP servers and then one local server in play. They are slightly different versions.”article, stated
“The other one that we used for the connector is a MCP spec that's specific to OpenAI, that has a search and fetch component.”article, stated

human-in-the-loop-gate (governance)

HubSpot frames AI tools as augmenting domain experts and engineers rather than replacing human judgment, especially when debugging or specifying complex behavior.

“I definitely see still a human in the loop, in that you're still, like, a domain expert on like, what you want it to do.”article, stated
“you have to kind of know what you're doing and ask for what you needed to get generated.”article, stated

eval-driven-development (quality)

HubSpot evaluated build-vs-buy options, protocol specs, auth capabilities, and production scaling constraints before choosing the remote-server design.

“we looked at a whole bunch of different evaluations, build and buy, and we decided that the things that we needed, it would have been faster and easier to build.”article, stated
“We supported 2.0. So luckily it all kind of worked out, but that was another factor. We had to think about the auth capabilities we needed.”article, stated

Tradeoffs

Build remote MCP server in-house

Chose custom Java/Dropwizard implementation extending the Java MCP SDK over off-the-shelf MCP server products.

Rationale: HubSpot needed speed, enterprise RPC integration, custom auth, and streamable HTTP support, and judged building faster than vendor approval/customization.

“to move kind of AI speed, you know, we're the first CRM connector to do this.”article, stated
“we could extend the Java MCP SDK to do things like HTTP streaming protocols. And then we said, okay, well, if that's open source, do we contribute back”article, stated

Remote connector UX

Chose instant ChatGPT connector for non-technical users over local MCP server setup requiring NPM and desktop configuration.

Rationale: Most target users are CRM users rather than developers, so the connector needed to work without local technical setup.

“you need to usually do NPM package. You have to install it to your local desktop, and then you have to teach the desktop client, like, how to connect.”article, stated
“Those customers aren't necessarily developers or technical, and we wanted it to connect instantly.”article, stated

Stateless short-lived HTTP

Chose short-lived stateless HTTP requests over long-lived server-event connections.

Rationale: The short-request design fit HubSpot's existing stack and avoided scale/connection-management concerns.

“should we do this for short-lived kind of, like, HTTP requests? That's the way that our stack is built today, so that's the route that we went.”article, stated

Read-only first version

Chose read-only CRM queries over agent write operations against CRM data.

Rationale: Read-only access reduces risk, simplifies scale, and avoids premature write-permission/data-quality hazards.

“The initial deployment was deliberately read-only.”summary, stated
“that is something that we're being really thoughtful about when and how we do, because it's easier with read only.”article, stated

Open-source SDK contribution

Chose feed Java MCP SDK extensions and learnings back upstream over keeping all implementation work private.

Rationale: Open standards and shared SDK improvements accelerated HubSpot's own work and benefit the broader ecosystem.

“We're feeding it back into the Java MCP SDK. And then we have partnerships with, like, Anthropic and OpenAI.”article, stated
“we probably wouldn't have been able to build this connector in four weeks if there wasn't in a Java MCP SDK, and one that we could contribute back into.”article, stated

Gotchas (what bit them)

MCP was still early enough that auth and conventions were incomplete.

Root cause: The protocol was emerging, with OpenAI-specific features, OAuth-version differences, and inconsistent casing across implementations.

Resolution: Implement the required auth/scoping pieces, support OpenAI's MCP variant, and expect custom extensions while contributing learnings back.

“One of the big pieces that was missing in MCP, kind of just natively, is like, how to think about auth.”article, stated
“The current MCP spec that Anthropic has out supports OAuth 2.1. The ChatGPT one, which was a new spec protocol that had not been released yet, could support OAuth 2.0.”article, stated

Remote MCP is harder than local MCP.

Root cause: Remote servers require microservice architecture, transport choices, stateless/stateful decisions, auth, and scale planning.

Resolution: Use a Dropwizard microservice, short-lived stateless HTTP requests, and SDK extensions for streamable HTTP.

“The MCP implementation is pretty trivial. So, I will say that I was mentioning kind of, when we decided to go MCP and just to put more weight behind it”article, stated
“We used something that was called, like, a Dropwizard microservice. That's how we ended up implementing it.”article, stated

Long-lived connections are harder to operate at scale.

Root cause: Server-sent/event-style connections introduce traffic-dependent connection management concerns.

Resolution: HubSpot chose stateless short-lived HTTP requests aligned with its current stack.

“long-ranging server-event connections, which were a little bit harder to manage at scale?”article, stated
“We built it with these kind of short HTTP calls. It's stateless. So the first version is read only, and then it's also stateless.”article, stated

Write access to CRM data is much riskier than read-only analysis.

Root cause: Even authorized users may not know what they are doing, and CRM data may already be inconsistent or low quality.

Resolution: Start with read-only queries and defer write operations until additional permission and validation safeguards are designed.

“We expect a world where you probably get to write for the kinds of things that you can do. But then that matters a lot.”article, stated
“Changing the CRM data. You know, there's kind of a magic to it. Like we know, for instance, that CRM data is not always in the best shape.”article, stated

Agent tool ecosystems need discovery and trust, not just many servers.

Root cause: There are many MCP servers, and it is hard to know which are verified, high quality, or security-conscious.

Resolution: Build discovery and registry services so clients find verified secure MCP servers.

“there are a million MCP servers. And it's sometimes hard to know which ones are verified, which ones are great, which ones think in terms of security.”article, stated
“it's sometimes hard to know which ones are verified, which ones are great, which ones think in terms of security. And so our client work is doing discovery and registry service.”article, stated

AI-assisted code generation still requires domain and debugging expertise.

Root cause: Code agents can accelerate templating and micro changes but still struggle when bugs accumulate or the developer lacks context.

Resolution: Use AI as an Iron-Man-suit style accelerator with humans controlling specs, domain judgment, and debugging.

“it's much closer to the Iron Man suits in Iron Man than it is in like totally autonomous”article, stated
“once you hit a bunch of bugs or, like, your code stops working, you have to revert or it's still, like, a pain.”article, stated

Evaluation

The source does not describe a formal benchmark. Evaluation is described through build-vs-buy analysis, compatibility with HubSpot's RPC/Java stack, OAuth/permission requirements, production load observation, SDK prototyping, and product usage: the read-only stateless connector reportedly had no load or server issues and was already delivering value to many customers.

Metrics: 75% of HubSpot customers use ChatGPT · less than four-week connector build · 500 million weekly ChatGPT customers/users · two remote MCP servers and one local server in play · over 100 HubSpot MCP implementations made by others · 70-80% internal adoption of AI coding tools among engineers · no load or server issues reported for stateless read-only version · OpenAI connector supports OAuth 2.0 while Anthropic MCP spec supports OAuth 2.1

3 supporting quotes
“We haven't. We built it with these kind of short HTTP calls. It's stateless.”article, stated
“So because of that, we don't have any load or server issues. There's these very short-lived requests.”article, stated
“we have a ton of customers currently getting value and using that connector right now.”article, stated

Outcomes

This is a strong production MCP case because it connects standardization, product UX, security, and operational scale. The read-only scope is a deliberate limitation, not a missing feature: it makes first deployment safer while the protocol, auth model, and write safeguards mature.

3 supporting quotes
“we are the first CRM with an MCP server, and the first CRM with a connector to open AI.”article, stated
“Those customers aren't necessarily developers or technical, and we wanted it to connect instantly.”article, stated
“So we haven't seen any issues with that as well.”article, stated