Lspace is an open-source API backend and server implementing the Model Context Protocol (MCP), allowing you to capture insights from AI conversations and transform them into searchable knowledge. It eliminates context-switching by making your AI interactions available across all your tools, effectively connecting AI agents to managed content repositories.
Clone the repository:
git clone https://github.com/Lspace-io/lspace-server.git
Navigate to the directory:
cd lspace-server
Install dependencies:
npm install
Build the project:
npm run build
Create your environment file:
cp .env.example .env
Edit the .env
file:
OPENAI_API_KEY
(required)Copy the example configuration file:
cp config.example.json config.local.json
Edit config.local.json
to:
Example configuration:
{
"credentials": {
"github_pats": [
{
"alias": "my_lspace_pat",
"token": "ghp_YOUR_GITHUB_TOKEN_HERE"
}
]
},
"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 GitHub Project",
"type": "github",
"owner": "your-github-username",
"repo": "your-repository-name",
"branch": "main",
"pat_alias": "my_lspace_pat",
"path_to_kb": ".",
"id": "another_unique_id"
}
]
}
After building Lspace, you need to configure MCP clients to use it.
Create a configuration file in one of these locations:
.cursor/mcp.json
in your project root~/.cursor/mcp.json
in your home directoryAdd the following content:
{
"mcpServers": {
"lspace-knowledge-base": {
"command": "node",
"args": ["/absolute/path/to/your/lspace-server/lspace-mcp-server.js"]
}
}
}
Replace the path with the actual absolute path to your lspace-server directory
Restart Cursor
Locate or create the configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Add the following content:
{
"mcpServers": {
"lspace": {
"command": "node",
"args": ["/absolute/path/to/your/lspace-server/lspace-mcp-server.js"]
}
}
}
Replace the path with the actual absolute path to your lspace-server directory
Restart Claude Desktop
Lspace requires GitHub PATs to interact with your repositories.
repo
scope to grant repository accessconfig.local.json
under credentials.github_pats
If you need the RESTful API endpoints in addition to the MCP server:
Ensure your configuration files are set up
For development:
npm run dev
For production:
npm start
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.