Skip to content

test(mcp): add comprehensive integration tests for MCP servers (#838)#3456

Open
devgabriellopes wants to merge 2 commits intoadenhq:mainfrom
devgabriellopes:testing-coverage-gaps-in-mcp-servers
Open

test(mcp): add comprehensive integration tests for MCP servers (#838)#3456
devgabriellopes wants to merge 2 commits intoadenhq:mainfrom
devgabriellopes:testing-coverage-gaps-in-mcp-servers

Conversation

@devgabriellopes
Copy link

Description

Adds comprehensive integration tests for the MCP server implementations (agent_builder_server.py and tools/mcp_server.py). These servers had disproportionately low test coverage (~60-300 LOC of tests for ~3000 LOC of implementation) relative to their complexity and criticality as the main API layer for agent building.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)

Related Issues

Fixes #838

Changes Made

  • Added core/tests/test_agent_builder_server_integration.py (~1700 LOC) with tests for:
    • Session lifecycle (create, load, list, delete)
    • Goal management and validation
    • Node operations (add, update, delete, duplicate detection)
    • Edge operations (add, delete, source/target validation)
    • Graph validation (empty graphs, unreachable nodes, context flow)
  • Added tools/tests/test_mcp_server_integration.py (~207 LOC) with tests for:
    • Server module imports and structure
    • Tool registration and validation
    • Credential manager initialization
    • Package exports verification
  • Used tmp_path fixtures and monkeypatch to mock filesystem operations, avoiding disk artifacts

Testing

Describe the tests you ran to verify your changes:

  • Unit tests pass (cd core && pytest tests/)
  • Lint passes (cd core && ruff check .)
  • Manual testing performed
PYTHONPATH=core:exports python -m pytest core/tests/test_agent_builder_server_integration.py -v
PYTHONPATH=core:exports python -m pytest tools/tests/test_mcp_server_integration.py -v

@devgabriellopes devgabriellopes changed the title test(mcp): add comprehensive integration tests for MCP servers test(mcp): add comprehensive integration tests for MCP servers (#838) Feb 3, 2026
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.

[Feature]: Testing Coverage Gaps in MCP Servers

1 participant