privateGPT MCP server

Integrates privateGPT with MCP-compatible applications, providing chat management, knowledge source organization, and group-based permissions for diverse AI-driven projects.
Back to servers
Setup instructions
Provider
Fujitsu Technology Solutions GmbH
Release date
Mar 06, 2025
Language
TypeScript
Stats
4 stars

The privateGPT MCP Server provides an implementation of the Model Context Protocol, allowing you to integrate privateGPT's capabilities with any MCP-compatible client application. This server acts as a bridge between clients and privateGPT's API.

Installation

To install the privateGPT MCP Server:

git clone https://github.com/privateGPT-dev/MCP-Server-for-MAS-Developments.git
cd MCP-Server-for-MAS-Developments

Choose either manual or automatic installation:

Manual Installation

sudo apt install npm
npm install
npm run build

Automatic Installation (Linux)

sudo chmod +x InstallMPCServer.sh
./InstallMPCServer.sh

Configuration

First, create your configuration file:

cp privateGPT.env.json.example privateGPT.env.json

Generate SSL Certificates

For secure certificate authentication:

ssh-keygen -p -m PEM -f ~/.ssh/id_rsa
ssh-keygen -f ~/.ssh/id_rsa.pub -e -m PEM > ~/.ssh/id_rsa_public.pem

For SSL/TLS communication (self-signed example):

openssl req -x509 -newkey rsa:2048 -nodes -keyout server.key -out server.crt -days 365 -subj "/CN=localhost"

Configuration Options

Edit privateGPT.env.json with your settings:

{
    "privateGPT_Url": {
        "PRIVATE_GPT_API_URL": "https://<YOUR_privateGPT_URL>/api/v1",
        "API_URL": "https://<YOUR_privateGPT_URL>/api/v1"
    },
    "Proxy_Config": {
        "USE_PROXY": "true",
        "HEADER_ENCRYPTED": "true",
        "ACCESS_HEADER": "BptfJBeRGLbZas+..."
    },
    "Server_Config": {
        "PORT": 5000,
        "LANGUAGE": "en",
        "SSL_VALIDATE": "false",
        "PW_ENCRYPTION": "true",
        "ALLOW_KEYGEN": "false",
        "PUBLIC_KEY": "~/.ssh/id_rsa_public.pem",
        "PRIVATE_KEY": "~/.ssh/id_rsa",
        "ENABLE_TLS": "true",
        "SSL_KEY_PATH": "~/.ssh/certs/server.key",
        "SSL_CERT_PATH": "~/.ssh/certs/server.crt"
    },
    "Restrictions": {
        "RESTRICTED_GROUPS": false,
        "ENABLE_OPEN_AI_COMP_API": true
    },
    "Logging": {
        "WRITTEN_LOGFILE": true,
        "LOG_IPs": true,
        "ANONYMOUS_MODE": false
    },
    "Functions": {
        "ENABLE_LOGIN": true,
        "ENABLE_LOGOUT": true,
        "ENABLE_CHAT": true,
        "ENABLE_CONTINUE_CHAT": true,
        "ENABLE_GET_CHAT_INFO": true,
        "ENABLE_DELETE_ALL_CHATS": true,
        "ENABLE_DELETE_CHAT": true,
        "ENABLE_LIST_GROUPS": true,
        "ENABLE_STORE_GROUP": true,
        "ENABLE_DELETE_GROUP": true,
        "ENABLE_CREATE_SOURCE": true,
        "ENABLE_EDIT_SOURCE": true,
        "ENABLE_DELETE_SOURCE": true,
        "ENABLE_GET_SOURCE": true,
        "ENABLE_LIST_SOURCES": true,
        "ENABLE_STORE_USER": true,
        "ENABLE_EDIT_USER": false,
        "ENABLE_DELETE_USER": false,
        "ENABLE_REACTIVATE_USER": true
    }
}

Key Configuration Sections

Server Port

"PORT": 5000

Language Support

Supported languages include en, de, pt, es, nl, and fr.

"LANGUAGE": "en"

Security Settings

"SSL_VALIDATE": "false",
"PW_ENCRYPTION": "true",
"PUBLIC_KEY": "~/.ssh/id_rsa_public.pem",
"PRIVATE_KEY": "~/.ssh/id_rsa",
"ENABLE_TLS": "true",
"SSL_KEY_PATH": "~/.ssh/certs/server.key",
"SSL_CERT_PATH": "~/.ssh/certs/server.crt"

Restrictions

"RESTRICTED_GROUPS": false,
"ENABLE_OPEN_AI_COMP_API": true

Logging

"WRITTEN_LOGFILE": true,
"LOG_IPs": true,
"ANONYMOUS_MODE": false

Password Encryption Tools

Generate Encrypted Password

node security/generate_encrypted_password.js ~/.ssh/id_rsa_public.pem

Check Encrypted Password

node security/generate_decrypted_password.js ~/.ssh/id_rsa

Starting the Server

node dist/index.js

Key Features

Authentication

  • Login with email and password
  • Secure session management with tokens

Chat Management

  • Start chats with optional knowledge base context
  • Continue existing conversations
  • View chat history and metadata
  • Delete individual or all chats

Group Management

  • List available groups
  • Create new groups
  • Delete existing groups

Source Management

  • Create, edit, and delete knowledge sources
  • Assign sources to specific groups
  • List and retrieve source information

User Management

  • Create new users with custom roles
  • Edit user information
  • Delete and reactivate users

Each feature can be enabled or disabled through the configuration file, providing flexibility based on your deployment needs.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "privategpt" '{"command":"node","args":["dist/index.js"]}'

See the official Claude Code MCP documentation for more details.

For 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 > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "privategpt": {
            "command": "node",
            "args": [
                "dist/index.js"
            ]
        }
    }
}

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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "privategpt": {
            "command": "node",
            "args": [
                "dist/index.js"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

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