Skip to main content

MCP Setup

The Hubify MCP server gives Claude Code (and any MCP-compatible AI) direct access to your lab — read experiments, create tasks, log events, update papers, and more. All 48 tools work without a browser login for read and write operations.

Prerequisites

Install the Hubify CLI (which includes the MCP server):
The hubify mcp subcommand requires hubify-labs 2.0.0 or later. Run hubify --version to confirm your installed version. If you see 1.x, run npm install -g hubify-labs again to upgrade.
Verify the MCP server is on your PATH:

Configuration

Claude Code (global — all sessions)

Add to ~/.claude/mcp.json (create if it doesn’t exist):
Find your CONVEX_URL in the Hubify web app under Settings → Developer. Your lab slug is in the URL when viewing your lab (hubify.com/app/labs/your-lab-slug).

Claude Code (project-level)

To scope the MCP to a specific project directory, add .mcp.json at the project root:
Claude Code loads project-level .mcp.json automatically when you open that directory.

Cursor

Add to .cursor/mcp.json in your project:

Environment Variables

* Either HUBIFY_LAB_SLUG or HUBIFY_LAB_ID is required to target a specific lab. Without one, the server falls back to the first lab on the deployment.

Verifying Setup

Run the health check before using the MCP in a session:
Expected output:

Switching Labs Mid-Session

You don’t need to restart Claude Code to switch labs. Use the lab_switch tool:
The switch persists for the rest of that session. The next session resets to the env-configured default.

Testing Your Setup

Once configured, open a new Claude Code session and run through these scenarios to confirm everything works.

Scenario 1: Read lab state

Ask Claude Code:
“Load my Hubify lab context and give me a summary of what’s going on”
Claude should call hubify_get_context_pack and return a snapshot showing your experiments, papers, and recent events. No auth needed.

Scenario 2: Create a task

Ask Claude Code:
“Create a task to run novelty scoring on all papers, priority high”
Claude should call task_create and return a task ID. Open the web app → your lab → Tasks to confirm it appeared.

Scenario 3: Log a research event

Ask Claude Code:
“Log an event that we just finished reviewing the anomaly catalog paper”
Claude should call hubify_log_event with type paper.reviewed. Open the web app → Activity to see it in the feed.

Scenario 4: Search memory

Ask Claude Code:
“What does the lab know about NANOGrav?”
Claude should call memory_search and knowledge_search, then summarize what the lab has stored about that topic.

Scenario 5: Session summary at wrap-up

At the end of a work session, ask:
“Save a summary of what we did today to the lab”
Claude should call hubify_create_session_summary. This persists to the agentEvents ledger so future sessions can see what ran.

Adding MCP Context to Your Project CLAUDE.md

For projects where you always want Claude to use Hubify tools, add this to the project’s CLAUDE.md:

Troubleshooting

The hubify binary isn’t in the PATH that Claude Code’s MCP launcher uses.Fix: Use the absolute path in your mcp.json:
Find the path with which hubify.
  1. Confirm ~/.claude/mcp.json is valid JSON: cat ~/.claude/mcp.json | python3 -m json.tool
  2. Run hubify mcp --health to check the resolution chain
  3. Restart Claude Code — MCP servers are loaded at session start
Run the health check: hubify mcp --healthIf it shows [HTTP error] for CONVEX_URL, the URL is wrong. Find the correct one in Settings → Developer in the Hubify web app.
This is expected — lab_switch is session-scoped. To change the default lab permanently, update HUBIFY_LAB_SLUG in your ~/.claude/mcp.json.
Most write tools work without authentication (anonymous Convex writes). If you see errors on task_create, memory_save, etc., run the smoke test:
A {"status":"success","value":"..."} response confirms writes work. Find your lab ID in Settings → Developer.