byterover-cli icon indicating copy to clipboard operation
byterover-cli copied to clipboard

[BUG] Claude Code MCP Tool Registration Failure for @byterover/cipher Package

Open krasmussen37 opened this issue 1 year ago • 3 comments

Bug Description

The @byterover/cipher MCP server fails to register tools in Claude Code due to OpenAI function schema validation errors. While the cipher MCP server successfully initializes and is discoverable by Claude Code, the tools are not loaded into the available toolset, preventing their use.

Error Details

Schema Validation Error:

Invalid schema for function 'cipher_evaluate_reasoning': In context=('properties', 'trace', 'properties', 'steps'), array schema missing items.

Expected Tools (21 total):

  • cipher_extract_and_operate_memory
  • cipher_memory_search
  • cipher_store_reasoning_memory
  • cipher_extract_reasoning_steps
  • cipher_evaluate_reasoning ⚠️ (problematic tool)
  • cipher_search_reasoning_patterns
  • ask_cipher
  • read_file, read_text_file, read_media_file
  • write_file, edit_file
  • create_directory, list_directory, list_directory_with_sizes
  • directory_tree, move_file, search_files
  • get_file_info, list_allowed_directories

System Information

  • OS: Linux (WSL2) 6.6.87.2-microsoft-standard-WSL2
  • Platform: x86_64 GNU/Linux
  • Claude Code: 1.0.60
  • Node.js: v22.17.1
  • NPM: 10.9.2
  • Cipher Package: @byterover/[email protected] (latest)

MCP Configuration

.mcp.json:

{
  "mcpServers": {
    "cipher": {
      "type": "stdio",
      "command": "npx",
      "args": ["@byterover/cipher", "--mode", "mcp"],
      "env": {
        "OPENAI_API_KEY": "[REDACTED]",
        "VECTOR_STORE_TYPE": "milvus",
        "VECTOR_STORE_URL": "http://localhost:19531",
        "REDIS_URL": "redis://localhost:6380",
        "MCP_SERVER_MODE": "aggregator",
        "AGGREGATOR_CONFLICT_RESOLUTION": "prefix"
      }
    }
  }
}

Reproduction Steps

  1. Install @byterover/[email protected] package
  2. Configure .mcp.json with cipher MCP server configuration
  3. Start Claude Code
  4. Verify MCP server initialization in cipher logs
  5. Attempt to use cipher tools - they won't be available

Current Behavior

  • ✅ Cipher MCP server starts successfully
  • ✅ Claude Code discovers and connects to cipher MCP server
  • ✅ Server registers 21 tools internally
  • ❌ Tools are not available in Claude Code's toolset
  • ❌ Schema validation fails for cipher_evaluate_reasoning function

Expected Behavior

  • All 21 cipher tools should be available in Claude Code
  • Functions should pass OpenAI schema validation
  • Tools should be callable without schema errors

Technical Analysis

Root Cause: The cipher_evaluate_reasoning tool has an invalid OpenAI function schema where an array property trace.properties.steps is missing the required items field, causing the entire toolset to be rejected during registration.

Evidence from Cipher Logs:

2025-08-04 09:49:36 [ERROR]: Error in OpenAI API call (Attempt 1/3): 400 Invalid schema for function 'cipher_evaluate_reasoning': In context=('properties', 'trace', 'properties', 'steps'), array schema missing items.

Impact: This prevents all cipher functionality from being available in Claude Code, including memory search, storage, and reasoning capabilities.

Additional Context

  • Other MCP servers work: CodeRabbit and Exa.ai MCP tools load successfully
  • Server discovery works: Claude Code can discover cipher when prompted
  • Manual server testing: npx @byterover/cipher --mode mcp works when API key is provided
  • Services are healthy: Milvus (port 19531) and Redis (port 6380) are running

Critical Regression Evidence

  • ✅ Cipher MCP functioned correctly yesterday (August 4th, 2025): Cipher logs show successful tool calls as recent as 2025-08-04 23:01:59 [INFO]: [MCP Handler] Tool called: cipher_extract_and_operate_memory, demonstrating the MCP server was fully operational within 24 hours of this report.

  • ✅ Zero configuration changes made: No modifications to .mcp.json, environment variables, or cipher package configuration since successful operation. The exact same configuration that worked yesterday now fails.

  • ✅ No dependency software updates occurred:

    • Claude Code binary: last modified July 24, 2025 (unchanged for weeks)
    • @byterover/[email protected]: released July 30, 2025 (unchanged for days)
    • Node.js v22.17.1 and NPM 10.9.2: stable versions, no recent updates
    • System packages: no deliberate updates performed

This represents a clear regression where identical software and configuration that worked yesterday now fails, strongly indicating an environmental change or transient issue rather than a configuration problem.

Workaround Attempted

Temporarily excluding the problematic tool is not supported by the cipher package configuration.

Expected Fix

Update the cipher_evaluate_reasoning tool schema to include the required items property for array fields to comply with OpenAI function calling specification.

Community Impact

This affects all users trying to integrate @byterover/cipher with Claude Code and potentially other MCP clients with strict schema validation.

krasmussen37 avatar Aug 05 '25 16:08 krasmussen37

Thanks for your feedback. We will tackle in day

billcache avatar Aug 05 '25 16:08 billcache

Hey @krasmussen37, we think it is an issue with v0.2.0. Please check out our latest release v0.2.1 on npm to see if it's fixed! One thing to note is that, by design, cipher_extract_reasoning_steps gotta be called first (to extract reasoning) and then cipher_evaluate_reasoning to evaluate it. So often, claude code will try to call cipher_extract_reasoning_steps first then cipher_evaluate_reasoning. It is an expected behavior

RyanNg1403 avatar Aug 06 '25 09:08 RyanNg1403

@krasmussen37 I'll be closing this issue now, but please reopen it if the issue still persists

RyanNg1403 avatar Aug 07 '25 18:08 RyanNg1403