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.
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:
sudo apt install npm
npm install
npm run build
sudo chmod +x InstallMPCServer.sh
./InstallMPCServer.sh
First, create your configuration file:
cp privateGPT.env.json.example privateGPT.env.json
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"
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
}
}
"PORT": 5000
Supported languages include en
, de
, pt
, es
, nl
, and fr
.
"LANGUAGE": "en"
"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"
"RESTRICTED_GROUPS": false,
"ENABLE_OPEN_AI_COMP_API": true
"WRITTEN_LOGFILE": true,
"LOG_IPs": true,
"ANONYMOUS_MODE": false
node security/generate_encrypted_password.js ~/.ssh/id_rsa_public.pem
node security/generate_decrypted_password.js ~/.ssh/id_rsa
node dist/index.js
Each feature can be enabled or disabled through the configuration file, providing flexibility based on your deployment needs.
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.
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 > 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"
]
}
}
}
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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