Run Locally

For developers who need to run the MCP server locally for development, debugging, or custom modifications.

When to Run Locally

Consider running locally if you need:

  • Development and debugging of the MCP server itself
  • Testing unreleased features or custom modifications
  • Offline work in restricted network environments
  • Contributing to the mcp-klever-vm repository
  • Custom knowledge entries with Redis persistent storage

Prerequisites

Before configuring your IDE, clone and build the MCP server:

1. Clone the Repository

git clone https://github.com/klever-io/mcp-klever-vm.git
cd mcp-klever-vm

2. Install Dependencies and Build

npm install
npm run build

This creates the dist/index.js file that you'll reference in your IDE configuration.

IDE Configuration

Claude Code

Configure MCP Server

Create or edit your mcp.json file:

{
  "mcpServers": {
    "klever-vm": {
      "command": "node",
      "args": [
        "--experimental-vm-modules",
        "dist/index.js"
      ],
      "env": {
        "MODE": "mcp",
        "STORAGE_TYPE": "memory"
      }
    }
  }
}

Note: This uses in-memory storage (knowledge resets on restart). For persistent custom knowledge entries, see Storage Options below to configure Redis.

Start Claude Code

claude --mcp-config ./mcp.json

Visual Studio Code

Configure MCP Server

Create a .vscode/mcp.json file at the root of your project:

{
  "inputs": [],
  "servers": {
    "klever-vm": {
      "type": "stdio",
      "command": "node",
      "args": [
        "--experimental-vm-modules",
        "/absolute/path/to/mcp-klever-vm/dist/index.js"
      ],
      "env": {
        "MODE": "mcp",
        "STORAGE_TYPE": "memory"
      }
    }
  }
}

Important: Update the path in args to point to your absolute path to mcp-klever-vm/dist/index.js.

Start MCP Server

After configuring mcp.json, VS Code will show an option to run the MCP server directly. You can:

  • Click to start the server and view output within VS Code
  • Or restart VS Code to auto-discover and start your MCP server

Claude Desktop

Configure

Edit your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "klever-vm": {
      "command": "node",
      "args": [
        "--experimental-vm-modules",
        "/absolute/path/to/mcp-klever-vm/dist/index.js"
      ],
      "env": {
        "MODE": "mcp",
        "STORAGE_TYPE": "memory"
      }
    }
  }
}

Restart Claude Desktop after saving the configuration.

Cursor

Configure

Create a .cursor/mcp.json file at the root of your project:

{
  "mcpServers": {
    "klever-vm": {
      "command": "node",
      "args": [
        "--experimental-vm-modules",
        "/absolute/path/to/mcp-klever-vm/dist/index.js"
      ],
      "env": {
        "MODE": "mcp",
        "STORAGE_TYPE": "memory"
      }
    }
  }
}

Restart Cursor after creating the configuration file.

Storage Options

Memory Storage (Default)

The default configuration uses in-memory storage, which is fast but doesn't persist across restarts.

Configuration:

{
  "env": {
    "MODE": "mcp",
    "STORAGE_TYPE": "memory",
    "MEMORY_MAX_SIZE": "10000"
  }
}

Redis Storage

For persistent storage and custom knowledge entries, use Redis.

Configuration:

{
  "env": {
    "MODE": "mcp",
    "STORAGE_TYPE": "redis",
    "REDIS_URL": "redis://localhost:6379"
  }
}

Setup Steps:

  1. Install Redis: Follow the official Redis installation guide

  2. Verify Redis is running:

redis-cli ping
# Should return: PONG
  1. Ingest knowledge base:
cd mcp-klever-vm
npm run ingest
  1. Update your MCP configuration with Redis settings (as shown above)

  2. Restart your IDE/Claude Code

Development Commands

# Install dependencies
npm install

# Build
npm run build

# Development mode with hot-reload
npm run dev:mcp

# Run tests
npm test

# Lint and format
npm run lint
npm run format

# Ingest knowledge into Redis
npm run ingest

Next Steps

Important Security Note: Always review MCP server configuration before running - MCP servers can execute code on your machine.

Was this page helpful?