mcpField
M
MCP Server Logger

MCP Server Logger

Local
github.com/mlshvDeveloper Tools23Updated 82w ago

About MCP Server Logger

MCP Server Logger is a logging helper for stdio-transport MCP servers. It redirects console output to a separate terminal so log messages do not interfere with protocol communication, and is intended for development.

Key features

  1. 01Redirects console.log, warn, error and debug output
  2. 02Displays logs in a separate terminal
  3. 03Installed as the npm package mcps-logger
  4. 04Can be enabled only in development mode

Use cases

  1. 01Debugging stdio-based MCP servers
  2. 02Avoiding protocol errors caused by console.log in MCP Inspector

MCP support

The tool supports development of stdio-transport MCP servers and does not expose MCP tools or resources to clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"mcps-logger": {
"command": "npx",
"args": [
"-y",
"mcps-logger"
]
}
}
}
Run commandnpx -y mcps-logger

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npmmcps-logger

Tools

No tool list yet

Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.

Details

From the project README

MCP Server Logger

console.log for your stdio MCP server

npm version License: MIT

Why?

When developing an MCP (Model Context Protocol) server with stdio transport, console.log interferes with the protocol communication.

For example, this is what you normally get in MCP inspector npx @modelcontextprotocol/inspector when calling console.log in your MCP server code:

Error from MCP server: SyntaxError: Unexpected token S in JSON at position 0

Solution

This package patches the console methods (log, warn, error, debug) and redirects logs to a separate terminal.

https://github.com/user-attachments/assets/33ff367e-74b4-48e8-9f04-0bcafbad5e00

Usage

Start the logger in a terminal where you want to see the logs:

npx mcps-logger

Install the logger in your MCP server:

npm install mcps-logger

Add it to your MCP server entry file:

import "mcps-logger/console";

Or if you want to use in development mode only:

if (process.env.NODE_ENV !== "production") {
    import("mcps-logger/console");
}

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.