Skip to content

Conversation

@ntudy
Copy link
Contributor

@ntudy ntudy commented Oct 13, 2025

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>

    • Examples: feat(agent): add pdf tool via mcp, perf: make llm client async, fix(utils): load custom config via importlib
    • Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, revert
    • The check-pr-title CI job will validate your title format
    • Bad title examples and why they fail:
      • Update README ❌ Missing type and colon
      • feat add new feature ❌ Missing colon after type
      • Feature: add new tool ❌ Invalid type (should be feat)
      • feat(Agent): add tool ❌ Scope should be lowercase
      • feat(): add tool ❌ Empty scope not allowed
      • feat(my_scope): add tool ❌ Underscores not allowed in scope
      • feat(my space): add tool ❌ Space not allowed in scope
      • feat(scope):add tool ❌ Missing space after colon
      • feat(scope): ❌ Empty subject
  • Run lint and format locally:

Copy link
Contributor

Copilot AI left a 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")
Copy link

Copilot AI Oct 13, 2025

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.

Copilot uses AI. Check for mistakes.

try:
# Build payload with all supported parameters
payload: dict[str, Any] = {
Copy link

Copilot AI Oct 13, 2025

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.

Suggested change
payload: dict[str, Any] = {
payload: Dict[str, Any] = {

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@gali-leilei gali-leilei left a 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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ntudy ntudy merged commit 234d2c0 into miroflow-v0.3 Oct 13, 2025
3 checks passed
@ntudy ntudy deleted the miroapi branch October 13, 2025 09:06
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.

3 participants