Skip to content

fix(aws-documentation-mcp-server): add Kiro IDE/CLI URL support and fix contradictory docstrings#2729

Open
emergingsana123 wants to merge 3 commits intoawslabs:mainfrom
emergingsana123:search_documentation_kiro
Open

fix(aws-documentation-mcp-server): add Kiro IDE/CLI URL support and fix contradictory docstrings#2729
emergingsana123 wants to merge 3 commits intoawslabs:mainfrom
emergingsana123:search_documentation_kiro

Conversation

@emergingsana123
Copy link

@emergingsana123 emergingsana123 commented Mar 19, 2026

Summary

When users queried aws-documentation-mcp-server for Kiro IDE/CLI topics
(e.g. "Kiro CLI custom agents"), the server returned empty results with no
guidance. Three root causes were identified and fixed:

  1. kiro.dev URLs were rejected by URL validation — Kiro docs use trailing-slash
    URLs (/docs/cli/custom-agents/creating/) but the regex required .html endings
  2. read_documentation docstring contradicted itself — claimed to support any URL
    but also stated "must be docs.aws.amazon.com"
  3. search_documentation gave no warning that it cannot search Kiro docs,
    leaving users with a silent empty result and no fallback guidance

Changes

server_aws.py

  • URL validation regex updated to accept kiro.dev/docs/ trailing-slash URLs
  • Removed kiro from SEARCH_TERM_DOMAIN_MODIFIERS — AWS search API does not
    index kiro.dev, modifier produced empty results and contradicted docstring
  • read_documentation docstring: lists all supported domains (AWS, Kiro, Neuron),
    removes contradictory domain restriction
  • search_documentation docstring: added scope warning with Kiro URLs to use
    with read_documentation instead

server_aws_cn.py

  • Same URL validation and docstring fixes applied for consistency

README.md

  • Corrected scope section to accurately list all domains supported by
    read_documentation, not just docs.aws.amazon.com
  • Added workaround examples for Kiro-specific queries

tests/test_server_aws.py

  • Added test_read_documentation_works_for_kiro_url (live)
  • Added test_search_documentation_docstring_mentions_kiro
  • Added @pytest.mark.asyncio to Kiro live test (was failing with --run-live)
  • Removed malformed module-level orphan test functions

tests/test_server_aws_cn.py

  • Equivalent Kiro docstring and URL validation tests added for China partition

tests/test_edge_cases_kiro.py

  • Replaced no-op assert ... or True with real module-level function assertion
  • Updated Kiro regex test to cover optional port numbers in URLs

tests/conftest.py

  • Registered requires_uv marker using existing pytest_collection_modifyitems
    pattern (same approach as --run-live tests)

tests/test_integ_basic.py

  • Added @pytest.mark.requires_uv to 3 integration tests that require uv

Test Results

Suite Command Result
Kiro-focused tests/test_server_aws.py, test_server_aws_cn.py, test_edge_cases_kiro.py 81 passed, 1 skipped
Kiro live async spot-check test_server_aws.py::test_read_documentation_works_for_kiro_url --run-live 1 passed
Full suite + coverage python -m pytest --cov --cov-branch --cov-report=term-missing 172 passed, 19 skipped, 97% coverage

Note on 3 failing tests

tests/test_integ_basic.py contains 3 infrastructure integration tests that
launch the server subprocess via uv. These fail in CI environments where uv
is not on PATH — this is an environmental constraint, not a product regression.
They are unrelated to any Kiro code changes in this PR. A @pytest.mark.requires_uv
guard was added so they skip gracefully instead of failing when uv is unavailable.

Backward Compatibility

No breaking changes. All existing AWS URL patterns, tool signatures, and
search behavior are unchanged. Kiro support is purely additive.


fixes #2680
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.

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 improves aws-documentation-mcp-server handling of Kiro IDE/CLI documentation by expanding read_documentation URL validation to accept kiro.dev/docs/... URLs and by clarifying tool docstrings/README scope so users understand when to use read_documentation vs search_documentation.

Changes:

  • Extend read_documentation URL validation to accept Kiro docs URLs (and update docstrings to list supported domains).
  • Update search_documentation docstring + server README to document that search is limited to AWS docs and provide Kiro URL workarounds.
  • Add/adjust tests for Kiro URL support and docstring expectations.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/aws-documentation-mcp-server/awslabs/aws_documentation_mcp_server/server_aws.py Expands supported URL validation to include kiro.dev/docs/ and updates tool docstrings.
src/aws-documentation-mcp-server/awslabs/aws_documentation_mcp_server/server_aws_cn.py Mirrors domain support/docstring updates for the China server’s read_documentation.
src/aws-documentation-mcp-server/README.md Documents scope (what can be searched vs directly read) and provides Kiro usage examples.
src/aws-documentation-mcp-server/tests/test_server_aws.py Updates validation expectations and adds live/docstring tests for Kiro guidance.
src/aws-documentation-mcp-server/tests/test_server_aws_cn.py Updates assertions to match the updated validation error messaging.
src/aws-documentation-mcp-server/tests/test_edge_cases_kiro.py Adds comprehensive Kiro/URL-validation edge case tests and docstring structure assertions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

aws-documentation-mcp-server: Update documentation mcp server to provide information about capabilities and configurations in KIRO - CLI and IDE

2 participants