Proposal: Events - new protocol element Event - list-topics, subscribe, unsubscribe, list-events · Issue #611 · modelcontextprotocol/modelcontextprotocol · GitHub
Skip to content

Proposal: Events - new protocol element Event - list-topics, subscribe, unsubscribe, list-events #611

Description

@yinzara

As described informally in #179

I propose a new MCP protocol element:

Event

As MCP becomes the senses of our LLMs, we're lacking the ability to receive feedback from our environment. We need to be able to SMELL!

Events should be as simple as possible to keep our LLMs understanding them completely.

public interface Event {
   topic: string // the topic name of the event
   ts: number // timestamp of when the event occurred for real
   body: object // the body of the event
}

export interface Topic {
  name: string
  description: string
  bodySchema: {
    type: "object";
    properties?: { [key: string]: object };
    required?: string[];
  }
 }
}

export interface ListTopicsRequest {}

export interface ListTopicsResponse {
  topics: Topics[]
}

export interface SubscribeRequest {
  topic: string
}
export interface SubscribeResponse {}
export interface UnsubscribeRequest {
  topic: string
}

export interface ListEventsRequest {
  linger?: number // the amount of time it waits for events to collect before returning
}
export interface ListEventsResponse {
  events: Event[] // the events generated since the last call to ListEvents
}

We could also support an event JSON rpc message if the connection support streaming (STDIO or HTTP streaming) otherwise its long polling for the agents. That's ok. We've done it forever with CometD.

With the inclusion of this functionality, LLMs could be told IF THIS THEN THAT type logic that uses tools and subscriptions and gets feedback through events.

I want to call out the obvious ethical concerns of giving an AI LLM the ability to react to environment and tools to affect said environment before it's brought up.

I would love to know how best we can make sure those concerns are addressed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions