by Lspace-io
Capture insights from any AI session and instantly make them searchable across all your tools, turning scattered conversations into persistent, organized knowledge.
Lspace provides an open‑source API backend that implements the Model Context Protocol, enabling developers and AI agents to store, classify, and synthesize content from multiple repositories (local or GitHub) into a unified knowledge base.
git clone https://github.com/Lspace-io/lspace-server.git
cd lspace-server
npm install
npm run build
.env.example
to .env
and setting at least OPENAI_API_KEY
.config.local.json
(copy from config.example.json
). Include GitHub PATs if you plan to connect to GitHub repos.lspace-mcp-server.js
. Launch it with Node (e.g., node lspace-mcp-server.js
).mcpServers
configuration to the script path./.lspace/raw_inputs/
and AI‑generated knowledge base at repo root.OPENAI_API_KEY
).npm run dev
or npm start
..env
and tokens in config.local.json
(which is git‑ignored) keep credentials out of source control."Books bend space and time... You stray into Lspace at your peril." - Terry Pratchett (Guards! Guards!)
Lspace eliminates context-switching friction by letting you capture insights from any AI session and instantly make them available across all your tools - turning scattered conversations into persistent, searchable knowledge.
Lspace is an open-source API backend and server that implements the Model Context Protocol (MCP). It enables developers to integrate intelligent knowledge base generation and management capabilities into their workflows, connecting AI agents and other tools to managed content repositories. (See modelcontextprotocol.io for more on MCP).
For comprehensive technical documentation, project details, and an example of a knowledge base built with Lspace, please see the official Lspace documentation repository.
This guide helps you set up the Lspace server and configure it for use with Model Context Protocol (MCP) clients like Cursor or Claude Desktop.
A. Prerequisites:
B. Clone, Install & Build Lspace Server: These steps prepare the Lspace server code to be executed by an MCP client.
git clone https://github.com/Lspace-io/lspace-server.git
cd lspace-server
npm install
dist/
folder):
npm run build
The main script for the MCP server will be lspace-mcp-server.js
in the root of this directory after the build.C. Configure Your Lspace Server: Before an MCP client can use Lspace, you need to configure Lspace itself:
.env
file):
cp .env.example .env
.env
file.OPENAI_API_KEY
..env.example
).config.local.json
file):
cp config.example.json config.local.json
config.local.json
:
credentials.github_pats
. If you need detailed instructions on creating PATs, please see the Understanding GitHub Personal Access Tokens (PATs) for Lspace section below.repositories
array.config.local.json
)" section for detailed structure and examples.D. Configuring Lspace in MCP Clients:
The lspace-mcp-server.js
script (in your lspace-server
directory) is what MCP clients will execute. You need to tell your MCP client how to find and run this script.
Important: In the client configurations below, replace /actual/absolute/path/to/your/lspace-server/
with the real absolute file path to the directory where you cloned and built the lspace-server
.
Cursor: Cursor can be configured via a JSON file. You can set this up per-project or globally:
.cursor/mcp.json
in your project's root directory.~/.cursor/mcp.json
in your user home directory.Example mcp.json
for Cursor:
{
"mcpServers": {
"lspace-knowledge-base": { // You can choose any name here
"command": "node",
"args": ["/actual/absolute/path/to/your/lspace-server/lspace-mcp-server.js"],
"env": {
// .env file in lspace-server directory should be picked up automatically.
// Only add environment variables here if you need to override them
// specifically for Cursor, or if the .env file is not found.
// "OPENAI_API_KEY": "your_openai_key_if_not_in_lspace_env"
}
}
}
}
args
.Claude Desktop: Claude Desktop uses a central JSON configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\\Claude\\claude_desktop_config.json
If this file doesn't exist, Claude Desktop might create it when you go to Settings > Developer > Edit Config.
Example claude_desktop_config.json
content:
{
"mcpServers": {
"lspace": { // You can choose any name here
"command": "node",
"args": ["/actual/absolute/path/to/your/lspace-server/lspace-mcp-server.js"]
// "env": { ... } // Similar environment variable considerations as with Cursor
}
}
}
args
.After configuring your MCP client, it should be able to start and communicate with your Lspace server, allowing you to use Lspace tools and access your configured knowledge bases from within the client.
Lspace requires GitHub Personal Access Tokens (PATs) to interact with your GitHub repositories on your behalf. This includes operations like cloning repositories, reading content, and importantly, writing new content (e.g., generated knowledge base articles, processed raw inputs) by committing and pushing changes.
Why PATs? PATs are a secure way to grant Lspace access to your GitHub account without needing your password. You can control the permissions (scopes) granted to each PAT and revoke them at any time.
Creating a GitHub PAT for Lspace:
repo
scope. This scope grants full control of public and private repositories.
Using PATs in Lspace (config.local.json
):
In your config.local.json
file, you'll define an alias
for your PAT under the credentials.github_pats
section and then reference this pat_alias
in your GitHub repository configurations. See the "Managing Repositories Manually (config.local.json
)" section for more details.
Example credentials
block in config.local.json
:
{
"credentials": {
"github_pats": [
{
"alias": "my_lspace_pat",
"token": "ghp_YOUR_COPIED_GITHUB_TOKEN_HERE"
}
// You can add more PATs with different aliases if needed
]
},
// ... rest of your repositories configuration ...
}
lspace-mcp-server.js
, allowing AI agents and other tools to interact with Lspace capabilities programmatically. (See modelcontextprotocol.io for more on MCP).Lspace utilizes a dual-structure repository architecture:
/.lspace/raw_inputs/
):
/.lspace/timeline.json
.README.md
in the repository root) provides an overview.Beyond the Quick Start, here are more details on configuration:
config.local.json
)This file is critical for defining repository connections (local paths, GitHub repo details) and credentials (like GitHub PATs).
See the "Managing Repositories Manually (config.local.json
)" section for its structure.
Prompts guiding the LLM for document processing and knowledge base generation are centralized in src/config/prompts.ts
. Modify these to customize AI behavior.
If you need the RESTful API endpoints (e.g., for web application integration or direct HTTP calls) in addition to or instead of the MCP server:
.env
and config.local.json
are set up as described above.npm run build
npm run dev
npm start
These scripts typically start the full application defined in src/index.ts
, which may include both REST API and MCP functionalities. The lspace-mcp-server.js
script is a dedicated entry point optimized for MCP-only interactions.
config.local.json
)You can manage the repositories Lspace connects to by directly editing your local config.local.json
file. This file is not committed to version control (it's in .gitignore
). An example template, config.example.json
, is provided in the repository.
Always make your changes in config.local.json
.
The basic structure of the file includes a list of credentials
(for services like GitHub) and a list of repositories
.
{
"credentials": {
"github_pats": [
{
"alias": "your_github_pat_alias",
"token": "ghp_yourgithubpersonalaccesstoken"
}
]
},
"repositories": [
{
"name": "My Local Project",
"type": "local",
"path": "/path/to/your/local/git/repository",
"path_to_kb": ".",
"id": "your_unique_id_for_this_repo"
},
{
"name": "My Awesome GitHub Project",
"type": "github",
"owner": "your-github-username-or-org",
"repo": "your-repository-name",
"branch": "main",
"pat_alias": "your_github_pat_alias",
"path_to_kb": ".",
"id": "another_unique_id"
}
]
}
repositories
array in config.local.json
(see example above).
name
: A human-readable name.type
: Must be "local"
.path
: The absolute path to your local Git repository.path_to_kb
(Optional): Relative path to the knowledge base root within the repo (e.g., docs/kb
). Defaults to .
(repository root).id
(Optional): A unique UUID. If omitted, one will be generated.repo
scope.credentials.github_pats
section (see example above).repositories
array (see example above).
name
, type
("github"
), owner
, repo
, branch
, pat_alias
, path_to_kb
, id
as described.After editing config.local.json
, restart the Lspace MCP server or API server for changes to take effect. Lspace will then attempt to clone new GitHub repositories into the directory specified by REPO_BASE_PATH
(or its default cloned-github-repos
) and make all configured repositories available.
This project is licensed under the Business Source License 1.1 (BSL 1.1).
This generally means:
For the full license text, please see the LICENSE
file in the repository.
Please log in to share your review and rating for this MCP.
Explore related MCPs that share similar capabilities and solve comparable challenges
by modelcontextprotocol
A basic implementation of persistent memory using a local knowledge graph. This lets Claude remember information about the user across chats.
by topoteretes
Provides dynamic memory for AI agents through modular ECL (Extract, Cognify, Load) pipelines, enabling seamless integration with graph and vector stores using minimal code.
by basicmachines-co
Enables persistent, local‑first knowledge management by allowing LLMs to read and write Markdown files during natural conversations, building a traversable knowledge graph that stays under the user’s control.
by smithery-ai
Provides read and search capabilities for Markdown notes in an Obsidian vault for Claude Desktop and other MCP clients.
by chatmcp
Summarize chat messages by querying a local chat database and returning concise overviews.
by dmayboroda
Provides on‑premises conversational retrieval‑augmented generation (RAG) with configurable Docker containers, supporting fully local execution, ChatGPT‑based custom GPTs, and Anthropic Claude integration.
by GreatScottyMac
Provides a project‑specific memory bank that stores decisions, progress, architecture, and custom data, exposing a structured knowledge graph via MCP for AI assistants and IDE tools.
by andrea9293
Provides document management and AI-powered semantic search for storing, retrieving, and querying text, markdown, and PDF files locally without external databases.
by scorzeth
Provides a local MCP server that interfaces with a running Anki instance to retrieve, create, and update flashcards through standard MCP calls.