MCP server
Connect MemHQ to Claude Desktop, Claude Code, and other MCP clients via Remote MCP or stdio.
MCP server
MemHQ ships as a hosted Model Context Protocol
server at https://memhq.ai/mcp, so any MCP-aware client — Claude
Desktop, Claude Code, Cursor — can read from and write to your MemHQ
projects. No npx, no local process, no editing JSON config by hand for
the URL.
There are two ways to authenticate: sign in with your browser (OAuth, best for Claude's connector UI) or paste a project API key (best for config files and scripts). Both reach the same tools.
Using Claude Code? The Claude Code plugin complements this. MCP gives Claude tools it calls deliberately; the plugin injects context at every prompt and captures work in the background whether or not Claude reaches for a tool.
Connect — OAuth (Claude custom connector)
In Claude, open Settings → Connectors → Add custom connector, enter
https://memhq.ai/mcp, and click through. Claude discovers our
authorization server, registers itself, and sends you to a MemHQ consent
screen where you pick which project the connector may use. Nothing is
shared until you approve, and the grant covers that one project only.
Under the hood this is a standard OAuth 2.1 authorization-code flow with PKCE, so any client that speaks it works the same way:
| Document | URL |
|---|---|
| Protected resource metadata (RFC 9728) | https://memhq.ai/.well-known/oauth-protected-resource |
| Authorization server metadata (RFC 8414) | https://memhq.ai/.well-known/oauth-authorization-server |
| Dynamic client registration (RFC 7591) | https://memhq.ai/oauth/register |
Access tokens last one hour and are refreshed automatically by the client.
To revoke a connector, open the project's API keys page and delete
the key named MCP OAuth · <client name>. That kills the connection
immediately.
Connect — Remote MCP with an API key
Use your MemHQ project API key (mem_…) as a bearer token.
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS) or the equivalent on Linux / Windows:
{
"mcpServers": {
"memhq": {
"url": "https://memhq.ai/mcp",
"headers": {
"Authorization": "Bearer mem_..."
}
}
}
}Restart Claude Desktop and the MemHQ tools will appear in the tool picker.
Claude Code
claude mcp add memhq --transport http https://memhq.ai/mcp \
--header "Authorization: Bearer mem_..."Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"memhq": {
"url": "https://memhq.ai/mcp",
"headers": {
"Authorization": "Bearer mem_..."
}
}
}
}Tools exposed
| Tool | Maps to |
|---|---|
memhq_add | POST /v1/memhq/add |
memhq_search | POST /v1/memhq/search |
memhq_ask | POST /v1/memhq/ask |
memhq_list_users | GET /v1/users |
Self-hosted alternative — stdio
If you'd rather run the server in-process on your own machine — for air-gapped
setups, custom env-var injection, or pointing at a non-default MemHQ
API origin — @memhq/mcp-server ships a stdio entry point.
{
"mcpServers": {
"memhq": {
"command": "npx",
"args": ["-y", "@memhq/mcp-server"],
"env": {
"MEMHQ_API_KEY": "mem_...",
"MEMHQ_API_URL": "https://api.memhq.ai"
}
}
}
}The same tool surface is exposed by both transports. The Remote MCP
endpoint is the default path — everything else in these docs assumes
you're connecting to https://memhq.ai/mcp.