Connecting AI Clients
Almanac exposes an MCP (Model Context Protocol) server that allows AI clients like Claude Desktop, Cline, and ChatGPT to directly access your indexed data. This enables your AI assistant to search and retrieve information from all your connected data sources.
What is MCP?
The Model Context Protocol (MCP) is an open standard that allows AI applications to securely connect to external data sources and tools. When you connect Almanac via MCP, your AI client can:
🔍 Search across all your indexed data sources
🧠 Use LightRAG's intelligent retrieval modes
📊 Access both vector and graph-based search
🔒 Maintain security through local connections
Claude Desktop
Claude Desktop supports MCP servers through its configuration file.
Prerequisites
Almanac running locally (
pnpm start)Claude Desktop installed
Server accessible at
http://localhost:3000
Setup Instructions
Locate your Claude Desktop config file:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.json
Add Almanac to your MCP servers:
Open the config file and add the following to the
mcpServerssection:Restart Claude Desktop
Verify the connection:
In Claude Desktop, you should see Almanac listed in the MCP servers section. Try asking:
"Search my Almanac data for discussions about API refactoring"
Example Configuration
Here's a complete example with multiple MCP servers:
Cline (VS Code Extension)
Cline is a VS Code extension that supports MCP servers for enhanced AI assistance.
Prerequisites
Almanac running locally (
pnpm start)Cline extension installed in VS Code
Server accessible at
http://localhost:3000
Setup Instructions
Open Cline settings in VS Code:
Open Command Palette (
Cmd/Ctrl + Shift + P)Search for "Cline: Open MCP Settings"
Add Almanac to your MCP servers:
Add the following configuration:
Restart VS Code or reload the Cline extension
Verify the connection:
In Cline, you should see Almanac tools available. Try asking:
"Use Almanac to search for information about our authentication system"
ChatGPT (Developer Mode)
ChatGPT supports MCP servers through its Developer Mode feature.
⚠️ Important Security Warning
ChatGPT requires your Almanac server to be publicly accessible on the internet. This means:
❌
localhostconnections are NOT supported⚠️ Your data will be accessible over the internet
🔒 You MUST implement proper security measures:
Authentication/API keys
HTTPS/TLS encryption
Firewall rules
Rate limiting
We strongly advise only exposing Almanac publicly if you have the expertise to secure it properly.
Prerequisites
Almanac deployed on a publicly accessible server with HTTPS
ChatGPT Plus or Enterprise subscription
Developer Mode enabled in ChatGPT
Setup Instructions
Deploy Almanac to a public server:
Enable Developer Mode in ChatGPT:
Follow OpenAI's official guide: Developer Mode and MCP Apps in ChatGPT
Add Almanac as an MCP server:
In ChatGPT's Developer Mode settings, add:
Verify the connection:
In ChatGPT, try asking:
"Search my Almanac data for recent project updates"
Security Checklist
Before exposing Almanac publicly:
Available Tools
Once connected, your AI client will have access to these Almanac tools:
lightrag_query
lightrag_querySearch your indexed data using LightRAG's intelligent retrieval.
Parameters:
query(string, required): Your search querymode(string, optional): Query mode -naive,local,global,hybrid, ormix(default:mix)top_k(number, optional): Number of results to return (default: 5)
Example usage in Claude:
"Use lightrag_query to search for 'API authentication' in hybrid mode"
Query Modes Explained
naive: Fast keyword search
local: Entity-focused search (people, projects, concepts)
global: Relationship-focused search (connections, workflows)
hybrid: Balanced combination of local and global
mix: Best results (combines all modes with reranking)
Troubleshooting
Connection Refused
Problem: AI client can't connect to Almanac
Solutions:
Verify Almanac is running:
curl http://localhost:3000/healthCheck the URL in your config (use
127.0.0.1instead oflocalhostif needed)Ensure no firewall is blocking the connection
Restart your AI client after config changes
No Tools Available
Problem: MCP server connected but no tools appear
Solutions:
Check Almanac logs for errors
Verify you have data sources connected and synced
Ensure indexing has completed
Restart both Almanac and your AI client
Slow Responses
Problem: Queries take a long time to return results
Solutions:
Try a simpler query mode (
naiveorlocal)Reduce
top_kparameterCheck if indexing is still in progress
Review Almanac performance settings in
.env
Next Steps
Query Modes Guide - Learn when to use each mode
API Reference - Direct API usage
Best Practices - Optimize your queries
Need help? Open an issue on GitHub
Last updated
Was this helpful?