Lspace MCP server

Transforms Git repositories into searchable knowledge bases through automated document processing, timeline tracking, and semantic search capabilities with OpenAI integration for content extraction and GitHub support for repository management.
Back to servers
Provider
Robin Spottiswoode
Release date
May 31, 2025
Language
Python
Stats
1 star

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.

Installation

Prerequisites

  • Node.js: LTS version (includes npm) from nodejs.org
  • npm: Included with Node.js
  • Git: Available from git-scm.com

Setting Up the Lspace Server

  1. Clone the repository:

    git clone https://github.com/Lspace-io/lspace-server.git
    
  2. Navigate to the directory:

    cd lspace-server
    
  3. Install dependencies:

    npm install
    
  4. Build the project:

    npm run build
    

Configuration

Environment Variables

  1. Create your environment file:

    cp .env.example .env
    
  2. Edit the .env file:

    • Set your OPENAI_API_KEY (required)
    • Adjust other variables as needed

Repository Configuration

  1. Copy the example configuration file:

    cp config.example.json config.local.json
    
  2. Edit config.local.json to:

    • Add GitHub Personal Access Tokens (PATs)
    • Define repositories for Lspace to manage

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"
    }
  ]
}

Setting Up MCP Clients

After building Lspace, you need to configure MCP clients to use it.

Configuring Cursor

  1. Create a configuration file in one of these locations:

    • Project-specific: .cursor/mcp.json in your project root
    • Global: ~/.cursor/mcp.json in your home directory
  2. Add the following content:

    {
      "mcpServers": {
        "lspace-knowledge-base": {
          "command": "node",
          "args": ["/absolute/path/to/your/lspace-server/lspace-mcp-server.js"]
        }
      }
    }
    
  3. Replace the path with the actual absolute path to your lspace-server directory

  4. Restart Cursor

Configuring Claude Desktop

  1. Locate or create the configuration file:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Windows: %APPDATA%\Claude\claude_desktop_config.json
  2. Add the following content:

    {
      "mcpServers": {
        "lspace": {
          "command": "node",
          "args": ["/absolute/path/to/your/lspace-server/lspace-mcp-server.js"]
        }
      }
    }
    
  3. Replace the path with the actual absolute path to your lspace-server directory

  4. Restart Claude Desktop

Creating GitHub Personal Access Tokens

Lspace requires GitHub PATs to interact with your repositories.

  1. Go to your GitHub Developer settings
  2. Click "Personal access tokens" then "Tokens (classic)"
  3. Generate a new token with a descriptive name
  4. Set an expiration period
  5. Select the repo scope to grant repository access
  6. Generate and copy the token immediately
  7. Add it to your config.local.json under credentials.github_pats

Running the Full API Server (Optional)

If you need the RESTful API endpoints in addition to the MCP server:

  1. Ensure your configuration files are set up

  2. For development:

    npm run dev
    
  3. For production:

    npm start
    

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

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"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later