Skip to content

mcp: add load_source tool and make archive argument optional#624

Merged
rusq merged 3 commits intomasterfrom
mcp-2
Feb 25, 2026
Merged

mcp: add load_source tool and make archive argument optional#624
rusq merged 3 commits intomasterfrom
mcp-2

Conversation

@rusq
Copy link
Copy Markdown
Owner

@rusq rusq commented Feb 25, 2026

Summary

  • Optional archive argument: slackdump mcp can now start without an archive path. If no <archive> argument is given, the server starts with no active source and logs an advisory; an agent can then call load_source to open one at runtime.
  • load_source tool: new MCP tool that lets a connected agent open (or switch) the active Slackdump archive without restarting the server. Only one source is held at a time; the previous one is closed before the new one is opened.
  • Thread safety: Server.src is guarded by a sync.RWMutex — read-lock for all data handlers, write-lock for loadSource().
  • Functional options: Server now uses Option / WithSource() / WithLogger() / WithSourceLoader() — no required constructor arguments.
  • source.SourceResumeCloser: composite interface (Sourcer + Resumer + io.Closer) used as the type for Server.src; MockSourceResumeCloser generated in source/mock_source.
  • Docs updated: cmd/slackdump/internal/mcp/assets/mcp.md fully rewritten (optional arg, all tool parameters documented, integration examples for stdio/HTTP/load_source, corrected listen address 127.0.0.1:8483).
  • copilot-instructions.md overhauled: correct Go version, module path v4, full package tree, MCP server section, command help-page convention.
  • Makefile: fixed stale PKG=.../v3v4.
  • All existing tests pass; new tests cover load_source handler and nil-source guards on all data handlers.

@rusq rusq merged commit 3bb630c into master Feb 25, 2026
3 checks passed
@rusq rusq deleted the mcp-2 branch February 25, 2026 04:57
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