Skip to content

Completions request for resource URIs should includes previously-resolved variables #597

@connor4312

Description

@connor4312

The Github MCP server provides resource templates that look like this (screenshot from VS Code):

Image

In this instance, we ask the the user for each variable to the URI template in-order and want to provide completions.

However, the MCP completions request doesn't give the client a way to tell the server what was previously completed in the template. So the user can fill in the "owner" and get completions well enough, but to complete the "repo", the MCP server has no idea who the "owner" is and cannot provide any reasonable completions.

I suggest something like the following addition:

export interface CompleteRequest extends Request {
  method: "completion/complete";
  params: {
    ref: PromptReference | ResourceReference;
    /**
     * The argument's information
     */
    argument: {
      /**
       * The name of the argument
       */
      name: string;
      /**
       * The value of the argument to use for completion matching.
       */
      value: string;
    };
+
+    /**
+     * Previously-resolved variables in a URI template. The keys of the object
+     * are be the template's variable expressions including surrounding braces.
+     */
+    resolved?: { [key: string]: string };
  };
}

Metadata

Metadata

Assignees

No one assigned

    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