Uses Biome for code linting and formatting with 100 character line width and 2-space indents
Built with Bun runtime for JavaScript/TypeScript execution and package management
Inspired by Cloudflare's Code Mode approach where LLMs write code to interact with JavaScript APIs instead of directly calling tools
Supports Git operations through connected MCP servers, allowing status checks and repository management
Provides JavaScript execution environment for running code with access to all connected MCP tools
Integrates pre-commit hooks to ensure code quality during development
Built with TypeScript using strict type checking for robust development
Uses Zod schemas for configuration validation and type safety
MCPMan
A Model Context Protocol (MCP) server manager that acts as a proxy/multiplexer for multiple MCP servers.
Overview
MCPMan allows you to:
Connect to multiple MCP servers simultaneously (stdio and HTTP transports)
Generate and execute code from natural language descriptions using LLMs
Execute JavaScript code with access to all connected MCP tools
Invoke tools from multiple servers with batch and parallel execution
Manage server configurations with OAuth 2.1 support
Dynamically add new servers without restarting
Store and access tool results through $results array
Quick Start
Installation
Initialize Configuration
Add MCP Servers
Generate and Execute Code from Natural Language
The code
tool uses LLMs (via Claude Agent SDK or MCP sampling) to generate JavaScript code from natural language descriptions. Generated code is validated with TypeScript compiler before execution.
Features:
Automatic Code Generation: LLM writes JavaScript code to accomplish your task
TypeScript Validation: Generated code is validated with TypeScript compiler API (with up to 3 retries if validation fails)
Type-Safe API: Generated TypeScript definitions provide autocomplete and type checking for all MCP tools
Server Filtering: Optional
servers
parameter limits which MCP servers are available to reduce context size and improve code quality$results Integration: Generated code results are automatically stored in
$results
array
When using as an MCP tool, strongly recommend specifying the servers
parameter to limit context:
Evaluate Function Expressions with MCP Tools
Run as MCP Server
Architecture
MCPMan operates in two modes:
Server Mode
Acts as an MCP server exposing multiple tools:
code
- Generate and execute JavaScript code from natural language descriptions using LLMs with TypeScript validationeval
- Execute JavaScript with access to all MCP toolsinvoke
- Batch invoke tools with parallel/sequential executionlist_servers
- List connected servers and their toolshelp
- Get documentation for specific toolsinstall
- Dynamically add new servers
Connects to multiple upstream MCP servers
Transparently forwards root directory information from clients to upstream servers
Provides unified JavaScript execution environment with $results array
CLI Mode
Direct command-line interface for server management
Execute JavaScript code with MCP tool access
Configure and test server connections
Configuration
Configuration is stored in ~/.mcpman/settings.json
:
CLI Commands
JavaScript Execution Environment
Inspired by - Instead of directly calling MCP tools, LLMs write code that interacts with a JavaScript API. This approach leverages LLMs' strength in writing code and enables more sophisticated tool chaining and composition.
In the eval environment, each configured server is available as a global object. All code must be provided as function expressions:
$results Array
When using the eval
or invoke
tools as an MCP client, results are automatically stored in the $results
array. Each tool invocation appends its result to this array, and you can access previous results by index:
Batch Tool Invocation
The invoke
tool allows you to call multiple MCP tools in batch mode:
Logging
When running in server mode, MCPMan redirects console output to log files:
Main log:
~/.mcpman/mcpman.log
- All console.log/error/warn/info outputTrace log:
~/.mcpman/trace.log
- Detailed trace logging (requiresMCPMAN_TRACE=1
)
Logs use synchronous writes to ensure all messages are captured, even during crashes. Error objects are formatted with full stack traces and causes.
Development
Setup
Available Scripts
Code Style
TypeScript with strict type checking
Biome for linting and formatting (100 char line width, 2-space indents)
Zod schemas for configuration validation
Pre-commit hooks ensure code quality
MCP Protocol Support
MCPMan fully supports the MCP protocol including:
Tool discovery and execution
Root directory management (transparent proxy)
Request/response handling
Error propagation
OAuth 2.1 authentication for HTTP transports
License
MIT
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol server manager that acts as a proxy/multiplexer, enabling connections to multiple MCP servers simultaneously and providing JavaScript code execution with access to all connected MCP tools. Supports both stdio and HTTP transports with OAuth authentication, batch tool invocation, and dynamic server management.