Cover image
Try Now
2025-04-01

console.log适用于您的stdio mcp服务器

3 years

Works with Finder

1

Github Watches

0

Github Forks

7

Github Stars

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");
}

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Lists Tailwind CSS classes in monospaced font

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • Yasir Eryilmaz
  • AI scriptwriting assistant for short, engaging video content.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

  • jae-jae
  • MCP服务器使用剧作《无头浏览器》获取网页内容。

    Reviews

    1 (1)
    Avatar
    user_WcjGeH0d
    2025-04-15

    The Azure AI Agent Service MCP Server by azure-ai-foundry is an exceptional product that has significantly streamlined my workflow. Its integration capabilities are top-notch and offer seamless performance. The product's link provides detailed information for easy setup and utilization. I highly recommend it to anyone looking to enhance their AI operations effectively.