Shadow MCP Server MCP server

Standalone MCP server executable for Windows, macOS, and other platforms that uses JavaScript configuration files to define resources, tools, and prompts without requiring Node.js installation.
Back to servers
Setup instructions
Provider
shadow
Release date
May 16, 2025
Language
JavaScript
Stats
74 stars

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.

Installation

Quick Installation

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

Usage Scenarios

WebSocket Connection Mode

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"
    }
}

Standalone Service

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: 3000 (can be changed with --port)
  • SSE endpoints: GET / to establish a session, POST /sessions?sessionId=... to send messages
  • Includes built-in tools
  • Auto-reloads when config changes

Combining Multiple MCP Services

You 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 .

Tool Chain Execution

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] }
    }
  ]
}

Custom Tools Plugin Mechanism

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 } }] }))
  }
}

Scheduled Tasks (Cronjob Mode)

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:

  • desktop: System notifications (requires desktop environment)
  • email: Send email notifications (requires to, subject, etc.)
  • ntfy: Push to ntfy (requires url, topic, tags, priority)

Command Line Arguments

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

Using as a Library

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();

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 "ws-client-mcp-server" '{"command":"npx","args":["mcp_exe","--mcp-config"]}'

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": {
        "ws-client-mcp-server": {
            "command": "npx",
            "args": [
                "mcp_exe",
                "--mcp-config"
            ]
        }
    }
}

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": {
        "ws-client-mcp-server": {
            "command": "npx",
            "args": [
                "mcp_exe",
                "--mcp-config"
            ]
        }
    }
}

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