Skip to content

Implement missing MCP protocol methods #758

@crivetimihai

Description

@crivetimihai

Summary

The main JSON-RPC handler in mcpgateway/main.py has several MCP protocol methods that are currently stubbed out with empty {} responses. These need proper implementations to achieve full MCP protocol compliance.

Missing Methods

The following methods are marked with TODO: Implement methods at line 2305:

Resource Templates

  • resources/templates/list - Should list available resource templates

Roots Management

  • roots/* methods - Root-related operations (e.g., roots/list_changed)

Notifications

  • notifications/* methods - Progress notifications, cancellation, etc.

Sampling

  • sampling/* methods - Model sampling and interaction controls

Elicitation

  • elicitation/* methods - Methods for eliciting information from models

Completion

  • completion/* methods - Text/code completion functionality

Logging Control

  • logging/* methods - Dynamic logging level control and configuration

Current Status

These methods currently return empty objects {} which means:

  • Clients receive valid responses but no actual functionality
  • The gateway is not fully MCP protocol compliant
  • Some advanced MCP features are unavailable

Implementation Requirements

  1. Define proper schemas in mcpgateway/schemas.py for request/response models
  2. Create service methods in appropriate service classes
  3. Implement handlers in the main JSON-RPC router
  4. Add tests for each new method
  5. Update documentation with the new capabilities

File Locations

  • Main handler: mcpgateway/main.py:2305-2319
  • Related services: mcpgateway/services/
  • Schemas: mcpgateway/schemas.py

Acceptance Criteria

  • All stubbed methods have proper implementations
  • Unit tests cover new functionality
  • Integration tests verify MCP protocol compliance
  • Documentation updated
  • No breaking changes to existing API

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions