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:
| Variable | Required | Default | Description |
|---|---|---|---|
LORE_API_KEY | Yes | — | Workspace API key |
LORE_API_URL | No | https://lorehq.co | Lore 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:
| Tool | Description |
|---|---|
search_knowledge_base | Semantic search across all documents in the workspace |
get_document | Fetch full details and content of a specific document by ID |
list_documents | List 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: Bearerheader
Next steps
- MCP Tools Reference — Full parameter schemas for each tool
- API Authentication — How API keys work