Skip to content

bugfix/github mcp crash - #19

Merged
Dumbris merged 3 commits into
mainfrom
bugfix/github-mcp-crash
Jul 15, 2025
Merged

Dumbris merged 3 commits into
mainfrom
bugfix/github-mcp-crash

Conversation

@Dumbris

@Dumbris Dumbris commented Jul 15, 2025

Copy link
Copy Markdown
Member
  • Enhance error handling in MCP client and server for OAuth authentication
  • Enhance OAuth error handling and logging in client connection

Dumbris added 3 commits July 15, 2025 10:25
- Implemented comprehensive error classification for OAuth-related issues in the MCPProxyServer and Client.
- Refactored error handling to provide user-friendly messages and recovery instructions for various OAuth scenarios.
- Added safety checks and logging enhancements during Dynamic Client Registration to improve robustness and traceability.
- Improved validation and diagnostics for OAuth handler state before proceeding with Dynamic Client Registration.
- Added detailed logging for metadata investigation and potential OAuth endpoints.
- Enhanced error classification and user-friendly messages for various OAuth scenarios, including unsupported DCR and metadata unavailability.
- Implemented cleanup and recovery instructions to guide users through OAuth setup failures.
…nd Client

- Improved error messages with enriched context for OAuth-related issues, connection errors, and permission denials.
- Refactored error handling in CallTool methods to provide clearer guidance and recovery instructions.
- Removed deprecated error classification function to streamline code and improve maintainability.
@Dumbris
Dumbris merged commit e249f27 into main Jul 15, 2025
@Dumbris
Dumbris deleted the bugfix/github-mcp-crash branch July 16, 2025 14:36
rannow pushed a commit to rannow/mcpproxy-go that referenced this pull request Sep 23, 2025
* Enhance error handling in MCP client and server for OAuth authentication

- Implemented comprehensive error classification for OAuth-related issues in the MCPProxyServer and Client.
- Refactored error handling to provide user-friendly messages and recovery instructions for various OAuth scenarios.
- Added safety checks and logging enhancements during Dynamic Client Registration to improve robustness and traceability.

* Enhance OAuth error handling and logging in client connection

- Improved validation and diagnostics for OAuth handler state before proceeding with Dynamic Client Registration.
- Added detailed logging for metadata investigation and potential OAuth endpoints.
- Enhanced error classification and user-friendly messages for various OAuth scenarios, including unsupported DCR and metadata unavailability.
- Implemented cleanup and recovery instructions to guide users through OAuth setup failures.

* Enhance error handling and logging for tool calls in MCPProxyServer and Client

- Improved error messages with enriched context for OAuth-related issues, connection errors, and permission denials.
- Refactored error handling in CallTool methods to provide clearer guidance and recovery instructions.
- Removed deprecated error classification function to streamline code and improve maintainability.
Dumbris added a commit that referenced this pull request Jun 22, 2026
…P-42) (#747)

* feat(bench): token-reduction benchmark harness over frozen corpus (MCP-42)

Ship the first, fully-deterministic slice of the roadmap-#19 benchmark: the
token-reduction numbers behind the "massive token savings" claim. Reuses the
frozen Spec 065 tool corpus (45 tools, 7 reference servers) as a versioned,
non-drifting universe and tiktoken cl100k_base (already a dep) as a
reproducible model-agnostic estimator.

Compares the three routing modes' static context cost:
- baseline (all upstream tools loaded directly)
- retrieve_tools (BM25 discovery + call_tool variants)
- code_execution (orchestration + retrieve_tools)

over the corpus and reports per-mode savings. Real proxy tool defs are captured
verbatim from internal/server/mcp.go into bench/proxy_tools_v1.json (provenance
recorded). Emits report.json + a self-contained dashboard.html (gitignored;
reports never committed, per Spec 065 CN-003).

Conservative by construction: input schemas excluded uniformly understates the
baseline, so measured savings (65.5% / 70.3% on the 45-tool corpus) are a floor.

Methodology, limitations, and the scoped-but-not-yet-built follow-ups (live run
with full schemas + accuracy/latency, LLM e2e, CI publish) are in bench/README.md.

Related #MCP-42

Co-Authored-By: Paperclip <[email protected]>

* fix(bench): drop stale line numbers from provenance; add WriteReports smoke test

KimiReviewer finding 2: code_execution is at line 626 in mcp.go at 89f06b5,
not 675 as claimed. Line numbers drift with unrelated edits and the actual
function names are the stable identifier — remove all line numbers from the
provenance comment to prevent future rot.

KimiReviewer finding 3: add TestWriteReports_SmokeTest covering WriteReports
output (JSON round-trips to Report, HTML is non-empty and contains all mode
names). All 5 tests pass; golangci-lint v2 clean.

Related #MCP-42

Co-Authored-By: Paperclip <[email protected]>

* fix(bench): derive per-mode tool catalog from live server builders incl. management tools (MCP-3161)

The token-reduction benchmark scored only 6 hand-maintained proxy tools and
omitted the shared management tool set (upstream_servers, quarantine_security,
search_servers, list_registries) that both routing modes append via
buildManagementTools. That undercounted the proxy-mode context cost and
inflated the headline savings (Codex finding on PR #747).

Replace bench/proxy_tools_v1.json with server.ProxyModeToolDefs, which builds
the catalog from the live builders (buildCallToolModeTools /
buildCodeExecModeTools in internal/server/mcp_routing.go) so it can never drift
from production and always reflects the tools the agent actually sees. This
also fixes a second drift: the fixture's retrieve_tools descriptions did not
match the per-mode builder descriptions.

Corrected figures over the 45-tool Spec 065 corpus (name+description only):
retrieve_tools ~17% (10 tools), code_execution ~43% (6 tools). Updated README
and notes; the schema-exclusion claim is no longer unambiguously conservative
now that large-schema management tools are in the proxy cost.

Tests: bench asserts both modes include the 4 management tools; internal/server
pins ProxyModeToolDefs to the builders so the catalog can't silently drift.

Related #747

---------

Co-authored-by: Paperclip <[email protected]>
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