Skip to main content
Glama
veithly

mcp-server-wrapper

by veithly
README.md
# MCP Server Wrapper

A meta-MCP server that dynamically invokes any MCP server without restarting Claude Code. Add, remove, and invoke MCP servers on-the-fly.

## Features

- **Dynamic Server Management**: Add/remove MCP servers at runtime
- **Multiple Transports**: Support for stdio, SSE, and HTTP streaming
- **Persistent Configuration**: Server configs saved to disk
- **Connection Pooling**: Efficient connection reuse
- **Zero Restart**: No need to restart Claude Code when adding new MCPs

## Installation

### Via npm (recommended)

```bash
npx mcp-server-wrapper
```

### Via Claude Code

```bash
claude mcp add mcp-wrapper -- npx mcp-server-wrapper
```

### Manual Configuration

Add to your Claude Code configuration (`~/.claude.json`):

```json
{
  "mcpServers": {
    "mcp-wrapper": {
      "command": "npx",
      "args": ["mcp-server-wrapper"]
    }
  }
}
```

## Tools

### `mcp_list_servers`

List all registered MCP servers and their connection status.

### `mcp_add_server`

Add a new MCP server configuration.

**Parameters:**
- `id` (required): Unique identifier
- `name` (required): Human-readable name
- `transport` (required): `stdio`, `sse`, or `http-stream`
- `command`: Command for stdio transport
- `args`: Command arguments for stdio
- `url`: URL for SSE/HTTP transport
- `env`: Environment variables
- `headers`: HTTP headers
- `enabled`: Enable/disable server
- `persist`: Save to config file (default: true)

**Example - stdio:**
```json
{
  "id": "context7",
  "name": "Context7",
  "transport": "stdio",
  "command": "npx",
  "args": ["-y", "@upstash/context7-mcp@latest"]
}
```

**Example - HTTP stream:**
```json
{
  "id": "deepwiki",
  "name": "Deepwiki",
  "transport": "http-stream",
  "url": "https://mcp.deepwiki.com/mcp"
}
```

### `mcp_remove_server`

Remove an MCP server configuration.

**Parameters:**
- `server` (required): Server ID to remove
- `persist`: Remove from config file (default: true)

### `mcp_list_tools`

List available tools from an MCP server.

**Parameters:**
- `server`: Server ID (lists all if not specified)
- `pattern`: Filter tools by name pattern

### `mcp_invoke`

Invoke any tool from any registered MCP server.

**Parameters:**
- `server` (required): Server ID
- `tool` (required): Tool name
- `arguments`: Tool arguments
- `timeout`: Timeout in milliseconds

## Usage Examples

### Add and use Context7

```
1. mcp_add_server: id=context7, transport=stdio, command=npx, args=["-y", "@upstash/context7-mcp@latest"]
2. mcp_list_tools: server=context7
3. mcp_invoke: server=context7, tool=resolve-library-id, arguments={libraryName: "react"}
```

### Add and use Deepwiki

```
1. mcp_add_server: id=deepwiki, transport=http-stream, url=https://mcp.deepwiki.com/mcp
2. mcp_invoke: server=deepwiki, tool=ask_question, arguments={repoName: "facebook/react", question: "What is useEffect?"}
```

## Supported Transports

| Transport | Description | Use Case |
|-----------|-------------|----------|
| `stdio` | Standard I/O | Local MCP servers (npx, uvx) |
| `sse` | Server-Sent Events | Legacy remote servers |
| `http-stream` | HTTP Streaming | Modern remote servers |

## Configuration File

Server configurations are persisted to:
- **Windows**: `%USERPROFILE%\Documents\Project\MCP\mcp-wrapper\config\servers.json`
- **macOS/Linux**: `~/Documents/Project/MCP/mcp-wrapper/config/servers.json`

## Development

```bash
# Clone repository
git clone https://github.com/veithly/mcp-server-wrapper.git
cd mcp-server-wrapper

# Install dependencies
pnpm install

# Build
pnpm run build

# Development mode
pnpm run dev
```

## Requirements

- Node.js >= 18
- Claude Code or any MCP-compatible client

## License

MIT

## Author

Rick (veithly@live.com)

## Links

- [GitHub Repository](https://github.com/veithly/mcp-server-wrapper)
- [npm Package](https://www.npmjs.com/package/mcp-server-wrapper)
- [MCP Protocol](https://modelcontextprotocol.io)

TDQS

A4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a distinct purpose: adding, listing, invoking, and removing servers or tools. There is no ambiguity between them.

Naming Consistency5/5

All tools follow a consistent pattern: mcp_<verb>_<object> (e.g., mcp_add_server, mcp_invoke, mcp_list_servers). The naming is predictable and uniform.

Tool Count5/5

With 5 tools, the set is well-scoped for managing MCP server configurations and tool invocation. It is neither too sparse nor too heavy.

Completeness4/5

The tools cover the core lifecycle: add, list, invoke, and remove. However, there is no update or get detailed server info, which may be a minor gap for maintenance tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues