-
Notifications
You must be signed in to change notification settings - Fork 4
3 mcp server sse and tool endpoints #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6e93684 to
6c9d453
Compare
🦙 MegaLinter status:
|
| Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 1 | 0 | 0.07s | |
| ✅ API | spectral | 1 | 0 | 2.37s | |
| jscpd | yes | 5 | 3.08s | ||
| revive | 21 | 1 | 70.21s | ||
| markdownlint | 1 | 0 | 2 | 3.9s | |
| ✅ MARKDOWN | markdown-link-check | 1 | 0 | 5.11s | |
| ✅ MARKDOWN | markdown-table-formatter | 1 | 1 | 0 | 2.26s |
| ✅ REPOSITORY | checkov | yes | no | 18.34s | |
| devskim | yes | 48 | 1.21s | ||
| ✅ REPOSITORY | dustilock | yes | no | 0.02s | |
| ✅ REPOSITORY | gitleaks | yes | no | 0.18s | |
| ✅ REPOSITORY | git_diff | yes | no | 0.01s | |
| ✅ REPOSITORY | grype | yes | no | 19.73s | |
| ✅ REPOSITORY | kics | yes | no | 17.08s | |
| ✅ REPOSITORY | secretlint | yes | no | 0.73s | |
| ✅ REPOSITORY | syft | yes | no | 1.35s | |
| ✅ REPOSITORY | trivy | yes | no | 5.14s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | 0.07s | |
| ✅ REPOSITORY | trufflehog | yes | no | 3.1s | |
| ✅ YAML | prettier | 3 | 3 | 0 | 5.19s |
| ✅ YAML | v8r | 3 | 0 | 24.88s | |
| ✅ YAML | yamllint | 3 | 0 | 4.0s |
See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff
- Added SQLite database support for managing MCP servers and tools. - Introduced event bus for handling server addition, removal, and tool updates. - Created backend service for CRUD operations on MCP servers. - Implemented updater service for periodic polling of MCP servers and fetching tools. - Added API handlers for managing MCP servers and exporting configuration. - Included tests for backend service and database interactions. This commit establishes the foundational architecture for the agent-browser application, enabling dynamic management of MCP servers and their associated tools.
…s in OpenAPI documentation
eb1ef7c to
e5e22ec
Compare
Implements MCP server with hello_world tool and client with multi-server connection support
- Add MCP server proxy that aggregates tools from remote servers - Implement transparent proxying of tool calls to remote servers - Copy tool schemas and parameters correctly from remote tools - Set SSE read timeout to 1200 seconds for long-running operations - Remove complex reconnection logic in favor of native SSE persistence The MCP server now acts as a proxy that: 1. Connects to configured remote MCP servers 2. Aggregates their available tools 3. Exposes these tools locally with proper parameter schemas 4. Proxies tool calls to the appropriate remote server Additionally, fixes SSE connection stability by properly configuring timeouts and trusting the protocol's built-in persistence, rather than implementing custom reconnection logic.
- Health monitoring (30s) & auto-recovery with exp backoff - Smart tool management based on server state - Continues operation during remote failures - Moved to config.go with fx integration - Consolidated to NewMCPComponents Breaking: NewMCPServer/SSEServer -> NewMCPComponents
- Verify connection health before reuse with ListTools - Use existing session context for health checks - Add debug logging for health check failures
e5e22ec to
0fce5e7
Compare
Refactor the MCP ConnectionManager to subscribe to backend events (ServerAdded, ServerRemoved) instead of polling the API for server lists. Introduce internal state (`permanentlyRemoved`) to correctly handle explicit server removal and prevent background reconnection goroutines from interfering. Add and publish a new `ServerStatusChangedEvent` from the backend service (`UpdateMCPServerStatus`) when a server's connection status is updated in the database. This allows listeners (e.g., UI components) to react directly to connectivity changes.
6a6cd63 to
a8f5c03
Compare
…gration test of mcp + linting fixes
Removes the API client dependency from ConnectionManager. ConnectionManager now publishes ServerStatusChanged and ToolsUpdated events directly to the event bus instead of calling back into the Web API. BackendService subscribes to these events to handle DB updates. InitModule now publishes ServerAddedEvent for existing servers at startup to ensure ConnectionManager connects to them.
- Performs cleanup (cancel/close) of old MCP connections asynchronously in a separate goroutine within `connectToRemoteServer` to prevent interference with newly established connections. This resolves the immediate context cancellation and rapid reconnect loop observed previously. - Defines `ToolsProcessedInDBEvent` triggered by `BackendService` after successfully processing tools from a `ToolsUpdatedEvent`. - `ConnectionManager` now subscribes to `ToolsProcessedInDBEvent` and calls `refreshMCPServerTools` only upon receiving this event, decoupling the internal MCP server tool update from the database update process. - Removes the direct call to `refreshMCPServerTools` from `updateServerTools` in `ConnectionManager`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 29 out of 31 changed files in this pull request and generated 1 comment.
Files not reviewed (2)
- Makefile: Language not supported
- go.mod: Language not supported
Comments suppressed due to low confidence (1)
internal/config/exporter_test.go:64
- The test 'TestGenerateConfigJSON' is currently skipped. Consider adding tests to cover the configuration export functionality to ensure that the exported JSON meets the expected structure and content.
t.Skip("Skipping due to issue with backend.Service interface")
| { | ||
| name: "Local Test Server", | ||
| url: "http://0.0.0.0:8001/sse", | ||
| description: "Local MCP test server", |
Copilot
AI
Apr 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In InitModule, a default server is added with a 'description' field, but the exported configuration only includes name and URL. Consider aligning the default server structure with the ExportedServer type or updating the export logic to include the description if needed.
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
|
🎉 This PR is included in version 1.0.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
No description provided.