-
Notifications
You must be signed in to change notification settings - Fork 151
feat(tool): add miroapi support #76
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
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.
Pull Request Overview
This PR adds MiroAPI support to provide an internal caching layer for Serper Search and Jina Scrape functionality, enabling cost reduction and reproducible sandbox runs.
Key changes:
- Adds configurable base URLs for Serper and Jina APIs to support MiroAPI endpoints
- Introduces a new MCP server specifically for MiroAPI Serper integration
- Adds utility functions for URL decoding and markdown processing
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tool/mcp_servers/utils/url_unquote.py | New utility for safe URL unquoting and markdown link processing |
| src/tool/mcp_servers/utils/smart_request.py | Updated to support configurable base URLs and MiroAPI detection |
| src/tool/mcp_servers/searching_mcp_server.py | Enhanced to use MiroAPI when detected and pass base URLs to requests |
| src/tool/mcp_servers/miroapi_serper_mcp_server.py | New MCP server implementation for MiroAPI Serper integration |
| docs/mkdocs/mkdocs.yml | Added MiroAPI documentation to navigation |
| docs/mkdocs/docs/miro_api.md | New documentation for MiroAPI setup and configuration |
Comments suppressed due to low confidence (1)
src/tool/mcp_servers/searching_mcp_server.py:1
- [nitpick] The conditional logic for skipping Serper API when using MiroAPI should be moved closer to where it's used in the smart_request function. This placement in the searching_mcp_server creates confusion about the relationship between the two APIs.
# SPDX-FileCopyrightText: 2025 MiromindAI
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if env: | ||
| JINA_API_KEY = env.get("JINA_API_KEY", "") | ||
| SERPER_API_KEY = env.get("SERPER_API_KEY", "") | ||
| JINA_BASE_URL = env.get("JINA_BASE_URL", "https://r.jina.ai") |
Copilot
AI
Oct 13, 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.
The JINA_BASE_URL variable is extracted from env but not assigned when env is None. This creates inconsistent behavior between the two branches - consider setting a default value in the else block as well.
|
|
||
| try: | ||
| # Build payload with all supported parameters | ||
| payload: dict[str, Any] = { |
Copilot
AI
Oct 13, 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.
Use the imported Dict type from typing instead of the built-in dict for consistency with the function signature and other type annotations in the file.
| payload: dict[str, Any] = { | |
| payload: Dict[str, Any] = { |
gali-leilei
left a comment
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.
only nitpick: make sure the return shape matches.
| organic_results.append(item) | ||
|
|
||
| # Keep all original fields, but overwrite "organic" | ||
| response_data = dict(data) |
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.
not sure if the returned object is the same shape.
Describe this PR
What changed?
Why?
Related issues
Checklist for PR
Write a descriptive PR title following the Angular commit message format:
<type>(<scope>): <subject>feat(agent): add pdf tool via mcp,perf: make llm client async,fix(utils): load custom config via importlibfeat,fix,docs,style,refactor,perf,test,build,ci,revertcheck-pr-titleCI job will validate your title formatUpdate README❌ Missing type and colonfeat add new feature❌ Missing colon after typeFeature: add new tool❌ Invalid type (should befeat)feat(Agent): add tool❌ Scope should be lowercasefeat(): add tool❌ Empty scope not allowedfeat(my_scope): add tool❌ Underscores not allowed in scopefeat(my space): add tool❌ Space not allowed in scopefeat(scope):add tool❌ Missing space after colonfeat(scope):❌ Empty subjectRun lint and format locally:
uv tool run [email protected] check --fix .uv tool run [email protected] format .lintenforces ruff default format/lint rules on all new codes.