LobeHub
LobeHub

Connect to LobeHub as an MCP Server

Coming soon (#23318). The MCP server is not on LobeHub Cloud yet. It also depends on the Agent runs API (#23253) for its run:* scopes. Tool names and limits below come from the pull request and can change before release.

LobeHub can act as an MCP server, so a coding assistant or any MCP client can list your Agents, run one, and read Topics, messages, files, and Libraries.

The same pull request adds a user guide for this at docs/usage/integrations/mcp-server; this page is the developer reference.

This is the opposite direction from the MCP servers you add to LobeHub Agents (managed through /api/v1/mcp-servers, available today).

Endpoint and Authentication

  • URL: https://app.lobehub.com/api/v1/mcp (or <your origin>/api/v1/mcp)
  • Transport: Streamable HTTP, stateless. Clients send JSON-RPC with POST; GET and DELETE return 405.
  • Authentication: the same as the REST API, Authorization: Bearer <API key or OIDC token>. Send X-Workspace-Id with an OIDC token to work in a Workspace; a Workspace API key uses its own Workspace.

The server only lists the tools your credential's scopes reach. Create a dedicated API key with only the scopes below that you want the assistant to have.

Tools

ToolWhat it doesScopes
list_agents, get_agentList Agents, read oneagent:read
run_agentRun an Agent and wait for the reply (waitSeconds, default 50, up to 120)run:write, model:invoke
get_runRead a run's status and resultrun:read
search_topics, get_topic, search_messagesFind and read conversationschat:read
list_files, read_fileList and read filesfile:read
upload_fileUpload a filefile:write
list_knowledge_basesList Librariesknowledge:read

Resources: lobehub://agents, lobehub://agents/{agentId}, lobehub://topics/{topicId}. Prompt: summarize_topic.

When run_agent does not finish within waitSeconds, it returns the run id; call get_run later.

Client Configuration

Claude Code

*.sh
Shell
claude mcp add --transport http lobehub https://app.lobehub.com/api/v1/mcp \
  --header "Authorization: Bearer sk-lh-your-key"

Cursor

Add to ~/.cursor/mcp.json:

*.json
JSON
{
  "mcpServers": {
    "lobehub": {
      "url": "https://app.lobehub.com/api/v1/mcp",
      "headers": { "Authorization": "Bearer sk-lh-your-key" }
    }
  }
}

Codex

Add to ~/.codex/config.toml and export LOBEHUB_API_KEY:

*.toml
TOML
[mcp_servers.lobehub]
url = "https://app.lobehub.com/api/v1/mcp"
bearer_token_env_var = "LOBEHUB_API_KEY"

Check the Connection

After adding the server, ask the assistant to "list my LobeHub agents". It should call list_agents and show your Agents. If it reports 401, check the key; if a tool is missing, the key lacks that tool's scope.