MCP Server Logger
@mlshv
关于 MCP Server Logger
console.log for your stdio MCP server
基本信息
配置
使用下面的配置,将此服务器添加到你的 MCP 客户端。
{
"mcpServers": {
"mcps-logger": {
"command": "npx",
"args": [
"mcps-logger"
]
}
}
}工具
未检测到工具
工具是从 README 中自动提取的。维护者可以在 ## Tools 标题下列出工具,即可填充这部分内容。
概览
What is MCP Server Logger?
MCP Server Logger provides a way to use console.log and other console methods in an MCP server using stdio transport without breaking protocol communication. It patches console.log, warn, error, and debug to redirect their output to a separate terminal. This project is for developers building or debugging MCP servers with stdio transport.
How to use MCP Server Logger?
First run npx mcps-logger in a terminal where you want to see logs. Then install the package (npm install mcps-logger) and add import "mcps-logger/console" to your MCP server’s entry file. For development‑only usage, wrap the import in a NODE_ENV !== "production" condition.
Key features of MCP Server Logger
- Patches console.log, warn, error, and debug
- Redirects logs to a separate terminal
- Prevents JSON parse errors in MCP Inspector
- Simple one-line import to activate
- Supports conditional use in development mode
Use cases of MCP Server Logger
- Debugging MCP servers while they communicate via stdio
- Separating log output from the protocol message stream
- Avoiding SyntaxError from stray console.log calls in MCP Inspector
- Using familiar console methods without breaking MCP transport
FAQ from MCP Server Logger
What problem does MCP Server Logger solve?
When stdio transport is used, console.log calls produce text that the MCP client cannot parse as JSON, causing SyntaxError in tools like MCP Inspector. The logger redirects console messages to a separate terminal, preserving protocol integrity.
How do I install and use MCP Server Logger?
Install via npm (npm install mcps-logger), then import "mcps-logger/console" in your server’s entry file. Before starting the server, run npx mcps-logger in a separate terminal to see the redirected logs.
Can I use MCP Server Logger in production?
The README suggests using it only in development mode (e.g., if (process.env.NODE_ENV !== "production")). It is designed as a debugging aid, not a production logging solution.
What console methods does it patch?
It patches log, warn, error, and debug.
Do I need to modify existing console.log calls to use it?
No. The import automatically patches all console methods so existing calls are redirected without source code changes.
其他 分类下的更多 MCP 服务器
MaxKB
1Panel-dev🔥 MaxKB is an open-source platform for building enterprise-grade agents. 强大易用的开源企业级智能体平台。
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
ACI: Open-Source Infra to Power Unified MCP Servers
aipotheosis-labsACI.dev is the open source tool-calling platform that hooks up 600+ tools into any agentic IDE or custom AI agent through direct function calling or a unified MCP server. The birthplace of VibeOps.
Mobile Mcp
mobile-nextModel Context Protocol Server for Mobile Automation and Scraping (iOS, Android, Emulators, Simulators and Real Devices)
🪟 Windows-MCP
CursorTouchMCP Server for Computer Use in Windows
评论