Skip to content

v0.6.6: MCP performance optimization - #18

Merged
padak merged 3 commits into
mainfrom
feature/mcp-performance-optimization
Mar 5, 2026
Merged

v0.6.6: MCP performance optimization#18
padak merged 3 commits into
mainfrom
feature/mcp-performance-optimization

Conversation

@padak

@padak padak commented Mar 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove @latest from uvx — eliminates ~20s PyPI check per spawn (25s → 4.5s)
  • Reorder detection: local install → python -m → uvx (fastest first)
  • Merge validate+call into single MCP session — saves one full subprocess spawn per tool call
  • Add persistent HTTP server infrastructure (mcp_transport.py) — ready for future use, default is stdio
  • Bump version 0.6.5 → 0.6.6

Performance impact

Before After Improvement
~65s per multi-project tool call ~11s ~6x faster

Note on HTTP transport

Persistent HTTP server code is included but defaulted to stdio — the MCP server can't reliably handle 34 concurrent streamable-HTTP sessions. HTTP works fine for single-project and is available via KBAGENT_MCP_TRANSPORT=http.

Test plan

  • All 718 tests pass
  • Multi-project tool call get_buckets verified at ~11s
  • Single-project HTTP transport verified working
  • Ruff lint clean

padak and others added 3 commits March 5, 2026 15:05
- Reorder detect_mcp_server_command(): local first, python -m second,
  uvx last. Remove @latest from uvx to avoid PyPI check (~25s penalty).
- Merge validate + call into single MCP session via new
  validate_and_call_tool() method, eliminating double subprocess spawn.
- Add persistent HTTP server transport (McpServerManager) that keeps
  one keboola-mcp-server running with streamable-http transport.
  Per-request project credentials via X-Storage-Token/X-Storage-API-URL
  headers allow one server to serve all projects.
- KBAGENT_MCP_TRANSPORT env var controls mode: "http" (default) or "stdio".
- Update doctor command to show transport mode and server status.
- Add test_mcp_transport.py with 20 tests for server manager.
- Update existing tests for new detection order and unified call flow.

Expected improvement: ~50s -> ~3-6s per tool call (local/cached),
~2-3s for subsequent calls via persistent HTTP server.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
HTTP transport fails with 34 concurrent MCP sessions. Default to stdio
which works reliably and still benefits from Phase 1 optimizations
(single-session validate+call, detection reorder: ~11s vs ~65s).
HTTP remains available via KBAGENT_MCP_TRANSPORT=http for single-project.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@padak
padak merged commit 1829b8e into main Mar 5, 2026
padak added a commit that referenced this pull request Mar 24, 2026
- Tip #15: ALWAYS double-quote database/schema/table names in Snowflake
  workspace queries (unquoted identifiers become UPPERCASE -> not found)
- Tip #18: How to install the kbagent Claude Code plugin for automatic
  skill triggering
padak added a commit that referenced this pull request Mar 24, 2026
Version bump to 0.9.0. Context and plugin updated with all new features:
- config list: last_modified, folder fields documented
- org setup: token owner identity documented
- Tip #18: Claude Code plugin install instructions
padak added a commit that referenced this pull request Mar 24, 2026
Version bump to 0.9.0. Context and plugin updated with all new features:
- config list: last_modified, folder fields documented
- org setup: token owner identity documented
- Tip #18: Claude Code plugin install instructions
@padak
padak deleted the feature/mcp-performance-optimization branch March 26, 2026 11:43
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.

1 participant