Skip to content

feat: periodic gRPC reflection refresh#8

Open
DanielPBak wants to merge 2 commits intomasterfrom
dbak/periodic-reflection-refresh
Open

feat: periodic gRPC reflection refresh#8
DanielPBak wants to merge 2 commits intomasterfrom
dbak/periodic-reflection-refresh

Conversation

@DanielPBak
Copy link

@DanielPBak DanielPBak commented Feb 26, 2026

Summary

  • When --reflect is used, a background goroutine re-polls gRPC server reflection every 5 minutes and atomically replaces tools via srv.SetTools()
  • Enables listChanged tool capability in reflection mode so connected clients are notified when tools change
  • Errors during refresh are logged to stderr; the previous tool set remains active on failure

Test plan

  • go build succeeds
  • go test ./... passes
  • TestRefreshReplacesTools — verifies that deploying a new RPC method causes it to appear after refresh
  • TestRefreshRemovesTools — verifies that removing a service causes its tools to disappear after refresh
  • Manual: run with --reflect against a gRPC server and observe periodic "refresh: N tools registered" messages on stderr

🤖 Generated with Claude Code

When using --reflect, re-poll the gRPC server every 5 minutes and
atomically replace the MCP tool set via srv.SetTools(). This means
deploying new AI-accessible RPCs no longer requires an MCP server
restart. Errors during refresh are logged to stderr and the previous
tool set remains active.

Extracts discoverDescriptors() and buildTools() from main() so the
refresh goroutine can reuse them. Enables listChanged tool capability
in reflection mode so connected clients are notified of changes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DanielPBak DanielPBak force-pushed the dbak/periodic-reflection-refresh branch 2 times, most recently from 936774a to 2da4295 Compare February 26, 2026 21:40
When using --reflect, re-poll the gRPC server every 5 minutes and
atomically replace the MCP tool set via srv.SetTools(). Deploying new
AI-accessible RPCs no longer requires an MCP server restart.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@DanielPBak DanielPBak force-pushed the dbak/periodic-reflection-refresh branch from 2da4295 to 78b7031 Compare February 26, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant