MCP Server is a powerful executable server for running Model Context Protocol (MCP) services with advanced features like tool chain execution, multiple MCP service management, custom tools via plugins, and flexible deployment options. It supports both SSE and stdio transport modes and can automatically reload when configuration changes.
You can run MCP Server without installing it locally using npx:
npx mcp_exe --mcp-config ./examples/mcp.json
Alternatively, you can download and run the executable directly:
./executables/mcp_server-win-x64.exe --mcp-config ./examples/mcp.json
This mode connects to other MCP services via WebSocket, perfect for integrating with services like xiaozhi.me:
npx mcp_exe --ws wss://api.xiaozhi.me/mcp/?token=...xxx --mcp-config ./examples/mcp-sse.json
Example configuration (mcp-sse.json):
{
"mcpServers": {
"Model Server sse": {
"url": "http://127.0.0.1:3000"
}
},
"serverInfo": {
"serverName": "ws-client-mcp-server",
"version": "1.0.0",
"description": "WebSocket 客户端的 MCP 服务器实例",
"author": "shadow"
}
}
The simplest way to use MCP Server is to run it directly:
# Double-click the executable or run via command line
./executables/mcp_server-win-x64.exe
# Or use npx
npx mcp_exe
Default configuration:
--port
)/
to establish a session, POST /sessions?sessionId=...
to send messagesYou can combine multiple MCP services using a configuration file compatible with Cursor:
npx mcp_exe --mcp-config ./examples/mcp.json
Example configuration (mcp.json):
{
"mcpServers": {
"Model Server sse": { "url": "http://127.0.0.1:9090" },
"Model Server - stdio": { "command": "xxx", "args": ["--transport", "stdio"] }
},
"serverInfo": { "serverName": "dynamic-mcp-server" },
"tools": [],
"namespace": "."
}
tools
: Whitelist of allowed tools (empty array means no filtering)namespace
: Namespace separator for combined tools, default is .
Create complex automation workflows by chaining multiple tools together:
npx mcp_exe --mcp-config ./examples/product-hunt/mcp-tools.json
Example configuration excerpt:
{
"toolChains": [
{
"name": "product_hunt_news",
"description": "get product hunt news",
"steps": [
{ "toolName": "get_product_hunt_url", "args": {} },
{ "toolName": "load_product_hunt_js_code", "args": {} },
{ "toolName": "browser_navigate", "args": {}, "outputMapping": { "url": "content.0.text" }, "fromStep": 0 },
{ "toolName": "browser_execute_javascript", "args": {}, "outputMapping": { "code": "content.0.text" }, "fromStep": 1 },
{ "toolName": "browser_close", "args": {} }
],
"output": { "steps": [3] }
}
]
}
Define custom tools, resources, and prompts using JavaScript configuration files:
npx mcp_exe --mcp-js ./examples/custom-mcp-config.js
Example configuration (custom-mcp-config.js):
module.exports = {
// Recommended export name: configureMcp (also compatible with mcpPlugin)
configureMcp: function(server, ResourceTemplate, z) {
server.tool('myTool', 'Custom tool example', { /* zod schema */ }, async (args) => ({ content: [{ type: 'text', text: 'ok' }] }))
server.resource('custom-echo', new ResourceTemplate('custom-echo://{message}', { list: undefined }), async (uri, { message }) => ({ contents: [{ uri: uri.href, text: message }] }))
server.prompt('custom-prompt', { /* zod */ }, ({ message }) => ({ messages: [{ role: 'user', content: { type: 'text', text: message } }] }))
}
}
Execute tools on a schedule using the cronjob feature:
npx mcp_exe --cronjob ./examples/cronjob.json --mcp-js ./examples/product-hunt/custom-mcp-config.js
Example configuration (cronjob.json):
{
"tasks": [
{
"schedule": "*/30 * * * * *",
"operations": [
{ "type": "callTool", "name": "get_product_hunt_url", "arguments": {} }
],
"notify": [
{ "type": "desktop", "title": "Task Result", "icon": "" }
]
}
]
}
Notification types supported:
to
, subject
, etc.)ntfy
(requires url
, topic
, tags
, priority
)The server supports these command line arguments:
Argument | Description | Default |
---|---|---|
--ws <url> |
WebSocket server address to enable WebSocket connection mode | None |
--mcp-js <path> |
Path to MCP JavaScript config file | None |
--mcp-config <path/json> |
Path to MCP JSON config file or JSON string | None |
--server-name <name> |
Server name | mcp_server_exe |
--port <port> |
Server listening port | 3000 |
--transport <mode> |
Transport mode, sse or stdio |
sse |
--cronjob <path/json> |
Path to cronjob config file or JSON string | None |
--cursor-link |
Enable quick access in Cursor (SSE mode) | Off |
--log-level <level> |
Log level: TRACE/DEBUG/INFO/WARN/ERROR/FATAL/OUTPUT | INFO |
Since v0.11.x, MCP Server can be used as a library:
// CommonJS
const { McpRouterServer } = require('mcp_exe');
(async () => {
const server = new McpRouterServer({ name: 'my-app' }, { transportType: 'sse', port: 3000 });
await server.importMcpConfig(require('./mcp.json'), null);
await server.start();
})();
// TypeScript / ESM
import { McpRouterServer } from 'mcp_exe';
const server = new McpRouterServer({ name: 'my-app' }, { transportType: 'stdio' });
await server.importMcpConfig(mcpJson, null);
await server.start();
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "ws-client-mcp-server" '{"command":"npx","args":["mcp_exe","--mcp-config"]}'
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": {
"ws-client-mcp-server": {
"command": "npx",
"args": [
"mcp_exe",
"--mcp-config"
]
}
}
}
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": {
"ws-client-mcp-server": {
"command": "npx",
"args": [
"mcp_exe",
"--mcp-config"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect