Commit 684fa0e
authored
Enhance configuration management and signal handling in mcpproxy (#2)
* Enhance configuration management and signal handling in mcpproxy
- Added automatic creation of default configuration file and directory on first-time setup.
- Improved configuration loading priority with fallback mechanisms.
- Implemented robust signal handling for graceful shutdown, including context-aware operations and logging.
- Updated server background operations to respect cancellation context for better resource management.
* Refactor cache and logging structures for consistency
- Renamed CacheRecord to Record and CacheStats to Stats for clarity.
- Updated related methods and types to reflect the new naming conventions.
- Improved error handling in various functions by deferring error checks.
- Enhanced logging synchronization to ensure proper resource management.
* Refactor function signatures and improve error handling
- Updated function signatures in main.go and manager.go for clarity by removing unused parameters.
- Enhanced error handling in mcp.go and client.go by ensuring proper return values.
- Introduced constants for operation names in mcp.go to improve readability and maintainability.
- Removed deprecated test fixtures in fixtures_test.go to streamline the codebase.
* Refactor configuration defaults and improve error handling
- Introduced a constant for the default port in config.go to enhance maintainability.
- Updated DefaultConfig to use the new constant for setting the Listen address.
- Improved error handling in loader.go by changing file write permissions for security.
- Added a testServerConnection method in e2e_test.go to verify server readiness more effectively.
- Refactored function signatures in various files for clarity and consistency.
* Enhance cross-platform build configuration and testing documentation
- Updated .goreleaser.yaml to define builds for Linux, Windows, and macOS with appropriate settings.
- Added Windows Testing Guide to README.md for improved clarity on running tests in Windows environments.
- Modified GitHub Actions workflows to support platform-specific test execution and binary builds.
- Introduced scripts for running unit tests on Windows with proper argument handling.
- Refactored main.go to support tray functionality conditionally based on build tags.
* Refactor GitHub Actions workflows to streamline build configurations
- Removed redundant CGO_ENABLED environment variable from jobs in e2e-tests.yml.
- Added CGO_ENABLED=0 to build commands in unit-tests.yml for cross-compilation consistency.
- Enhanced logging in manager.go by changing warning to debug level for disconnected clients.
- Optimized GetTotalToolCount method to minimize network calls during shutdown.
* Improve e2e test logging and concurrency handling
- Updated e2e-tests.yml to run mcpproxy in the background for log file creation.
- Enhanced e2e_test.go to count log messages more reliably and verify goroutine presence.
- Adjusted assertions to allow for tolerance in concurrent logging scenarios.
* Enhance e2e test setup for cross-platform compatibility
- Updated e2e-tests.yml to build mcpproxy binary for both Windows and Unix environments.
- Modified TestE2E_MCPProxyWithLogging to dynamically determine binary name based on OS.
- Improved TestE2E_ConcurrentLogging to use unique log filenames and adjusted concurrency settings for Windows.
* Refactor mcpproxy process handling in e2e-tests.yml
- Updated e2e-tests.yml to store the mcpproxy process in a variable before stopping it, improving clarity and maintainability of the workflow.
* Update log path and compliance check in e2e-tests.yml
- Changed log path to use the LOCALAPPDATA environment variable for better compatibility.
- Updated compliance check to match specific OS standard compliance information.
* Update log output in e2e-tests.yml for Windows compatibility
- Changed log path output to use the LOCALAPPDATA environment variable.
- Updated OS standard message to reflect Windows Application Data Guidelines.
* Refactor Windows log testing in e2e-tests.yml for improved error handling
- Updated PowerShell script to include try-catch for mcpproxy process management.
- Reorganized log directory and file existence checks for clarity and reliability.
- Enhanced log content verification to ensure compliance with OS standards.
* Refactor server context handling in server.go to prevent race conditions
- Updated background initialization methods to use read locks for accessing server context.
- Added cancellation of the old context in StartServer to avoid potential race conditions.
- Improved tool re-indexing logic after configuration reload to ensure thread safety.
* Add MCP Schema Compatibility Summary and Update Gemini Compatibility Documentation
- Introduced COMPATIBILITY_SUMMARY.md detailing schema changes for `upstream_servers` and `call_tool` tools, transitioning to JSON string parameters for improved compatibility.
- Created GEMINI_COMPATIBILITY.md to address known issues with Gemini 2.5 Pro Preview 06-05 and provide updated usage examples and recommendations.
- Refactored mcp.go to support new JSON string parameters while maintaining backward compatibility with legacy object formats.
* Update compatibility documentation and refactor MCP parameters to JSON format
- Modified COMPATIBILITY_SUMMARY.md to include changes for `env`, `headers`, and `patch` parameters to JSON strings.
- Updated GEMINI_COMPATIBILITY.md with examples reflecting the new JSON string format for `upstream_servers`.
- Refactored mcp.go to handle new JSON string parameters while ensuring backward compatibility with legacy formats.1 parent d36728a commit 684fa0e
37 files changed
Lines changed: 1581 additions & 687 deletions
File tree
- .github/workflows
- cmd/mcpproxy
- internal
- cache
- config
- index
- logs
- server
- storage
- tray
- truncate
- upstream
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
48 | 61 | | |
49 | 62 | | |
50 | 63 | | |
| |||
77 | 90 | | |
78 | 91 | | |
79 | 92 | | |
80 | | - | |
81 | 93 | | |
82 | 94 | | |
83 | 95 | | |
| |||
89 | 101 | | |
90 | 102 | | |
91 | 103 | | |
| 104 | + | |
| 105 | + | |
92 | 106 | | |
93 | 107 | | |
94 | 108 | | |
| |||
112 | 126 | | |
113 | 127 | | |
114 | 128 | | |
115 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
116 | 140 | | |
117 | 141 | | |
118 | 142 | | |
| |||
133 | 157 | | |
134 | 158 | | |
135 | 159 | | |
136 | | - | |
137 | 160 | | |
138 | 161 | | |
139 | 162 | | |
| |||
164 | 187 | | |
165 | 188 | | |
166 | 189 | | |
167 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
168 | 200 | | |
169 | 201 | | |
170 | 202 | | |
| |||
175 | 207 | | |
176 | 208 | | |
177 | 209 | | |
178 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
179 | 215 | | |
180 | 216 | | |
181 | 217 | | |
| |||
212 | 248 | | |
213 | 249 | | |
214 | 250 | | |
215 | | - | |
| 251 | + | |
216 | 252 | | |
217 | 253 | | |
218 | | - | |
219 | | - | |
| 254 | + | |
| 255 | + | |
220 | 256 | | |
221 | 257 | | |
222 | | - | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
223 | 265 | | |
224 | 266 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 267 | + | |
| 268 | + | |
257 | 269 | | |
258 | 270 | | |
259 | 271 | | |
260 | 272 | | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
261 | 303 | | |
262 | 304 | | |
263 | 305 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | | - | |
| 45 | + | |
| 46 | + | |
43 | 47 | | |
44 | 48 | | |
45 | 49 | | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
51 | 65 | | |
52 | 66 | | |
53 | 67 | | |
| |||
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
0 commit comments