Skip to main content

Model Context Protocol

Lore provides an MCP server (@lore/mcp-server) that exposes your team's knowledge base to AI agents. Any MCP-compatible client — Claude Code, Claude Desktop, Cursor, or a custom agent — can search, list, and read Lore documents without custom integration code.


Architecture

┌─────────────────┐ stdio ┌──────────────┐
│ AI Agent │ ◀──────────────────── │ lore-mcp │
│ (Claude, etc.) │ │ server │
└─────────────────┘ └──────┬───────┘
│ HTTP

┌──────────────┐
│ Lore API │
│ /api/v1/* │
└──────────────┘

The MCP server runs locally and communicates with your agent over stdio. It authenticates with Lore using a workspace API key and proxies tool calls to the /api/v1/ REST endpoints.


Setup

Prerequisites

  • A Lore workspace API key (generate one in Settings > API in the dashboard)

Installation

npm install -g @lore/mcp-server

This installs the lore-mcp binary.

Environment variables

The MCP server requires two environment variables:

VariableRequiredDefaultDescription
LORE_API_KEYYesWorkspace API key
LORE_API_URLNohttps://lorehq.coLore API base URL

Connecting to an agent

Claude Code

Add to your MCP config (~/.claude/mcp.json):

{
"mcpServers": {
"lore": {
"command": "lore-mcp",
"env": {
"LORE_API_KEY": "your-api-key",
"LORE_API_URL": "https://lorehq.co"
}
}
}
}

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

{
"mcpServers": {
"lore": {
"command": "lore-mcp",
"env": {
"LORE_API_KEY": "your-api-key",
"LORE_API_URL": "https://lorehq.co"
}
}
}
}

Running manually

LORE_API_KEY=your-api-key lore-mcp

The server starts on stdio and logs Lore MCP Server started to stderr.


Available tools

The MCP server exposes three tools:

ToolDescription
search_knowledge_baseSemantic search across all documents in the workspace
get_documentFetch full details and content of a specific document by ID
list_documentsList recent documents with pagination

For parameter schemas and examples, see MCP Tools.


Example interaction

Once connected, your agent can invoke Lore tools naturally:

Agent: I'll check Lore for deployment procedures.
[calls search_knowledge_base with query "production deployment steps"]

Lore returns 3 matching documents with similarity scores.

Agent: Based on the team's documentation, here are the deployment steps...

The agent gets real, up-to-date context from your team's knowledge base.


Security

  • The MCP server authenticates using a workspace API key — it can only access documents within that workspace
  • The API key is passed via environment variable and never transmitted to the agent
  • All requests to Lore use HTTPS with the Authorization: Bearer header

Next steps