Skip to content

feat: add MCP Completions for tool argument autocomplete #52

Description

@ichoosetoaccept

Problem

When agents call tools like list_review_comments or reply_to_comment, they must know the exact PR number, repo name, or thread ID. There is no autocomplete — the agent either knows the value or guesses.

Proposal

Use MCP Completions to provide autocomplete suggestions for tool arguments:

  • PR numbers — suggest recent open PRs for the current repo
  • Repo names — suggest repos the user has access to (from gh CLI context)
  • Thread IDs — suggest unresolved thread IDs for a given PR
  • Reviewer names — suggest known AI reviewers (Unblocked, Devin, CodeRabbit)
  • Status filters — suggest resolved / unresolved

Completions are triggered as the user fills in arguments, providing contextual suggestions based on prior input.

MCP spec support

MCP Completions are part of the MCP specification. Servers can register completion providers for prompt arguments and resource template arguments. Clients that support completions will provide autocomplete UX automatically.

Implementation

FastMCP v3 supports completions. Register completion providers that query GitHub for contextual suggestions:

@mcp.completion("pr_number")
async def complete_pr_number(argument, context):
    # Fetch recent open PRs via gh CLI
    prs = await gh.list_open_prs(repo)
    return [pr["number"] for pr in prs if str(pr["number"]).startswith(argument.value)]

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedBlocked on external dependency

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions