Skip to content

feat(mcp): support templates and completion - #32943

Closed
Nomadcxx wants to merge 4 commits into
anomalyco:devfrom
Nomadcxx:templates-completion
Closed

Nomadcxx wants to merge 4 commits into
anomalyco:devfrom
Nomadcxx:templates-completion

Conversation

@Nomadcxx

Copy link
Copy Markdown
Contributor

Issue for this PR

Refs #28567. Stacked on #32936.

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds the resource templates / completion slice for MCP.

This adds resources/templates/list support through the MCP service, using the same pagination path as tools, prompts, and resources.

It also adds completion/complete plumbing for prompt refs and resource template refs. This is intentionally service-level only for now; it does not add dropdown UI or decide how completions should be surfaced in the TUI.

How did you verify your code works?

  • bun test --timeout 30000 test/mcp/lifecycle.test.ts from packages/opencode
  • bun typecheck from packages/opencode
  • bun prettier --check packages/opencode/src/mcp/index.ts packages/opencode/src/mcp/catalog.ts packages/opencode/test/mcp/lifecycle.test.ts packages/opencode/test/session/prompt.test.ts packages/opencode/test/session/snapshot-tool-race.test.ts

Screenshots / recordings

N/A, no UI change.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@Nomadcxx

Copy link
Copy Markdown
Contributor Author

Folded the error-path test commit from the fork follow-up into this branch (commit 500619a). Tests: bun test --timeout 30000 test/mcp/lifecycle.test.ts → 43 pass.

@Nomadcxx
Nomadcxx force-pushed the templates-completion branch from 3e6bba5 to ab316fa Compare June 26, 2026 12:38
@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant