I am trying to use the@hubspot/mcp-server(v0.4.0) with the PythonagentsSDK. 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-serveris incorrectly returning an emptytools: {}capability during the initialinitializehandshake, even though it can respond to a directtools/listrequest 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 thesupergatewayapproach as described in the official documentation. My HubSpot token has all the requiredcrm.objects.contacts.*andcrm.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 theagentsSDK 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.
The client connects successfully: [supergateway] New SSE connection from ::ffff:172.17.0.1
The client sends theinitializerequest: [supergateway] SSE → Child: {"jsonrpc":"2.0","id":0,"method":"initialize", ...}
The@hubspot/mcp-serversends back a faulty response:
The crucial part iscapabilities: { tools: {} }. By returning an emptytoolsobject, the server is incorrectly signaling that it has no tool capabilities. Theagents-pythonSDK correctly interprets this and concludes there are no tools to discover. The logs later show a successful response to atools/listcall, but by then the client has already decided there are no tools based on the initialinitializeresponse.
My Questions:
Is this a known issue or bug in the@hubspot/mcp-server(v0.4.0) public beta?
Is there a different way I should be running the server or configuring the client to work around thisinitializebehavior?
Does theagents-pythonSDK have an option to "force" tool discovery viatools/list, even if the server's initial capabilities handshake is incomplete?