Fix code quality issues in LiteRT-LM MCP server#6
Merged
groupthinking merged 6 commits intomainfrom Jan 29, 2026
Merged
Conversation
Merged
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add LiteRT-LM MCP Server
Fix code quality issues in LiteRT-LM MCP server
Jan 27, 2026
Base automatically changed from
add-litert-mcp-server-5067712973603937642
to
main
January 27, 2026 17:43
groupthinking
approved these changes
Jan 27, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refines the LiteRT-LM MCP server by cleaning up unused/dead code, tightening input validation, hardening error handling around subprocess and stdio, and aligning the README with the current text-only CLI capabilities.
Changes:
- Added explicit validation for
promptandbackendarguments, returning structured error responses for invalid input. - Simplified and clarified I/O handling in the main loop, including safer writer drain handling and a consistent fallback to
sys.stdout.write. - Updated README usage example and documentation to reflect text-only support and clarify multimodal limitations for the CLI wrapper.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| mcp-servers/litert-mcp/server.py | Cleans up unused code, adds prompt/backend validation, and hardens async stdio writing/drain error handling for more robust MCP request processing. |
| mcp-servers/litert-mcp/README.md | Updates the run_inference example and notes to emphasize text-only inference and clarify multimodal limitations of the current CLI wrapper. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses code review feedback on the LiteRT-LM MCP server implementation: unused imports, dead code, indentation inconsistencies, missing input validation, and error handling gaps.
Changes
Code cleanup:
subprocessimportInput validation & security:
["cpu", "gpu", "npu"]Error handling robustness:
writer = Noneon drain errors to prevent repeated failuresDocumentation:
Consistency:
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.