MCP-Host-CLI is a Node.js-based Model Context Protocol (MCP) host application that connects and manages multiple MCP servers. It provides a unified interface allowing clients to interact with multiple MCP servers through HTTP APIs, accessing and invoking tools (or resources). You can use it to quickly test and run your MCP Servers.
The simplest way to install and run MCP-Host-CLI is using npx:
npx mcp-host-cli
Alternatively, you can clone the repository and build it locally:
Clone the repository:
git clone https://github.com/liujilongObject/mcp-host-cli.git
Install dependencies:
npm install
Run in development mode:
npm run dev
Or build and run in production mode:
npm run build
node dist/index.js
MCP-Host-CLI reads a configuration file named mcp_servers.config.json
from the current working directory. The file format is as follows:
{
"mcp_servers": [
{
"enabled": true,
"type": "stdio",
"server_name": "server-puppeteer",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-puppeteer"
]
},
{
"enabled": true,
"type": "sse",
"server_name": "server-everything-sse",
"sse_url": "http://localhost:3001/sse"
},
{
"enabled": true,
"type": "stdio",
"server_name": "github",
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-github"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
]
}
The server runs on port 17925 by default. Here are the available API endpoints:
Retrieve a list of all available tools from all connected servers:
GET http://localhost:17925/api/tools
Response:
{
"code": 0,
"data": [
{
"server_name": "server1",
"tools": [
{
"name": "toolName",
"description": "Tool description",
"inputSchema": { /* schema */ }
}
]
}
]
}
Execute a specific tool on a server:
POST http://localhost:17925/api/tools/toolCall
Content-Type: application/json
{
"server_name": "serverName",
"tool_name": "toolName",
"tool_args": { /* arguments */ }
}
Response:
{
"code": 0,
"data": {
"result": "Tool execution result"
}
}
Retrieve a list of all available resources from all connected servers:
GET http://localhost:17925/api/resources
Response:
{
"code": 0,
"data": [
{
"server_name": "server1",
"resources": [
{
"uri": "resourceURI",
"mimeType": "resourceType",
"name": "resourceName"
}
]
}
]
}
Retrieve a specific resource from a server:
POST http://localhost:17925/api/resources/read
Content-Type: application/json
{
"server_name": "serverName",
"resource_uri": "resourceURI"
}
Response:
{
"code": 0,
"data": [
{
"mimeType": "resourceType",
"text": "text resource",
"blob": "blob resource"
}
]
}
Update server connections without restarting the Host service. The Host will read the updated configuration file and create/restart/delete server connections accordingly:
POST http://localhost:17925/api/connections/update
Response will show the updated server configurations.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "mcp-host-cli" '{"command":"npx","args":["mcp-host-cli"]}'
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": {
"mcp-host-cli": {
"command": "npx",
"args": [
"mcp-host-cli"
]
}
}
}
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": {
"mcp-host-cli": {
"command": "npx",
"args": [
"mcp-host-cli"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect