Run MCP Auditor as a standalone MCP server that can be connected to by Claude Desktop or other MCP clients.
Global installation (recommended for server mode):
npm install -g mcp-auditor
From source:
git clone https://github.com/algovate/mcp-auditor.git
cd mcp-auditor
npm install
npm run build
export MCP_WRAPPED_SERVER_COMMAND=npx
export MCP_WRAPPED_SERVER_ARGS="-y,@modelcontextprotocol/server-filesystem,/tmp"
export MCP_LOG_FILE=./logs/mcp-server.log
mcp-auditor
# or
mcp-auditor-server
export MCP_CONFIG_FILE=./config.json
mcp-auditor
export MCP_WRAPPED_SERVER_COMMAND=npx
export MCP_WRAPPED_SERVER_ARGS="-y,@modelcontextprotocol/server-filesystem,/tmp"
export MCP_LOG_FILE=./logs/mcp-server.log
npm start
| Variable | Description | Required | Default |
|---|---|---|---|
MCP_CONFIG_FILE |
Path to JSON config file | No | - |
MCP_SERVER_NAME |
Name of the server | No | mcp-auditor-server |
MCP_SERVER_VERSION |
Version of the server | No | 1.0.0 |
MCP_WRAPPED_SERVER_COMMAND |
Command to run wrapped server | Yes* | - |
MCP_WRAPPED_SERVER_ARGS |
Comma-separated args | No | - |
MCP_WRAPPED_ENV_* |
Environment vars for wrapped server | No | - |
MCP_LOG_FILE |
Path to log file | No | ./logs/mcp-server.log |
MCP_LOG_TOOL_CALLS |
Log tool calls | No | true |
MCP_LOG_TOOL_RESULTS |
Log tool results | No | true |
MCP_LOG_APPEND |
Append to log file | No | true |
MCP_LOG_FORMAT |
Log format (structured/jsonrpc) | No | structured |
* Required unless using MCP_CONFIG_FILE
Create a config.json file:
{
"name": "my-mcp-wrapper-server",
"version": "1.0.0",
"wrappedServer": {
"serverCommand": "npx",
"serverArgs": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"],
"serverEnv": {
"DEBUG": "false"
},
"logFilePath": "./logs/mcp-server.log",
"logToolCalls": true,
"logToolResults": true,
"logAppend": true,
"logFormat": "structured"
}
}
See config.example.json for a complete example.
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"wrapped-filesystem": {
"command": "node",
"args": ["/path/to/mcp-auditor/dist/server.js"],
"env": {
"MCP_WRAPPED_SERVER_COMMAND": "npx",
"MCP_WRAPPED_SERVER_ARGS": "-y,@modelcontextprotocol/server-filesystem,/Users/yourname/Documents",
"MCP_LOG_FILE": "/Users/yourname/logs/mcp-wrapper.log"
}
}
}
}
Or using a config file:
{
"mcpServers": {
"wrapped-filesystem": {
"command": "node",
"args": ["/path/to/mcp-auditor/dist/server.js"],
"env": {
"MCP_CONFIG_FILE": "/path/to/your/config.json"
}
}
}
}
You can communicate with the server directly via stdin/stdout:
# Start the server
npm run dev:server
# Send JSON-RPC requests via stdin
# Example: List tools
{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}
# Call a tool
{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"read_file","arguments":{"path":"/tmp/test.txt"}}}
# With environment variables
export MCP_WRAPPED_SERVER_COMMAND=npx
export MCP_WRAPPED_SERVER_ARGS="-y,@modelcontextprotocol/server-filesystem,/tmp"
npm run dev:server
# With config file
export MCP_CONFIG_FILE=./config.example.json
npm run dev:server
Use the MCP Inspector tool to test your server:
npx @modelcontextprotocol/inspector node dist/server/server.js
Set environment variables in the inspector UI or create a config file.
The server uses stdio transport, making it compatible with:
All capabilities from the wrapped server are exposed:
tools/list returns all tools from wrapped servertools/call forwards tool requests to wrapped serverresources/list returns all resources from wrapped serverresources/read forwards resource read requests to wrapped serverprompts/list returns all prompts from wrapped serverprompts/get forwards prompt get requests to wrapped serverAll I/O operations are logged to the specified file:
Log Formats:
Configure via:
export MCP_WRAPPED_SERVER_COMMAND=npx
export MCP_WRAPPED_SERVER_ARGS="-y,@modelcontextprotocol/server-filesystem,/Users/yourname/Documents"
export MCP_LOG_FILE=./logs/filesystem.log
npm start
export MCP_WRAPPED_SERVER_COMMAND=node
export MCP_WRAPPED_SERVER_ARGS="./my-custom-server.js,--port,3000"
export MCP_WRAPPED_ENV_API_KEY=your-secret-key
export MCP_WRAPPED_ENV_DEBUG=true
export MCP_LOG_FILE=./logs/custom-server.log
npm start
export MCP_WRAPPED_SERVER_COMMAND=python
export MCP_WRAPPED_SERVER_ARGS="-m,my_mcp_module"
export MCP_WRAPPED_ENV_PYTHONPATH=./src
export MCP_LOG_FILE=./logs/python-server.log
npm start
MCP_WRAPPED_SERVER_COMMAND is set or config file existstools/listMCP_LOG_FILE path is writableMCP_LOG_TOOL_CALLS and MCP_LOG_TOOL_RESULTS are not set to falseMCP Client (e.g. Claude)
↕ stdio (JSON-RPC)
MCP Wrapper Server
↕ stdio (JSON-RPC) → Logs to file
Wrapped MCP Server
The wrapper server:
MIT