Failing to Discover Tools from @hubspot/mcp-server with OpenAI Agents SDK

LMunni
Member

Hello everyone,

I am trying to use the @hubspot/mcp-server (v0.4.0) with the Python agents SDK. I've managed to resolve all connection and authentication issues, but I've hit a wall where the agent fails to discover any tools from the server.

Log analysis strongly suggests that the @hubspot/mcp-server is incorrectly returning an empty tools: {} capability during the initial initialize handshake, even though it can respond to a direct tools/list request later.

My Goal:
To create a simple Python agent that can connect to the HubSpot MCP server and use its tools to interact with my HubSpot contacts (e.g., get a contact by ID).

My Setup:

1. Server Command:
I am running the server using the supergateway approach as described in the official documentation. My HubSpot token has all the required crm.objects.contacts.* and crm.schemas.contacts.* scopes.

# My HubSpot token is set in the $env:HUBSPOT_TOKEN variable
docker run -d `
  --name hubspot-mcp `
  -p 8081:8000 `
  -e PRIVATE_APP_ACCESS_TOKEN=$env:HUBSPOT_TOKEN `
  supercorp/supergateway `
  --oauth2Bearer "my-super-secret-key-123" `
  --stdio "npx -y @hubspot/mcp-server"

2. Python Client Code (for diagnostics):
To isolate the issue, I'm using the following script to connect and simply list the tools discovered by the agent.

import asyncio
import json
from agents import Agent
from agents.mcp import MCPServerSse

async def main():
    GATEWAY_SECRET_KEY = "my-super-secret-key-123"

    async with MCPServerSse(
        name="HubSpot MCP Server",
        params={
            "url": "http://127.0.0.1:8081/sse",
            "headers": {
                "Authorization": f"Bearer {GATEWAY_SECRET_KEY}"
            }
        }
    ) as server:
        print("\n[DIAGNOSTIC] Successfully connected to the server.")
        
        agent = Agent(name="Tool Inspector", mcp_servers=[server])

        if not agent.tools:
            print("[DIAGNOSTIC] Agent did not discover any tools from the server.")
            return

        print(f"[DIAGNOSTIC] Agent discovered {len(agent.tools)} tools.")
        tool_schemas = [tool.oai_schema for tool in agent.tools]
        print(json.dumps(tool_schemas, indent=2))

if __name__ == "__main__":
    asyncio.run(main())

The Problem:

When I run my Python script, the output is consistently:

[DIAGNOSTIC] Successfully connected to the server.
[DIAGNOSTIC] Agent did not discover any tools from the server.

This shows the connection is succeeding, but the agents SDK isn't finding any tools.

Log Analysis (The Evidence):

I've inspected the logs from the Docker container (docker logs hubspot-mcp), and I can see the communication sequence. The logs confirm that the problem is in the server's response to the initial handshake.

  1. The client connects successfully:
    [supergateway] New SSE connection from ::ffff:172.17.0.1

  2. The client sends the initialize request:
    [supergateway] SSE → Child: {"jsonrpc":"2.0","id":0,"method":"initialize", ...}

  3. The @hubspot/mcp-server sends back a faulty response:

    [supergateway] Child → SSE: {
      result: {
        protocolVersion: '2025-06-18',
        capabilities: { tools: {}, prompts: {}, resources: {} },
        serverInfo: { name: 'hubspot-mcp-server', version: '0.4.0' }
      },
      jsonrpc: '2.0',
      id: 0
    }

The crucial part is capabilities: { tools: {} }. By returning an empty tools object, the server is incorrectly signaling that it has no tool capabilities. The agents-python SDK correctly interprets this and concludes there are no tools to discover. The logs later show a successful response to a tools/list call, but by then the client has already decided there are no tools based on the initial initialize response.

My Questions:

  1. Is this a known issue or bug in the @hubspot/mcp-server (v0.4.0) public beta?
  2. Is there a different way I should be running the server or configuring the client to work around this initialize behavior?
  3. Does the agents-python SDK have an option to "force" tool discovery via tools/list, even if the server's initial capabilities handshake is incomplete?

Thank you for any help or insight you can provide

1 Accepted solution
BérangèreL
Solution
Community Manager
Community Manager

Hi @LMunni, @BWolfson, I wanted to check in on you, are you still experiencing the same behavior?

If you do, can you please submit it via the HubSpot Developer Feedback form so that the right Team can take a look at it.

Thanks and have a lovely day!
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




View solution in original post

0 Upvotes
3 Replies 3
BérangèreL
Community Manager
Community Manager

Hi @LMunni, @BWolfson and welcome, we are delighted to see you here!

Thanks for reaching out to the HubSpot Community!

I am not aware of a current bug at the moment but I'll keep my eyes open and let you know if I hear about that.

I'd love to put you in touch with our Top Experts and Community Member: Hi @Anton, @sylvain_tirreau, @zach_threadint, @Parvind, @LloydSilverCT, @FilipeMendes, @JamesonC, @syd8, @Bjb, @Cbshipley, @umerfaisal do you have suggestions to help @LMunni and @BWolfson, please?

Have a great day and thanks so much in advance!
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes
BérangèreL
Solution
Community Manager
Community Manager

Hi @LMunni, @BWolfson, I wanted to check in on you, are you still experiencing the same behavior?

If you do, can you please submit it via the HubSpot Developer Feedback form so that the right Team can take a look at it.

Thanks and have a lovely day!
Bérangère





loop


Loop Marketing is a new four-stage approach that combines AI efficiency and human authenticity to drive growth.

Learn More




0 Upvotes
BWolfson
Participant

I have a similar use case, so subscribing to this as well

0 Upvotes