[Diagnostic] MCP tools fail with stale cache path after cache clear #144

Closed
opened 2026-01-24 17:50:19 +00:00 by lmiranda · 0 comments
Owner

Diagnostic Report

Generated: 2026-01-24T17:50:00Z
Command Tested: /doc-guardian:doc-audit followed by cache clear
Reporter: Claude Code via /debug-report

Project Context

Field Value
Repository personal-projects/leo-claude-mktplace
Git Remote ssh://git@hotserv.tailc9b278.ts.net:2222/personal-projects/leo-claude-mktplace.git
Working Directory /home/lmiranda/claude-plugins-work
Current Branch development

Diagnostic Results

Test 1: validate_repo_org

Call: validate_repo_org(repo="personal-projects/leo-claude-mktplace")
Status: PASS
Response:

{"is_organization": false}

Test 2: get_labels

Call: get_labels(repo="personal-projects/leo-claude-mktplace")
Status: FAIL
Response:

Error: Could not find a suitable TLS CA certificate bundle, invalid path: /home/lmiranda/.claude/plugins/cache/leo-claude-mktplace/projman/3.1.0/mcp-servers/gitea/.venv/lib/python3.11/site-packages/certifi/cacert.pem

Test 3: list_issues

Call: list_issues(repo="personal-projects/leo-claude-mktplace", state="open")
Status: FAIL
Response:

Error: Could not find a suitable TLS CA certificate bundle, invalid path: /home/lmiranda/.claude/plugins/cache/leo-claude-mktplace/projman/3.1.0/mcp-servers/gitea/.venv/lib/python3.11/site-packages/certifi/cacert.pem

Test 4: list_milestones

Call: list_milestones(repo="personal-projects/leo-claude-mktplace")
Status: FAIL
Response:

Error: Could not find a suitable TLS CA certificate bundle, invalid path: /home/lmiranda/.claude/plugins/cache/leo-claude-mktplace/projman/3.1.0/mcp-servers/gitea/.venv/lib/python3.11/site-packages/certifi/cacert.pem

Test 5: suggest_labels

Call: suggest_labels(repo="personal-projects/leo-claude-mktplace", context="Test bug fix for authentication")
Status: PASS
Response:

[]

Summary

  • Total Tests: 5
  • Passed: 2
  • Failed: 3

Failed Tools

  • get_labels: TLS cert bundle not found at cache path
  • list_issues: TLS cert bundle not found at cache path
  • list_milestones: TLS cert bundle not found at cache path

Error Category

  • Environment/Path - MCP server referencing non-existent cache directory

Hypothesis

Root Cause: MCP tools were loaded into Claude Code's session from the plugin cache before the cache was cleared. The tool definitions include hardcoded paths to the venv inside the cache directory.

Why some tools work: validate_repo_org and suggest_labels may use different code paths that don't require the certifi bundle (e.g., local-only operations or different HTTP client configuration).

Why this is a problem: Clearing the cache is a documented troubleshooting step (rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/), but doing so mid-session breaks MCP tools that were already loaded.

Suggested Investigation

  1. Check how MCP server paths are resolved at tool load time vs execution time
  2. Investigate if Claude Code caches tool definitions with absolute paths
  3. Determine if MCP servers should use installed path instead of cache path
  4. Consider adding cache existence validation before MCP tool execution

Reproduction Steps

  1. Navigate to /home/lmiranda/claude-plugins-work
  2. Use any MCP tool successfully (loads from cache)
  3. Run rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/
  4. Try to use MCP tools that make HTTP requests
  5. Observe TLS cert bundle error pointing to deleted cache path

Workaround

Restart Claude Code session after clearing cache to reload tool definitions from the installed marketplace path.


Generated by /debug-report - Labels: Type: Bug, Source: Diagnostic, Agent: Claude, Component: MCP

## Diagnostic Report **Generated**: 2026-01-24T17:50:00Z **Command Tested**: /doc-guardian:doc-audit followed by cache clear **Reporter**: Claude Code via /debug-report ## Project Context | Field | Value | |-------|-------| | Repository | `personal-projects/leo-claude-mktplace` | | Git Remote | `ssh://git@hotserv.tailc9b278.ts.net:2222/personal-projects/leo-claude-mktplace.git` | | Working Directory | `/home/lmiranda/claude-plugins-work` | | Current Branch | `development` | ## Diagnostic Results ### Test 1: validate_repo_org **Call**: `validate_repo_org(repo="personal-projects/leo-claude-mktplace")` **Status**: PASS **Response**: ```json {"is_organization": false} ``` ### Test 2: get_labels **Call**: `get_labels(repo="personal-projects/leo-claude-mktplace")` **Status**: FAIL **Response**: ``` Error: Could not find a suitable TLS CA certificate bundle, invalid path: /home/lmiranda/.claude/plugins/cache/leo-claude-mktplace/projman/3.1.0/mcp-servers/gitea/.venv/lib/python3.11/site-packages/certifi/cacert.pem ``` ### Test 3: list_issues **Call**: `list_issues(repo="personal-projects/leo-claude-mktplace", state="open")` **Status**: FAIL **Response**: ``` Error: Could not find a suitable TLS CA certificate bundle, invalid path: /home/lmiranda/.claude/plugins/cache/leo-claude-mktplace/projman/3.1.0/mcp-servers/gitea/.venv/lib/python3.11/site-packages/certifi/cacert.pem ``` ### Test 4: list_milestones **Call**: `list_milestones(repo="personal-projects/leo-claude-mktplace")` **Status**: FAIL **Response**: ``` Error: Could not find a suitable TLS CA certificate bundle, invalid path: /home/lmiranda/.claude/plugins/cache/leo-claude-mktplace/projman/3.1.0/mcp-servers/gitea/.venv/lib/python3.11/site-packages/certifi/cacert.pem ``` ### Test 5: suggest_labels **Call**: `suggest_labels(repo="personal-projects/leo-claude-mktplace", context="Test bug fix for authentication")` **Status**: PASS **Response**: ```json [] ``` ## Summary - **Total Tests**: 5 - **Passed**: 2 - **Failed**: 3 ### Failed Tools - `get_labels`: TLS cert bundle not found at cache path - `list_issues`: TLS cert bundle not found at cache path - `list_milestones`: TLS cert bundle not found at cache path ### Error Category - [x] Environment/Path - MCP server referencing non-existent cache directory ### Hypothesis **Root Cause**: MCP tools were loaded into Claude Code's session from the plugin cache before the cache was cleared. The tool definitions include hardcoded paths to the venv inside the cache directory. **Why some tools work**: `validate_repo_org` and `suggest_labels` may use different code paths that don't require the certifi bundle (e.g., local-only operations or different HTTP client configuration). **Why this is a problem**: Clearing the cache is a documented troubleshooting step (`rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/`), but doing so mid-session breaks MCP tools that were already loaded. ### Suggested Investigation 1. Check how MCP server paths are resolved at tool load time vs execution time 2. Investigate if Claude Code caches tool definitions with absolute paths 3. Determine if MCP servers should use installed path instead of cache path 4. Consider adding cache existence validation before MCP tool execution ## Reproduction Steps 1. Navigate to `/home/lmiranda/claude-plugins-work` 2. Use any MCP tool successfully (loads from cache) 3. Run `rm -rf ~/.claude/plugins/cache/leo-claude-mktplace/` 4. Try to use MCP tools that make HTTP requests 5. Observe TLS cert bundle error pointing to deleted cache path ## Workaround Restart Claude Code session after clearing cache to reload tool definitions from the installed marketplace path. --- *Generated by /debug-report - Labels: Type: Bug, Source: Diagnostic, Agent: Claude, Component: MCP*
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#144