Skip to content

Code cleanup and improvements#18

Merged
dgellow merged 8 commits intomainfrom
sam/cleanup
Jul 1, 2025
Merged

Code cleanup and improvements#18
dgellow merged 8 commits intomainfrom
sam/cleanup

Conversation

@dgellow
Copy link
Member

@dgellow dgellow commented Jul 1, 2025

Removed circular dependencies, made session timeouts configurable, added trace logging for debugging, and eliminated runtime type assertions.

dgellow added 3 commits July 1, 2025 10:49
Move capability discovery from Client to StdioSession to break the circular
dependency where session.GetClient().AddToMCPServerWithSession(session) was
called. This cleaner design separates concerns and makes the code more
maintainable.
Add configurable session timeouts to replace hardcoded values. The config now
supports 'sessions.timeout' and 'sessions.cleanupInterval' using Go duration
format (e.g., '5m', '30s'). Custom JSON unmarshaling ensures only duration
strings are accepted, not numeric values.
Update inline package to properly handle time.Duration timeouts after the
config changes. Remove unused time import and fix test cases to use duration
strings instead of numeric values.
dgellow added 5 commits July 1, 2025 10:50
- Remove incorrect guideline about extracting interfaces to internal/interfaces
- Update Makefile for better formatting
- Fix documentation examples to use correct syntax
- Update integration test config
Allows configuring session timeout, cleanup interval, and max sessions
per user through the config file instead of hardcoded values.
Changed tokenStore from UserTokenStore to Storage interface to avoid
runtime type assertions. This makes the code cleaner and type-safe.
@dgellow dgellow changed the title Cleanup Code cleanup and improvements Jul 1, 2025
@dgellow dgellow marked this pull request as ready for review July 1, 2025 10:40
@dgellow dgellow enabled auto-merge (rebase) July 1, 2025 10:41
@dgellow dgellow merged commit 64d394f into main Jul 1, 2025
1 check passed
@dgellow dgellow deleted the sam/cleanup branch July 1, 2025 10:42
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