Skip to content

[Bug]: Incorrect logging capability declaration causing connection errors in MCP Inspector #454

@ronantakizawa

Description

@ronantakizawa

Version

0.2.0

App

  • Cursor
  • Windsurf
  • VSCode
  • VSCode Insiders
  • Claude Desktop
  • Other

Affected Models (if applicable)

  • Claude 3.5 Sonnet
  • Claude 3.7 Sonnet
  • GPT-4a
  • o4-mini
  • Other

Bug Description

The MongoDB MCP Server incorrectly declares logging capability without implementing the required logging functionality, causing connection errors in MCP clients like the MCP Inspector.

Original issue: modelcontextprotocol/inspector#670

Problem

Current behavior:

  • MongoDB MCP Server declares "logging": {} capability in initialization response
  • Server does NOT implement logging/setLevel method
  • Server does NOT emit notifications/message log notifications
  • MCP Inspector attempts to call logging/setLevel based on declared capability
  • Server returns MethodNotFound error
  • Inspector shows connection as "failed" despite successful connection

Expected behavior:

  • Server should only declare capabilities it actually implements
  • Connection should show as successful when server is working properly

Root Cause

File: src/server.ts:51

// ❌ INCORRECT - declares logging capability without implementing it
this.mcpServer.server.registerCapabilities({
  logging: {}, // Should not be declared
  resources: { listChanged: true, subscribe: true }
});

Proposed Fix

Remove the logging: {} capability declaration:

// ✅ CORRECT - only declare implemented capabilities
this.mcpServer.server.registerCapabilities({
  resources: { listChanged: true, subscribe: true }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions