How to Add Additional MCP Server Libraries to Chat-MCP: A Complete Guide
To add additional MCP server libraries such as filesystem or puppeteer to the Chat-MCP desktop application, install the npm package and register the server configuration in src/main/config.json using either npx or node command patterns.
The Chat-MCP desktop application is an Electron-based client that discovers and launches MCP servers at startup by reading a central JSON configuration file. By editing this registry, you can integrate any Model Context Protocol-compatible server library—including @modelcontextprotocol/server-filesystem for local file access or @modelcontextprotocol/server-puppeteer for browser automation—without modifying the core application source code.
Install the MCP Server Package
First, install the desired server package into the project’s node_modules directory. These packages expose a CLI entry point (typically dist/index.js) that the application will spawn as a subprocess.
npm install @modelcontextprotocol/server-filesystem @modelcontextprotocol/server-puppeteer
Register the Server in src/main/config.json
The application reads server definitions from src/main/config.json via the readConfig function in src/main/main.ts (lines 44-52). Each entry under the mcpServers object defines how the initializeClient function (lines 60-73) spawns the server process.
You have two supported methods for launching the server:
Method 1: Using npx (Recommended)
The npx approach is the preferred method for quick setup across platforms. It automatically resolves and executes the package without requiring an absolute path.
Add an entry where the key represents the logical name exposed in the UI:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem"]
},
"puppeteer": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-puppeteer"]
}
}
}
Method 2: Using node with Absolute Path
Use the node method when npx fails on Windows, or when you need to pass additional arguments such as data directories or flags. This method points directly to the installed script within node_modules.
{
"mcpServers": {
"filesystem": {
"command": "node",
"args": [
"node_modules/@modelcontextprotocol/server-filesystem/dist/index.js",
"/path/to/allowed/directory"
]
}
}
}
Restart the Application
After saving changes to src/main/config.json, restart the Chat-MCP application. The initClient() function (lines 54-88 in src/main/main.ts) reads the updated configuration, spawns each registered server, and registers IPC handlers for the new capabilities. The renderer process automatically lists the new server under the MCP section in the UI.
Access Server Tools in the UI
Once registered, interact with the new server through the window.mcpServers object exposed by src/preload/preload.ts. This API forwards calls to the IPC handlers defined in the main process (see the registerIpcHandlers loop, lines 73-80).
For example, to list available tools from the filesystem server:
async function listFilesystemTools() {
const tools = await window.mcpServers['filesystem']?.tools?.list();
console.log('Available filesystem tools:', tools);
}
listFilesystemTools();
Summary
- Configuration-driven architecture: Chat-MCP discovers servers exclusively through
src/main/config.json, making integration a matter of JSON editing rather than code changes. - Two launch patterns: Use
npxfor cross-platform simplicity, ornodewith absolute paths for Windows compatibility and custom arguments. - Automatic UI integration: Servers defined in the config appear immediately in the renderer interface upon application restart.
- Standardized access: All servers expose tools, prompts, and resources through the unified
window.mcpServersAPI provided by the preload script.
Frequently Asked Questions
Where does Chat-MCP store its server configuration?
Chat-MCP stores server definitions in src/main/config.json at the repository root. The main process reads this file during the readConfig function execution (lines 44-52 of src/main/main.ts) before initializing each server via initializeClient.
Can I pass custom arguments to an MCP server?
Yes. When using the node method in src/main/config.json, append additional strings to the args array after the script path. These arguments are passed directly to the server process when initializeClient spawns the command.
Why would I use node instead of npx to launch a server?
Use the node method when npx behaves inconsistently on Windows systems, or when you need to specify absolute paths to data directories or configuration files that the server requires as command-line arguments. The npx method is otherwise preferred for its simplicity.
Do I need to rebuild the Electron app after adding a server?
No. Because Chat-MCP reads src/main/config.json at runtime through the initClient() initialization sequence, you only need to restart the application. The renderer process dynamically populates the server list from the preload script’s window.mcpServers object without requiring a rebuild.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →