Skip to content

v1.7.16: Release version 1.7.16 of the tinystruct framework

Choose a tag to compare

@m0ver m0ver released this 12 Jan 17:20
feat: improve session management and refactor MCP implementation

BREAKING CHANGES:
- Renamed MCPServerApplication to MCPServer for consistency
- Made AbstractMCPResource.executeLocally() abstract, requiring implementations
- Removed registerToolMethods() - now integrated into registerTool()

Session Management:
- Add multi-session support with session-specific state tracking
- Implement ThreadLocal-based session ID management
- Add Mcp-session-id header handling for session persistence
- Replace single sessionState with per-session state map
- Properly cleanup session context in finally blocks

Client Improvements:
- Refactor HTTP communication to use URLRequest/URLResponse
- Improve SSE event stream handling with functional approach
- Add session ID capture and reuse across requests
- Better error handling and connection management

Protocol & Standards:
- Update protocol version constant to PROTOCOL_VERSION
- Standardize server name to "tinystruct-mcp"
- Add SESSION_ID constant to Http class
- Use Header enum for standard HTTP headers
- Remove TOKEN_PARAM in favor of Authorization header

Code Quality:
- Add missing executeLocally() implementations in MCPDataResource and MCPTool
- Improve documentation and formatting
- Remove unused mimeType variable in resource discovery
- Better separation of concerns in request handling

Examples & Documentation:
- Update README with new API usage patterns
- Add batch request and error handling examples
- Document session management features
- Update all code examples to use MCPServer
- Add comprehensive usage examples for CLI client